Skip to contentSkip to conversation

How do I patch binutils for the SDK

DISCUSSION Paul D. DeRocco 3 participants 7 messages Oct 12, 2017 – Oct 13, 2017

lore
Share & tools
lore
#0 lore raw

I found a bug in the GNU assembler that makes it produce corrupted listings, reported it on sourceware bugzilla, and it has been fixed. Now I'd like to take those small patches and apply them to the assembler that winds up in the SDK. The patches are shown here:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4c
a4dec6ed27339618a5d5dc366

The only recipe I found in Pyro that seemed appropriate was meta/recipes-devtools/binutils/binutils-crosssdk_2.28.bb, so I created a binutils-crosssdk_%.bbappend in my layer with a FILESEXTRAPATHS_prepend and a SRC_URI listing the patches, which I put into a binutils subdirectory.

When I ran the populate_sdk task, the patches failed because they didn't find the source files, which are supposed to be in a subdirectory called gas.

So I'm wondering, is this the wrong recipe? Does something else build gas? Or am I just doing this wrong? The workings of the build system are pretty opaque and mysterious.

Signature · 2 lines
Ciao,               Paul D. DeRocco
Paul                mailto:[email protected]
#1 lore raw
Quoted 14 lines · Paul D. DeRocco

I found a bug in the GNU assembler that makes it produce corrupted listings, reported it on sourceware bugzilla, and it has been fixed. Now I'd like to take those small patches and apply them to the assembler that winds up in the SDK. The patches are shown here:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4c
a4dec6ed27339618a5d5dc366

The only recipe I found in Pyro that seemed appropriate was meta/recipes-devtools/binutils/binutils-crosssdk_2.28.bb, so I created a binutils-crosssdk_%.bbappend in my layer with a FILESEXTRAPATHS_prepend and a SRC_URI listing the patches, which I put into a binutils subdirectory.

Quoted 7 lines

When I ran the populate_sdk task, the patches failed because they didn't find the source files, which are supposed to be in a subdirectory called gas.

So I'm wondering, is this the wrong recipe? Does something else build gas? Or am I just doing this wrong? The workings of the build system are pretty opaque and mysterious.

You can apply the patch to all binutils variants, its fine. Send a patch or if you want, file a ticket in bugzilla and we will take care.

Quoted 11 lines
Signature · 10 lines
-- 

Ciao,               Paul D. DeRocco
Paul                mailto:[email protected]

-- 
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
#2 lore raw
Quoted 5 lines

From: Khem Raj [mailto:[email protected]]

You can apply the patch to all binutils variants, its fine. Send a patch or if you
want, file a ticket in bugzilla and we will take care.

Yocto's Bugzilla isn't recognizing my password, and when it says that it's emailed me a password change message, it doesn't show up. However, the four small patches are in the Sourceware binutils-gdb GIT repo, at the link I mentioned:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4c
a4dec6ed27339618a5d5dc366

Just to verify, my binutils-crosssdk_%.bbappend file contains:

FILESEXTRAPATHS_prepend := "${THISDIR}/binutils:"

SRC_URI = "                         \
    file://gas_as.h.patch           \
    file://gas_ChangeLog.patch      \
    file://gas_input-scrub.c.patch  \
    file://gas_listing.c.patch      \
    "

and the patches from that Bugzilla page are in a binutils directory. The errors I get indicate that the patches are being attempted, but aren't matching up with any source files.

Signature · 2 lines
Ciao,               Paul D. DeRocco
Paul                mailto:[email protected]
#3 lore raw
Quoted 16 lines · Paul D. DeRocco
Quoted 5 lines

From: Khem Raj [mailto:[email protected]]

You can apply the patch to all binutils variants, its fine. Send a patch or if you
want, file a ticket in bugzilla and we will take care.

Yocto's Bugzilla isn't recognizing my password, and when it says that it's emailed me a password change message, it doesn't show up. However, the four small patches are in the Sourceware binutils-gdb GIT repo, at the link I mentioned:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4c
a4dec6ed27339618a5d5dc366

Just to verify, my binutils-crosssdk_%.bbappend file contains:

Quoted 9 lines

FILESEXTRAPATHS_prepend := "${THISDIR}/binutils:"

SRC_URI = "                         \
    file://gas_as.h.patch           \
    file://gas_ChangeLog.patch      \
    file://gas_input-scrub.c.patch  \
    file://gas_listing.c.patch      \
    "

you can just make 1 patch download

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=39865a7f420ab4ca4dec6ed27339618a5d5dc366;hp=fe22022617a7122491aa83c893a10a8d861cde73

and delete the hunk which contains changeslog entry and rest should apply cleanly. And add it to SRC_URI in binutils-2.29.inc

Quoted 10 lines

and the patches from that Bugzilla page are in a binutils directory. The errors I get indicate that the patches are being attempted, but aren't matching up with any source files.

--

Ciao, Paul D. DeRocco
Paul mailto:[email protected]

#4 lore raw
Quoted 5 lines

From: Khem Raj [mailto:[email protected]]

you can just make 1 patch download

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=com

mitdiff_plain;h=> 39865a7f420ab4ca4dec6ed27339618a5d5dc366;hp=fe22022617a7122491aa83c893a10a8d861cde73

Quoted 4 lines

and delete the hunk which contains changeslog entry and rest should apply
cleanly. And add it to SRC_URI in binutils-2.29.inc

That didn't change anything. (Pyro is using 2.28, BTW.)

The crosssdk recipe is built in x86_64-linux/binutils-crosssdk-x86_64-pokysdk-linux/2.28-r0/git. All I see in there are a couple of quilt directories containing my patch files, no source files. So I decided to run a devshell. Since that doesn't happen until after the patches are supplied, that failed, too. So I removed the .bbappend and ran the devshell. There they were, a half-bazillion nice source files, including the gas directory. So I put the .bbappend back and ran the devshell again, and the first thing it did was clean that directory, after which the patches failed again.

I have no clue how this build system works. Is the source directory supposed to be where the files are patched? What cleans the source directory? I notice that after any build, there never seem to be any source files hanging around.

Signature · 2 lines
Ciao,               Paul D. DeRocco
Paul                mailto:[email protected]
#5 lore raw
In reply to Paul D. DeRocco
Quoted 10 lines · Paul D. DeRocco
Quoted 5 lines

From: Khem Raj [mailto:[email protected]]

You can apply the patch to all binutils variants, its fine. Send a patch or if you
want, file a ticket in bugzilla and we will take care.

Yocto's Bugzilla isn't recognizing my password, and when it says that it's emailed me a password change message, it doesn't show up. However, the four small patches are in the Sourceware binutils-gdb GIT repo, at the link I mentioned:

Quoted 8 lines

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=39865a7f420ab4c
a4dec6ed27339618a5d5dc366

Just to verify, my binutils-crosssdk_%.bbappend file contains:

FILESEXTRAPATHS_prepend := "${THISDIR}/binutils:"

SRC_URI = " \

Looks like you're overriding SRC_URI instead of appending it. Try with '+=' instead of just '='.

Quoted 10 lines
     file://gas_as.h.patch           \
     file://gas_ChangeLog.patch      \
     file://gas_input-scrub.c.patch  \
     file://gas_listing.c.patch      \
     "

and the patches from that Bugzilla page are in a binutils directory. The errors I get indicate that the patches are being attempted, but aren't matching up with any source files.

// John

#6 lore raw
Quoted 3 lines

From: John Ernberg

Looks like you're overriding SRC_URI instead of appending it.

I had a feeling I was doing something dumb. Thanks.

Signature · 2 lines
Ciao,               Paul D. DeRocco
Paul                mailto:[email protected]