From 31d5c4ae9ed1800176b6ca53e61f9162af02a8c3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 6 Oct 2024 20:18:40 -0700 Subject: libhugetlbfs: Use linker wrapper during build 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 (cherry picked from commit dc84a9e699caa852adc043e9ba1eb134880f055d) Signed-off-by: Armin Kuster --- meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb index 00b34ad4ab..aa1c0ddd5e 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 @@ -53,6 +55,11 @@ 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 + + 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() { @@ -61,7 +68,8 @@ do_install() { INST_TESTSDIR64=${libdir}/libhugetlbfs/tests \ install-tests - sed -i -e 's|${RECIPE_SYSROOT_NATIVE}||g' \ + sed -i \ + -e 's|${RECIPE_SYSROOT_NATIVE}||g' \ -e 's|${RECIPE_SYSROOT}||g' \ `find ${D}${libdir}/libhugetlbfs/tests -name dummy.ldscript` } -- cgit v1.2.3-54-g00ecf