diff mbox series

[meta-oe,2/7] libhugetlbfs: Do not add LDFLAGS to compiler

Message ID 20250721040030.641212-2-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/7] ostree: Always use libgcc for runtime with clang on x86 | expand

Commit Message

Khem Raj July 21, 2025, 4 a.m. UTC
Add LDFLAGS in makefile for linking the helper libraries instead

when linking with LLD it ends up with errors
i686-yoe-linux-clang: warning: -Wl,-O1: 'linker' input unused [-Wunused-command-line-argument]
i686-yoe-linux-clang: warning: -Wl,--hash-style=gnu: 'linker' input unused [-Wunused-command-line-argument]
i686-yoe-linux-clang: warning: -Wl,--as-needed: 'linker' input unused [-Wunused-command-line-argument]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...s-to-linker-commandline-for-libheaps.patch | 33 +++++++++++++++++++
 .../libhugetlbfs/libhugetlbfs_2.24.bb         |  3 +-
 2 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-benchmark/libhugetlbfs/files/0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/files/0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch b/meta-oe/recipes-benchmark/libhugetlbfs/files/0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch
new file mode 100644
index 0000000000..94a88647ea
--- /dev/null
+++ b/meta-oe/recipes-benchmark/libhugetlbfs/files/0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch
@@ -0,0 +1,33 @@ 
+From 834662425936ae222789f4823d10a1371b951ae1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 20 Jul 2025 14:19:59 -0700
+Subject: [PATCH] tests: Add ldflags to linker commandline for libheapshrink.so
+
+This fixes build QA errors
+ERROR: libhugetlbfs-1_2.24-r0 do_package_qa: QA Issue: File /usr/lib/libhugetlbfs/tests/obj64/libheapshrink.so in package libhugetlbfs-tests doesn't have GNU_HASH (didn't pass LDFLAGS?) [ldflags]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/Makefile.in b/tests/Makefile.in
+index d33a228..042af8d 100644
+--- a/tests/Makefile.in
++++ b/tests/Makefile.in
+@@ -140,12 +140,12 @@ obj64/%-pic.o: %.c
+ obj32/libheapshrink.so: obj32/heapshrink-helper-pic.o
+ 	@$(VECHO) LD32 "(shared)" $@
+ 	@mkdir -p obj32
+-	$(CC32) -Wl,-soname,$(notdir $@) -shared -o $@ $^
++	$(CC32) -Wl,-soname,$(notdir $@) -shared $(LDFLAGS) -o $@ $^
+ 
+ obj64/libheapshrink.so: obj64/heapshrink-helper-pic.o
+ 	@$(VECHO) LD64 "(shared)" $@
+ 	@mkdir -p obj64
+-	$(CC64) -Wl,-soname,$(notdir $@) -shared -o $@ $^
++	$(CC64) -Wl,-soname,$(notdir $@) -shared $(LDFLAGS) -o $@ $^
+ 
+ $(LIB_TESTS:%=obj32/%): %: %.o obj32/testutils.o obj32/libtestutils.o
+ 	@$(VECHO) LD32 "(lib test)" $@
diff --git a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
index e688d6ede2..a43ddf0d53 100644
--- a/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
+++ b/meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb
@@ -24,6 +24,7 @@  SRC_URI = " \
     file://0011-include-limits.h-for-PATH_MAX.patch \
     file://0012-huge_page_setup_helper-use-python3-interpreter.patch \
     file://0013-elflink.c-include-libgen.h-for-basename.patch \
+    file://0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch \
 "
 
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
@@ -42,8 +43,6 @@  CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0
 
 export HUGETLB_LDSCRIPT_PATH = "${S}/ldscripts"
 
-TARGET_CC_ARCH += "${LDFLAGS}"
-
 LDFLAGS += "-B${S}"
 
 inherit autotools-brokensep