ostree: Always use libgcc for runtime with clang on x86
PATCH 1/7 ostree: Always use libgcc for runtime with clang on x86
compiler-rt does not have 128-bit int support for 32bit x86
--- meta-oe/recipes-extended/ostree/ostree_2024.10.bb | 3 +++ 1 file changed, 3 insertions(+)
meta-oe/recipes-extended/ostree/ostree_2024.10.bb +3 -0
@@ -118,6 +118,9 @@ SYSROOT_DIR = "${STAGING_DIR_TARGET}" SYSROOT_DIR:class-native = "${STAGING_DIR_NATIVE}" do_configure[vardeps] += "SYSROOT_DIR" +# i686-yoe-linux-ld.lld: error: undefined symbol: __unordtf2 +LDFLAGS:append:libc-glibc:toolchain-clang:x86 = " --rtlib=libgcc --unwindlib=libgcc" + do_configure:prepend() { # this reflects what autogen.sh does, but the OE wrappers for autoreconf # allow it to work without the other gyrations which exist there
PATCH 2/7 libhugetlbfs: Do not add LDFLAGS to compiler
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]
--- ...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
meta-oe/recipes-benchmark/libhugetlbfs/files/0014-tests-Add-ldflags-to-linker-commandline-for-libheaps.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 834662425936ae222789f4823d10a1371b951ae1 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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)" $@
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb +1 -2
@@ -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
PATCH 3/7 libhugetlbfs: Always use ligcc for compiler runtime with clang on x86
In reply to Khem Rajglibc objects here expect libgcc to be linked in sadly compiler-rt does not provide all the needed function implementations e.g. __unordtf2 __letf2, __multf3, __addtf3 needed for 128 bit data types
--- meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb | 3 +++ 1 file changed, 3 insertions(+)
meta-oe/recipes-benchmark/libhugetlbfs/libhugetlbfs_2.24.bb +3 -0
@@ -44,6 +44,9 @@ CFLAGS += "-fexpensive-optimizations -frename-registers -fomit-frame-pointer -g0 export HUGETLB_LDSCRIPT_PATH = "${S}/ldscripts" LDFLAGS += "-B${S}" +# glibc objects have missing symbols from libgcc that compiler-rt does not provide +# /usr/src/debug/glibc/2.41+git/stdio-common/../stdio-common/printf_fphex.c:123:(.text+0x77): undefined reference to `__unordtf2' +LDFLAGS:append:libc-glibc:toolchain-clang:x86 = " --rtlib=libgcc --unwindlib=libgcc" inherit autotools-brokensep
PATCH 4/7 tsocks: Always use ligcc for compiler runtime with clang on x86
In reply to Khem Raj--- meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb +3 -1
@@ -21,6 +21,9 @@ inherit autotools-brokensep LIBS:append:libc-musl = " -lssp_nonshared" LIBS:append:libc-glibc = " -lc_nonshared" +# i686-yoe-linux-ld.lld: error: undefined symbol: __unordtf2 +LDFLAGS:append:libc-glibc:toolchain-clang:x86 = " --rtlib=libgcc --unwindlib=libgcc" + S = "${UNPACKDIR}/tsocks-1.8" FILES:${PN} = "${libdir}/* ${bindir}/tsocks"
@@ -28,4 +31,3 @@ FILES:${PN}-dev = "" INSANE_SKIP:${PN} = "dev-so" EXTRA_OEMAKE = "SHCC='${CC} -fPIC ${LDFLAGS}' LIBS='${LIBS}'" -
PATCH 5/7 libc-bench: Always use libgcc runtime with clang on x86
In reply to Khem Raj--- meta-oe/recipes-benchmark/libc-bench/libc-bench_git.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-benchmark/libc-bench/libc-bench_git.bb +2 -1
@@ -16,9 +16,10 @@ SRC_URI = "git://git.musl-libc.org/libc-bench;branch=master \ # Upstream repo does not tag UPSTREAM_CHECK_COMMITS = "1" +# i686-yoe-linux-ld.lld: error: undefined symbol: __addtf3 +LDFLAGS:append:libc-glibc:toolchain-clang:x86 = " --rtlib=libgcc --unwindlib=libgcc" do_install () { install -d ${D}${bindir} install -m 0755 ${B}/libc-bench ${D}${bindir} } -
PATCH 6/7 aufs-util: Always use libgcc as compiler runtime with clang on x86
In reply to Khem Raj--- meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb | 2 ++ 1 file changed, 2 insertions(+)
meta-filesystems/recipes-utils/aufs-util/aufs-util_git.bb +2 -0
@@ -21,6 +21,8 @@ UPSTREAM_CHECK_COMMITS = "1" PV = "4.9+git" +#i686-yoe-linux-ld.bfd: /usr/src/debug/glibc/2.41+git/stdio-common/../stdio-common/printf_fphex.c:123:(.text+0xdf): undefined reference to `__letf2' +LDFLAGS:append:libc-glibc:toolchain-clang:x86 = " --rtlib=libgcc --unwindlib=libgcc" export HOSTCC = "${BUILD_CC}" do_configure:prepend() {
PATCH 7/7 nodejs: Fix build on arm64 hosts
In reply to Khem RajWhen clang is used as cross compiler, it confuses gyp system to enable -m64 option for host pieces of build and the reason is that it assumes clang to be biarch by default for all architectures but that maybe true for x86/x86_64 combo but not true for arm/aarch64 systems
This is a backport from node 24
--- ...ld-remove-redundant-mXX-flags-for-V8.patch | 133 ++++++++++++++++++ .../recipes-devtools/nodejs/nodejs_22.16.0.bb | 1 + 2 files changed, 134 insertions(+) create mode 100644 meta-oe/recipes-devtools/nodejs/nodejs/0001-build-remove-redundant-mXX-flags-for-V8.patch
meta-oe/recipes-devtools/nodejs/nodejs/0001-build-remove-redundant-mXX-flags-for-V8.patch new file +133 -0
@@ -0,0 +1,133 @@ +From 403264c02edc2689671dbefaf032e3acb4fb713d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <[email protected]> +Date: Sat, 19 Apr 2025 12:22:10 +0200 +Subject: [PATCH] build: remove redundant `-mXX` flags for V8 + +They are already set by `common.gypi`. + + +Needed to build on aarch64 build hosts with clang compiler +Drop it when upgrading to 0.24.x or newer. + +Upstream-Status: Backport [https://github.com/nodejs/node/commit/403264c02edc2689671dbefaf032e3acb4fb713d] + +PR-URL: https://github.com/nodejs/node/pull/57907 +Reviewed-By: James M Snell <[email protected]> +Reviewed-By: Marco Ippolito <[email protected]> +Reviewed-By: Chengzhong Wu <[email protected]> +Reviewed-By: Rafael Gonzaga <[email protected]> +Reviewed-By: Luigi Pinca <[email protected]> +--- + tools/v8_gypfiles/toolchain.gypi | 91 -------------------------------- + 1 file changed, 91 deletions(-) + +Index: node-v22.16.0/tools/v8_gypfiles/toolchain.gypi +=================================================================== +--- node-v22.16.0.orig/tools/v8_gypfiles/toolchain.gypi ++++ node-v22.16.0/tools/v8_gypfiles/toolchain.gypi +@@ -97,33 +97,6 @@ + # Indicates if gcmole tools are downloaded by a hook. + 'gcmole%': 0, + }, +- +- # [GYP] this needs to be outside of the top level 'variables' +- 'conditions': [ +- ['host_arch=="ia32" or host_arch=="x64" or \ +- host_arch=="ppc" or host_arch=="ppc64" or \ +- host_arch=="s390x" or \ +- clang==1', { +- 'variables': { +- 'host_cxx_is_biarch%': 1, +- }, +- }, { +- 'variables': { +- 'host_cxx_is_biarch%': 0, +- }, +- }], +- ['target_arch=="ia32" or target_arch=="x64" or \ +- target_arch=="ppc" or target_arch=="ppc64" or \ +- target_arch=="s390x" or clang==1', { +- 'variables': { +- 'target_cxx_is_biarch%': 1, +- }, +- }, { +- 'variables': { +- 'target_cxx_is_biarch%': 0, +- }, +- }], +- ], + 'target_defaults': { + 'include_dirs': [ + '<(V8_ROOT)', +@@ -553,71 +526,6 @@ + '-mmmx', # Allows mmintrin.h for MMX intrinsics. + ], + }], +- ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ +- or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \ +- (v8_target_arch=="arm" or v8_target_arch=="ia32" or \ +- v8_target_arch=="ppc")', { +- 'target_conditions': [ +- ['_toolset=="host"', { +- 'conditions': [ +- ['host_cxx_is_biarch==1', { +- 'conditions': [ +- ['host_arch=="s390x"', { +- 'cflags': [ '-m31' ], +- 'ldflags': [ '-m31' ] +- },{ +- 'cflags': [ '-m32' ], +- 'ldflags': [ '-m32' ] +- }], +- ], +- }], +- ], +- 'xcode_settings': { +- 'ARCHS': [ 'i386' ], +- }, +- }], +- ['_toolset=="target"', { +- 'conditions': [ +- ['target_cxx_is_biarch==1', { +- 'conditions': [ +- ['host_arch=="s390x"', { +- 'cflags': [ '-m31' ], +- 'ldflags': [ '-m31' ] +- },{ +- 'cflags': [ '-m32' ], +- 'ldflags': [ '-m32' ], +- }], +- ], +- }], +- ], +- 'xcode_settings': { +- 'ARCHS': [ 'i386' ], +- }, +- }], +- ], +- }], +- ['(OS=="linux" or OS=="android") and \ +- (v8_target_arch=="x64" or v8_target_arch=="arm64" or \ +- v8_target_arch=="ppc64" or v8_target_arch=="s390x")', { +- 'target_conditions': [ +- ['_toolset=="host"', { +- 'conditions': [ +- ['host_cxx_is_biarch==1', { +- 'cflags': [ '-m64' ], +- 'ldflags': [ '-m64' ] +- }], +- ], +- }], +- ['_toolset=="target"', { +- 'conditions': [ +- ['target_cxx_is_biarch==1', { +- 'cflags': [ '-m64' ], +- 'ldflags': [ '-m64' ], +- }], +- ] +- }], +- ], +- }], + ['OS=="android" and v8_android_log_stdout==1', { + 'defines': [ + 'V8_ANDROID_LOG_STDOUT',
meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb +1 -0
@@ -30,6 +30,7 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ file://0001-deps-disable-io_uring-support-in-libuv.patch \ file://0001-positional-args.patch \ file://0001-custom-env.patch \ + file://0001-build-remove-redundant-mXX-flags-for-V8.patch \ file://run-ptest \ " SRC_URI:append:class-target = " \