]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
uninative: Add pthread linking workaround
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Mar 2024 12:59:57 +0000 (12:59 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Mar 2024 15:24:56 +0000 (15:24 +0000)
With newer glibc versions, pthread was merged into the main library so there is
no longer any need to link with -lpthread. On newer systems this means that linker
flag is dropped from places like pkgconfig .pc files. If uninative then uses this
newer library on an older system, the flag is missing and linker errors about missing
symbols occur.

Adding the linkage unconditionally to our uninative linking flags avoids that problem
at a potential cost of slight over linking.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/uninative.bbclass

index 9b8b4565dd441ee8f5ae32a9829082a5b7dd18e6..d2297b53f553b0570eccf98bfb70f1c6d58fc2c7 100644 (file)
@@ -143,8 +143,8 @@ def enable_uninative(d):
         d.setVar("NATIVELSBSTRING", "universal%s" % oe.utils.host_gcc_version(d))
         d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
         d.appendVarFlag("SSTATEPOSTUNPACKFUNCS", "vardepvalueexclude", "| uninative_changeinterp")
-        d.appendVar("BUILD_LDFLAGS", " -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}")
-        d.appendVarFlag("BUILD_LDFLAGS", "vardepvalueexclude", "| -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER}")
+        d.appendVar("BUILD_LDFLAGS", " -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER} -pthread")
+        d.appendVarFlag("BUILD_LDFLAGS", "vardepvalueexclude", "| -Wl,--allow-shlib-undefined -Wl,--dynamic-linker=${UNINATIVE_LOADER} -pthread")
         d.appendVarFlag("BUILD_LDFLAGS", "vardepsexclude", "UNINATIVE_LOADER")
         d.prependVar("PATH", "${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")