diff mbox series

[meta-oe,v2] libhugetlbfs: Use linker wrapper during build

Message ID 20241008171549.3628214-1-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,v2] libhugetlbfs: Use linker wrapper during build | expand

Commit Message

Khem Raj Oct. 8, 2024, 5:15 p.m. UTC
ld.hugetlbfs is munging certain linker commandline options
and presenting a differently named options to its users, in
summary its expecting linker process to call ld.hugetlbfs
which calls the final linker with additional decorations.

This patch makes space for that by adding -B option to compiler
so it finds this the linker in S and then we creates symlinks
for linker name that clang/gcc are expecting.

Fixes

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Keep the gold hack intact

 .../recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb  | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
index 00b34ad4ab..7a2d7c7a85 100644
--- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
+++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
@@ -46,6 +46,8 @@  export HUGETLB_LDSCRIPT_PATH="${S}/ldscripts"
 
 TARGET_CC_ARCH += "${LDFLAGS}"
 
+LDFLAGS += "-B${S}"
+
 inherit autotools-brokensep cpan-base
 
 #The CUSTOM_LDSCRIPTS doesn't work with the gold linker
@@ -55,6 +57,13 @@  do_configure:prepend() {
     fi
 }
 
+do_configure:prepend() {
+    ln -sf ld.hugetlbfs ${S}/ld
+    ln -sf ld.hugetlbfs ${S}/ld.bfd
+    ln -sf ld.hugetlbfs ${S}/ld.gold
+    ln -sf ld.hugetlbfs ${S}/ld.lld
+}
+
 do_install() {
     oe_runmake PREFIX=${prefix} DESTDIR=${D}  \
         INST_TESTSDIR32=${libdir}/libhugetlbfs/tests \