]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
glibc: Pass linker choice via compiler flags
authorKhem Raj <raj.khem@gmail.com>
Sat, 10 Jun 2023 15:50:21 +0000 (08:50 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Jun 2023 21:10:29 +0000 (22:10 +0100)
glibc configury tries to detect ld version and assumes BFD or gold
linker but when system ld is pointing to lld or mold it might fail the
linker check, therefore pass LD variable to explicitly point at ld.bfd
we are using BFD linker only to link glibc after all.

Second problem in such a case is that some partial objects are linked
with CC -r which will fail if we do not inform the compiler to use BFD
linker thusly pass it via appending to CC variable

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/recipes-core/glibc/glibc_2.37.bb

index b27f98fb1999f9acf3f6db7d0feecb1d88f32ad6..3387441cad94a5f75c3732361a9c6283384d1fe5 100644 (file)
@@ -103,10 +103,12 @@ do_configure () {
 # version check and doesn't really help with anything
         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
         find ${S} -name "configure" | xargs touch
-        CPPFLAGS="" oe_runconf
+        CPPFLAGS="" LD="${HOST_PREFIX}ld.bfd ${TOOLCHAIN_OPTIONS}" oe_runconf
 }
 
 LDFLAGS += "-fuse-ld=bfd"
+CC += "-fuse-ld=bfd"
+
 do_compile () {
        base_do_compile
        echo "Adjust ldd script"