Skip to contentSkip to conversation

binutils: fix AR issue when opkg is unpacking IPKs containing empty entries

PATCH In review Martin Jansa 2 participants 6 messages Oct 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binutils: fix AR issue when opkg is unpacking IPKs containing empty entries

From: Christophe Chapuis <[email protected]>

* this patch is backported from 2.26.1 which is already in oe-core/master since this patch:
commit 37e8b6ecf9f9163d7b5b3becdc2feba57df4838f
Author: Khem Raj <[email protected]>
Date: Thu Jul 7 11:08:29 2016 -0700
Subject: binutils: Upgrade to 2.26.1

-SRCREV = "71fa566a9cf2597b60a58c1d7c148bab637454a6" +SRCREV = "c29838e7f484e0b5714b02e7feb9a88d3a045dd2"

* verified that the patch exists in this SRCREV range:
~/projects/binutils $ git log --oneline 71fa566a9cf2597b60a58c1d7c148bab637454a6..c29838e7f484e0b5714b02e7feb9a88d3a045dd2^C
...
343a405 Allow zero length archive elements
...
so it isn't needed in master branch

---
 meta/recipes-devtools/binutils/binutils-2.26.inc   |   1 +
 .../binutils/0015-allow-zero-length-elements.patch | 130 +++++++++++++++++++++
 2 files changed, 131 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0015-allow-zero-length-elements.patch
meta/recipes-devtools/binutils/binutils-2.26.inc +1 -0
index 06ce245..4b33b04 100644
@@ -34,6 +34,7 @@ SRC_URI = "\
      file://0012-Add-support-for-Netlogic-XLP.patch \
      file://0013-Fix-GOT-address-computations-in-initial-PLT-entries-.patch \
      file://0014-Correct-nios2-_gp-address-computation.patch \
+     file://0015-allow-zero-length-elements.patch \
      file://aarch64-tls.patch \
 "
 S  = "${WORKDIR}/git"
meta/recipes-devtools/binutils/binutils/0015-allow-zero-length-elements.patch new file +106 -0

106 lines not on this page · raw message

" $got] {
++ fail $testname
++ return
++ }
++
++ pass $testname
++}
++
+ # Run the tests.
+
+ # Only run the bfdtest checks if the programs exist. Since these
+@@ -574,6 +613,7 @@ argument_parsing
+ deterministic_archive
+ delete_an_element
+ move_an_element
++empty_archive
+
+ if { [is_elf_format]
+ && ![istarget "*-*-hpux*"]
+diff --git a/binutils/testsuite/binutils-all/empty b/binutils/testsuite/binutils-all/empty +new file mode 100644
+index 0000000..e69de29
+--
+1.7.1
+

Signature · 1 line
2.10.1
#1 lore raw
Quoted 9 lines · Martin Jansa

++    # This commmand used to fail with: "Malformed archive". ++    set got [binutils_run $AR "-t $archive"]
++    if ![string match "empty
" $got] {
++ fail $testname
++ return
++    }
++
++    pass $testname

The patch fails to apply due to the above corruption (line not starting ++). Could you resend or point to a branch with the patch on please?

Cheers,

Richard

#2 lore raw

Strange,

it's included here:
http://git.openembedded.org/openembedded-core-contrib/log/?h=jansa/krogoth-backports

until next rebase it's this commit SHA:
http://git.openembedded.org/openembedded-core-contrib/commit/?h=jansa/krogoth-backports&id=9d56d74bc2f42cbd6ee6ad1dbddb378a020bbe93

Thanks for quick reply

Quoted 18 lines · Richard Purdie
Quoted 9 lines · Martin Jansa
++    # This commmand used to fail with: "Malformed archive".
++    set got [binutils_run $AR "-t $archive"]
++    if ![string match "empty
" $got] {
++    fail $testname
++    return
++    }

++
++ pass $testname

The patch fails to apply due to the above corruption (line not starting ++). Could you resend or point to a branch with the patch on please?

Cheers,

Richard

#3 lore raw

I see this strange line also in that branch, I'm checking log.do_patch to see how it's possible that it did apply to me OK.

Quoted 36 lines · Martin Jansa

Strange,

it's included here:
http://git.openembedded.org/openembedded-core-contrib/log/
?h=jansa/krogoth-backports

until next rebase it's this commit SHA:
http://git.openembedded.org/openembedded-core-contrib/
commit/?h=jansa/krogoth-backports&id=9d56d74bc2f42cbd6ee6ad1dbddb37 8a020bbe93

Thanks for quick reply

Quoted 18 lines · Richard Purdie
Quoted 9 lines · Martin Jansa
++    # This commmand used to fail with: "Malformed archive".
++    set got [binutils_run $AR "-t $archive"]
++    if ![string match "empty
" $got] {
++    fail $testname
++    return
++    }

++
++ pass $testname

The patch fails to apply due to the above corruption (line not starting ++). Could you resend or point to a branch with the patch on please?

Cheers,

Richard

#4 lore raw

I see, there is ^M after empty in the actual .patch file, if I read the git format-patch output it shows ^M, but the git webUI gets confused and shows ^M as normal line feed.

++ if ![string match "empty^M" $got] {

Does it work for you when cherry-picking from the branch.

Here is the same change in binutils git repo:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blobdiff;f=binutils/testsuite/binutils-all/ar.exp;h=45be9b1b594b39624f3e010f50bf98892fb64549;hp=508ae9c1d7562c8b0a2c090a93e35acdba733944;hb=4fc874242f8f1bf17cf6e65b159dd804e793e6cd;hpb=23a4bd22c75862fdbaa5faef59b9094ec738f675

It shows '\r' so it isn't there by accident.

Quoted 42 lines · Martin Jansa

I see this strange line also in that branch, I'm checking log.do_patch to see how it's possible that it did apply to me OK.

Quoted 35 lines · Martin Jansa

Strange,

it's included here:
http://git.openembedded.org/openembedded-core-contrib/log/?
h=jansa/krogoth-backports

until next rebase it's this commit SHA:
http://git.openembedded.org/openembedded-core-contrib/commit
/?h=jansa/krogoth-backports&id=9d56d74bc2f42cbd6ee6ad1dbddb378a020bbe93

Thanks for quick reply

Quoted 18 lines · Richard Purdie
Quoted 9 lines · Martin Jansa
++    # This commmand used to fail with: "Malformed archive".
++    set got [binutils_run $AR "-t $archive"]
++    if ![string match "empty
" $got] {
++    fail $testname
++    return
++    }

++
++ pass $testname

The patch fails to apply due to the above corruption (line not starting ++). Could you resend or point to a branch with the patch on please?

Cheers,

Richard

#5 lore raw
Quoted 8 lines · Martin Jansa

I see, there is ^M after empty in the actual .patch file, if I read the git format-patch output it shows ^M, but the git webUI gets confused and shows ^M as normal line feed.

++    if ![string match "empty^M" $got] {

Does it work for you when cherry-picking from the branch.

Quoted 8 lines

Here is the same change in binutils git repo:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blobdiff;f
=binutils/testsuite/binutils- all/ar.exp;h=45be9b1b594b39624f3e010f50bf98892fb64549;hp=508ae9c1d756 2c8b0a2c090a93e35acdba733944;hb=4fc874242f8f1bf17cf6e65b159dd804e793e 6cd;hpb=23a4bd22c75862fdbaa5faef59b9094ec738f675

It shows '\r' so it isn't there by accident.

I've been able to cherry-pick it, thanks. I figured it was something odd going on with the mailing list damaging line returns.

Cheers,

Richard