Skip to contentSkip to conversation

libhugetlbfs: Always use BFD linker

PATCH New Khem Raj 1 participant 1 message Oct 7, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 libhugetlbfs: Always use BFD linker

it uses its own linker scripts which assume BFD linker, therefore when these scripts are used with -fuse-ld=XXX option they fail

libhugetlbfs/2.24/recipe-sysroot-native/usr/bin/x86_64-yoe-linux/x86_64-yoe-linux-ld.bfd: unrecognized option '--hugetlbfs-link=B'

---
 .../recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb  | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb +3 -6
index 00b34ad4ab..ccffc1ad82 100644
@@ -48,12 +48,9 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 
 inherit autotools-brokensep cpan-base
 
-#The CUSTOM_LDSCRIPTS doesn't work with the gold linker
-do_configure:prepend() {
-    if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then
-        sed -i 's/CUSTOM_LDSCRIPTS = yes/CUSTOM_LDSCRIPTS = no/'  Makefile.in
-    fi
-}
+#The CUSTOM_LDSCRIPTS doesn't work with the gold/lld linker
+# always use BFD linker
+LDFLAGS:remove = "-fuse-ld=lld -fuse-ld=gold"
 
 do_install() {
     oe_runmake PREFIX=${prefix} DESTDIR=${D}  \