Skip to contentSkip to conversation

nspr: fix buildpaths issue

PATCH New [email protected] 1 participant 5 messages Nov 17, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 nspr: fix buildpaths issue

From: Mingli Yu <[email protected]>

Fixes:
WARNING: nspr-4.29-r0 do_package_qa: QA Issue: File /usr/bin/nspr-config in package nspr-dev contains reference to TMPDIR [buildpaths]

---
 ...ig-nspr-config.in-don-t-pass-LDFLAGS.patch | 30 +++++++++++++++++++
 meta-oe/recipes-support/nspr/nspr_4.29.bb     |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta-oe/recipes-support/nspr/nspr/0001-config-nspr-config.in-don-t-pass-LDFLAGS.patch
meta-oe/recipes-support/nspr/nspr/0001-config-nspr-config.in-don-t-pass-LDFLAGS.patch new file +30 -0
new file mode 100644
index 0000000000..6ebc9c4ae6
@@ -0,0 +1,30 @@
+From 13e9d66c24d1dce5179805ae5e1bf940409b4914 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <[email protected]>
+Date: Wed, 10 Aug 2022 15:21:07 +0800
+Subject: [PATCH] config/nspr-config.in: don't pass LDFLAGS
+
+Don't pass LDFLAGS to avoid exposing the build env info.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ config/nspr-config.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/nspr-config.in b/config/nspr-config.in
+index 2cb62a0..2bec715 100755
+--- a/config/nspr-config.in
++++ b/config/nspr-config.in
+@@ -136,7 +136,7 @@ if test "$echo_libs" = "yes"; then
+       if test -n "$lib_nspr"; then
+ 	libdirs="$libdirs -lnspr${major_version}"
+       fi
+-      os_ldflags="@LDFLAGS@"
++      os_ldflags="LDFLAGS"
+       for i in $os_ldflags ; do
+ 	if echo $i | grep \^-L >/dev/null; then
+ 	  libdirs="$libdirs $i"
+-- 
+2.25.1
+
meta-oe/recipes-support/nspr/nspr_4.29.bb +1 -0
index c9215fc275..e79bd6127b 100644
@@ -13,6 +13,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz
            file://0001-md-Fix-build-with-musl.patch \
            file://Makefile.in-remove-_BUILD_STRING-and-_BUILD_TIME.patch \
            file://0001-Fix-Wincompatible-function-pointer-types.patch \
+           file://0001-config-nspr-config.in-don-t-pass-LDFLAGS.patch \
            file://nspr.pc.in \
 "
 
#1 lore raw

PATCH 2/5 libwebsockets: Fix reference to TMPDIR

From: Khem Raj <[email protected]>

.cmake files encoded absolute paths, fixed thusly

---
 .../libwebsockets/libwebsockets_4.2.2.bb                  | 8 ++++++++
 1 file changed, 8 insertions(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb +8 -0
index 24b9e9a071..22bf5f1145 100644
@@ -30,6 +30,14 @@ EXTRA_OECMAKE += " \
     -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
 "
 
+do_install:append() {
+    sed -i -e 's|${STAGING_LIBDIR}/libcrypto.so|crypto|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
+    sed -i -e 's|${STAGING_LIBDIR}/libssl.so|ssl|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
+    sed -i -e 's|${STAGING_LIBDIR}/libuv.so|uv|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
+    sed -i -e 's|${STAGING_INCDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
+                                       ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
+}
+
 PACKAGES =+ "${PN}-testapps ${PN}-evlib-event ${PN}-evlib-uv ${PN}-evlib-ev"
 
 FILES:${PN}-testapps += "${datadir}/libwebsockets-test-server/* ${bindir}/libwebsockets-test-*"
#2 lore raw

PATCH 3/5 libwebsockets: fix buildpath warnings

In reply to [email protected]

From: Gerard Salvatella <[email protected]>

In order to remove absolute paths from the cmake artifacts, paths from the $lib folder should also be stripped off, otherwise internally linked libraries (e.g. libz) may appear.

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb   | 2 ++
 1 file changed, 2 insertions(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb +2 -0
index 22bf5f1145..721406267a 100644
@@ -36,6 +36,8 @@ do_install:append() {
     sed -i -e 's|${STAGING_LIBDIR}/libuv.so|uv|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
     sed -i -e 's|${STAGING_INCDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
                                        ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
+    sed -i -e 's|${STAGING_LIBDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
+                                       ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
 }
 
 PACKAGES =+ "${PN}-testapps ${PN}-evlib-event ${PN}-evlib-uv ${PN}-evlib-ev"
#3 lore raw

PATCH 4/5 libwebsockets: remove STAGING_LIBDIR with /

In reply to [email protected]

From: Martin Jansa <[email protected]>

* after buildpath warnings fix from:
https://git.openembedded.org/meta-openembedded/commit/?id=eeef1fddd9052bed4b1a91565260518eb042fed2
the LibwebsocketsTargets.cmake ends with:
INTERFACE_LINK_LIBRARIES "ssl;crypto;ssl;crypto;/libcap.so;-lpthread"
instead of:
INTERFACE_LINK_LIBRARIES "ssl;crypto;ssl;crypto;/OE/build/.../libwebsockets/4.3.3/lib32-recipe-sysroot/usr/lib/libcap.so;-lpthread" which causes e.g. mosquitto to fail in do_compile with:
ninja: error: '/libcap.so', needed by 'src/mosquitto', missing and no known rule to make it

* this happens only when libwebsocket is built with libcap enabled (by libcap in DEPENDS)

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb +2 -2
index 721406267a..67c1bb4421 100644
@@ -36,8 +36,8 @@ do_install:append() {
     sed -i -e 's|${STAGING_LIBDIR}/libuv.so|uv|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
     sed -i -e 's|${STAGING_INCDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
                                        ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
-    sed -i -e 's|${STAGING_LIBDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
-                                       ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
+    sed -i -e 's|${STAGING_LIBDIR}/||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
+                                        ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
 }
 
 PACKAGES =+ "${PN}-testapps ${PN}-evlib-event ${PN}-evlib-uv ${PN}-evlib-ev"
#4 lore raw

PATCH 5/5 libwebsockets: fix buildpath warnings from libcap.so

In reply to [email protected]

From: Martin Jansa <[email protected]>

The ${STAGING_LIBDIR} used in scarthgap doesn't catch this, because in kirkstone without usrmerge libcap is installed in base_libdir which is different from libdir.

---
 .../recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb    | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.2.2.bb +1 -0
index 67c1bb4421..22434b4493 100644
@@ -34,6 +34,7 @@ do_install:append() {
     sed -i -e 's|${STAGING_LIBDIR}/libcrypto.so|crypto|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
     sed -i -e 's|${STAGING_LIBDIR}/libssl.so|ssl|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
     sed -i -e 's|${STAGING_LIBDIR}/libuv.so|uv|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
+    sed -i -e 's|${STAGING_BASELIBDIR}/libcap.so|cap|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
     sed -i -e 's|${STAGING_INCDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
                                        ${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
     sed -i -e 's|${STAGING_LIBDIR}/||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \