]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
libpcre2: Fix linking with LLD linker
authorKhem Raj <raj.khem@gmail.com>
Wed, 31 Dec 2025 23:57:52 +0000 (15:57 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Jan 2026 11:21:21 +0000 (11:21 +0000)
version scripts are at odds with LLD at times and its strict about undefined symbols
even though they will be provided by c startup files.

Fixes
| riscv64-yoe-linux-ld.lld: error: version script assignment of 'local' to symbol '_fini' failed: symbol not defined
| riscv64-yoe-linux-ld.lld: error: version script assignment of 'local' to symbol '_init' failed: symbol not defined
| riscv64-yoe-linux-clang: error: linker command failed with exit code 1 (use -v to see invocation)
| make[1]: *** [Makefile:1948: libpcre2-32.la] Error 1
| make[1]: Leaving directory '/mnt/b/yoe/master/build/tmp/work/riscv64imafdc-yoe-linux/libpcre2/10.47/build'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/libpcre/libpcre2_10.47.bb

index 98e3c716d6de5459221a7106b6200d947b83d22d..2ac249f05b85a24052e571fa9a34ad1298d6dbef 100644 (file)
@@ -39,6 +39,7 @@ EXTRA_OECONF = "\
 "
 CFLAGS += "-D_REENTRANT"
 CXXFLAGS:append:powerpc = " -lstdc++"
+LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-Wl,--undefined-version', '', d)}"
 
 PACKAGES =+ "libpcre2-16 libpcre2-32 pcre2grep pcre2grep-doc pcre2test pcre2test-doc"