Openembedded Core Discussions
 help / color / mirror / Atom feed
* [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

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