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 <[email protected]>
---
v2: Keep the gold hack intact

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

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 \
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#112717): 
https://lists.openembedded.org/g/openembedded-devel/message/112717
Mute This Topic: https://lists.openembedded.org/mt/108893540/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to