* [PATCH] kernel-arch: Force BFD kernel when using gcc for linking
@ 2015-08-19 17:44 Khem Raj
2015-08-19 19:59 ` Nathan Lynch
0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2015-08-19 17:44 UTC (permalink / raw)
To: openembedded-core
We redefine LD to point to ld.bfd when building kernel, which works in
most cases since kbuild system calls out for bare LD most of the time,
however some of newer kernels e.g. 4.1+ have some code added which can
call gcc directly to do the linking job e.g. arm vdso code
This causes build failures when we have configured the default cross
toolchain to use gold linker as default. Errors like
BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
linking with -N
| arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
value
start happening.
With this patch we force gcc to choose bfd linker as well
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/classes/kernel-arch.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
index 6650870..211b72b 100644
--- a/meta/classes/kernel-arch.bbclass
+++ b/meta/classes/kernel-arch.bbclass
@@ -53,7 +53,7 @@ HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
TARGET_AR_KERNEL_ARCH ?= ""
HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
-KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH}"
+KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd"
KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] kernel-arch: Force BFD kernel when using gcc for linking
2015-08-19 17:44 [PATCH] kernel-arch: Force BFD kernel when using gcc for linking Khem Raj
@ 2015-08-19 19:59 ` Nathan Lynch
2015-08-19 20:12 ` Burton, Ross
0 siblings, 1 reply; 5+ messages in thread
From: Nathan Lynch @ 2015-08-19 19:59 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
On 08/19/2015 12:44 PM, Khem Raj wrote:
> We redefine LD to point to ld.bfd when building kernel, which works in
> most cases since kbuild system calls out for bare LD most of the time,
> however some of newer kernels e.g. 4.1+ have some code added which can
> call gcc directly to do the linking job e.g. arm vdso code
>
> This causes build failures when we have configured the default cross
> toolchain to use gold linker as default. Errors like
>
> BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
> linking with -N
> | arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
> value
>
> start happening.
>
> With this patch we force gcc to choose bfd linker as well
This is fixed upstream as of:
commit d2b30cd4b7223a96e606dfc8120626f66d81e091
Author: Nathan Lynch <nathan_lynch@mentor.com>
Date: Wed Jun 3 00:41:15 2015 +0100
ARM: 8384/1: VDSO: force use of BFD linker
which should make it to 4.1-stable soon.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] kernel-arch: Force BFD kernel when using gcc for linking
2015-08-19 19:59 ` Nathan Lynch
@ 2015-08-19 20:12 ` Burton, Ross
2015-08-19 20:15 ` Bruce Ashfield
2015-08-19 22:52 ` Khem Raj
0 siblings, 2 replies; 5+ messages in thread
From: Burton, Ross @ 2015-08-19 20:12 UTC (permalink / raw)
To: Nathan Lynch, Bruce Ashfield; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]
On 19 August 2015 at 20:59, Nathan Lynch <Nathan_Lynch@mentor.com> wrote:
> On 08/19/2015 12:44 PM, Khem Raj wrote:
> > We redefine LD to point to ld.bfd when building kernel, which works in
> > most cases since kbuild system calls out for bare LD most of the time,
> > however some of newer kernels e.g. 4.1+ have some code added which can
> > call gcc directly to do the linking job e.g. arm vdso code
> >
> > This causes build failures when we have configured the default cross
> > toolchain to use gold linker as default. Errors like
> >
> > BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
> > linking with -N
> > | arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
> > value
> >
> > start happening.
> >
> > With this patch we force gcc to choose bfd linker as well
>
>
> This is fixed upstream as of:
>
> commit d2b30cd4b7223a96e606dfc8120626f66d81e091
> Author: Nathan Lynch <nathan_lynch@mentor.com>
> Date: Wed Jun 3 00:41:15 2015 +0100
>
> ARM: 8384/1: VDSO: force use of BFD linker
>
> which should make it to 4.1-stable soon.
CC'ing Bruce.
I'll stage the fix from Khem in my master-unde-test branch. Bruce: if you
end up merging this fix into the oe-core kernels, please remind me to
revert Khem's patch. :)
Ross
[-- Attachment #2: Type: text/html, Size: 1863 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel-arch: Force BFD kernel when using gcc for linking
2015-08-19 20:12 ` Burton, Ross
@ 2015-08-19 20:15 ` Bruce Ashfield
2015-08-19 22:52 ` Khem Raj
1 sibling, 0 replies; 5+ messages in thread
From: Bruce Ashfield @ 2015-08-19 20:15 UTC (permalink / raw)
To: Burton, Ross, Nathan Lynch; +Cc: OE-core
On 15-08-19 04:12 PM, Burton, Ross wrote:
> On 19 August 2015 at 20:59, Nathan Lynch <Nathan_Lynch@mentor.com
> <mailto:Nathan_Lynch@mentor.com>> wrote:
>
> On 08/19/2015 12:44 PM, Khem Raj wrote:
> > We redefine LD to point to ld.bfd when building kernel, which works in
> > most cases since kbuild system calls out for bare LD most of the time,
> > however some of newer kernels e.g. 4.1+ have some code added which can
> > call gcc directly to do the linking job e.g. arm vdso code
> >
> > This causes build failures when we have configured the default cross
> > toolchain to use gold linker as default. Errors like
> >
> > BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
> > linking with -N
> > | arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
> > value
> >
> > start happening.
> >
> > With this patch we force gcc to choose bfd linker as well
>
>
> This is fixed upstream as of:
>
> commit d2b30cd4b7223a96e606dfc8120626f66d81e091
> Author: Nathan Lynch <nathan_lynch@mentor.com
> <mailto:nathan_lynch@mentor.com>>
> Date: Wed Jun 3 00:41:15 2015 +0100
>
> ARM: 8384/1: VDSO: force use of BFD linker
>
> which should make it to 4.1-stable soon.
>
>
> CC'ing Bruce.
>
> I'll stage the fix from Khem in my master-unde-test branch. Bruce: if
> you end up merging this fix into the oe-core kernels, please remind me
> to revert Khem's patch. :)
Noted. And will do.
Bruce
>
> Ross
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel-arch: Force BFD kernel when using gcc for linking
2015-08-19 20:12 ` Burton, Ross
2015-08-19 20:15 ` Bruce Ashfield
@ 2015-08-19 22:52 ` Khem Raj
1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2015-08-19 22:52 UTC (permalink / raw)
To: Burton, Ross; +Cc: Bruce Ashfield, Nathan Lynch, OE-core
On Wed, Aug 19, 2015 at 1:12 PM, Burton, Ross <ross.burton@intel.com> wrote:
> On 19 August 2015 at 20:59, Nathan Lynch <Nathan_Lynch@mentor.com> wrote:
>>
>> On 08/19/2015 12:44 PM, Khem Raj wrote:
>> > We redefine LD to point to ld.bfd when building kernel, which works in
>> > most cases since kbuild system calls out for bare LD most of the time,
>> > however some of newer kernels e.g. 4.1+ have some code added which can
>> > call gcc directly to do the linking job e.g. arm vdso code
>> >
>> > This causes build failures when we have configured the default cross
>> > toolchain to use gold linker as default. Errors like
>> >
>> > BFD: arch/arm/vdso/vdso.so: Not enough room for program headers, try
>> > linking with -N
>> > | arm-angstrom-linux-gnueabi-objcopy:arch/arm/vdso/vdso.so[.hash]: Bad
>> > value
>> >
>> > start happening.
>> >
>> > With this patch we force gcc to choose bfd linker as well
>>
>>
>> This is fixed upstream as of:
>>
>> commit d2b30cd4b7223a96e606dfc8120626f66d81e091
>> Author: Nathan Lynch <nathan_lynch@mentor.com>
>> Date: Wed Jun 3 00:41:15 2015 +0100
>>
>> ARM: 8384/1: VDSO: force use of BFD linker
>>
>> which should make it to 4.1-stable soon.
it fixes one case yes, there could be many more to come. We want to
make sure that we use bfd ld through out the kernel.
>
>
> CC'ing Bruce.
>
> I'll stage the fix from Khem in my master-unde-test branch. Bruce: if you
> end up merging this fix into the oe-core kernels, please remind me to revert
> Khem's patch. :)
There is no need to revert it. Since it convey's what we want to do in
more comprehensive way i.e. to use bfd linker for all kernel links in
all forms.
It covers us for future issues of similar kind
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-19 22:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-19 17:44 [PATCH] kernel-arch: Force BFD kernel when using gcc for linking Khem Raj
2015-08-19 19:59 ` Nathan Lynch
2015-08-19 20:12 ` Burton, Ross
2015-08-19 20:15 ` Bruce Ashfield
2015-08-19 22:52 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox