diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-07-26 14:10:47 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-08-04 11:45:26 -0700 |
commit | acbf3e2e7ed9a4be4a7157eeca9c96bde312f890 (patch) | |
tree | 494e00dccc9d5648537bf1e8d18f19cb33f28e97 | |
parent | ae8ea297884722e5a22a8b01126dac1cafdecaf1 (diff) | |
download | meta-openembedded-acbf3e2e7ed9a4be4a7157eeca9c96bde312f890.tar.gz |
openwsman: Fix reprodubility issue due to abs paths
dlopen is being served libssl.so with build time
absolute path of its location in target sysroot
this is being detected as reproducibility issue but
its also a runtime issue where dlopen will fail
due to non-existent path
Backport a gcc-15 build fix as well
Drop do_configure tweak its no longer needed
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 82 insertions, 6 deletions
diff --git a/meta-oe/recipes-extended/openwsman/openwsman/0001-Fix-to-build-with-GCC-15.patch b/meta-oe/recipes-extended/openwsman/openwsman/0001-Fix-to-build-with-GCC-15.patch new file mode 100644 index 0000000000..32e055c300 --- /dev/null +++ b/meta-oe/recipes-extended/openwsman/openwsman/0001-Fix-to-build-with-GCC-15.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | From f1b4ef78719146d84f16e86bf77de027e608eb17 Mon Sep 17 00:00:00 2001 | ||
2 | From: Vitezslav Crhonek <vcrhonek@redhat.com> | ||
3 | Date: Mon, 3 Feb 2025 11:30:15 +0100 | ||
4 | Subject: [PATCH] Fix to build with GCC 15. | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/Openwsman/openwsman/pull/209] | ||
7 | Signed-off-by: Vitezslav Crhonek <vcrhonek@redhat.com> | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | src/plugins/swig/src/target_ruby.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/src/plugins/swig/src/target_ruby.c b/src/plugins/swig/src/target_ruby.c | ||
14 | index bbce398..e17bb44 100644 | ||
15 | --- a/src/plugins/swig/src/target_ruby.c | ||
16 | +++ b/src/plugins/swig/src/target_ruby.c | ||
17 | @@ -49,7 +49,7 @@ | ||
18 | */ | ||
19 | |||
20 | static VALUE | ||
21 | -load_module() | ||
22 | +load_module(VALUE) | ||
23 | { | ||
24 | ruby_script(PLUGIN_FILE); | ||
25 | return rb_require(PLUGIN_FILE); | ||
diff --git a/meta-oe/recipes-extended/openwsman/openwsman/0001-cmake-Avoid-using-absolute-paths-in-dlopen.patch b/meta-oe/recipes-extended/openwsman/openwsman/0001-cmake-Avoid-using-absolute-paths-in-dlopen.patch new file mode 100644 index 0000000000..a9e98ef392 --- /dev/null +++ b/meta-oe/recipes-extended/openwsman/openwsman/0001-cmake-Avoid-using-absolute-paths-in-dlopen.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From 03d3f19c00f959bb77464dfa90bcb197eb71b27a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 25 Jul 2025 20:41:05 -0700 | ||
4 | Subject: [PATCH] cmake: Avoid using absolute paths in dlopen() | ||
5 | |||
6 | This encodes absolutes paths currently, via LIB_SSL | ||
7 | which is detected in cmake and then passed to compiler | ||
8 | via a define in src/server/CMakeLists.txt#L19 | ||
9 | |||
10 | ADD_DEFINITIONS(-DSSL_LIB="${SSL_LIB}") | ||
11 | |||
12 | This define is then used by a dlopen() call in | ||
13 | src/server/shttpd/shttpd.c#L1514 | ||
14 | |||
15 | if ((lib = dlopen(SSL_LIB, RTLD_LAZY)) == NULL) { | ||
16 | |||
17 | This ends up emitting absolute path into openwsmand | ||
18 | binary | ||
19 | |||
20 | It breaks reproducible builds, especially in cross-build | ||
21 | e.g. yocto, where build time install dir will never be same as | ||
22 | runtime install dir, this absolute path will be | ||
23 | non-existent on targets and this call will fail. | ||
24 | |||
25 | Removing path element and leaving libssl.so which will/can be | ||
26 | in /usr/lib on targets | ||
27 | |||
28 | This approach makes your binary more portable | ||
29 | since it doesn't hardcode absolute paths. | ||
30 | |||
31 | Upstream-Status: Submitted [https://github.com/Openwsman/openwsman/pull/213] | ||
32 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
33 | --- | ||
34 | src/server/CMakeLists.txt | 7 ++++++- | ||
35 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
36 | |||
37 | diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt | ||
38 | index 79702787..39568504 100644 | ||
39 | --- a/src/server/CMakeLists.txt | ||
40 | +++ b/src/server/CMakeLists.txt | ||
41 | @@ -16,7 +16,12 @@ SET(openwsmand_SOURCES ${openwsmand_SOURCES} gss.c wsmand.c) | ||
42 | IF(USE_OPENSSL) | ||
43 | SET(SSL_LIB ${OPENSSL_SSL_LIBRARY}) | ||
44 | MESSAGE(STATUS "SSL_LIB is at >${SSL_LIB}<") | ||
45 | -ADD_DEFINITIONS(-DSSL_LIB="${SSL_LIB}") | ||
46 | + | ||
47 | +# Extract just the filename from the full path | ||
48 | +get_filename_component(SSL_LIB_NAME ${SSL_LIB} NAME) | ||
49 | +MESSAGE(STATUS "SSL_LIB filename is >${SSL_LIB_NAME}<") | ||
50 | + | ||
51 | +ADD_DEFINITIONS(-DSSL_LIB="${SSL_LIB_NAME}") | ||
52 | ENDIF(USE_OPENSSL) | ||
53 | |||
54 | ADD_DEFINITIONS(-DDELIM_CHARS=", " ) | ||
diff --git a/meta-oe/recipes-extended/openwsman/openwsman_2.8.1.bb b/meta-oe/recipes-extended/openwsman/openwsman_2.8.1.bb index 5abe06d07b..9078f571e6 100644 --- a/meta-oe/recipes-extended/openwsman/openwsman_2.8.1.bb +++ b/meta-oe/recipes-extended/openwsman/openwsman_2.8.1.bb | |||
@@ -20,6 +20,8 @@ SRCREV = "20efbccaf804a5a27a914eb8802b806416c03ece" | |||
20 | SRC_URI = "git://github.com/Openwsman/openwsman.git;branch=main;protocol=https;tag=v${PV} \ | 20 | SRC_URI = "git://github.com/Openwsman/openwsman.git;branch=main;protocol=https;tag=v${PV} \ |
21 | file://openwsmand.service \ | 21 | file://openwsmand.service \ |
22 | file://0001-lock.c-Define-PTHREAD_MUTEX_RECURSIVE_NP-if-undefine.patch \ | 22 | file://0001-lock.c-Define-PTHREAD_MUTEX_RECURSIVE_NP-if-undefine.patch \ |
23 | file://0001-Fix-to-build-with-GCC-15.patch \ | ||
24 | file://0001-cmake-Avoid-using-absolute-paths-in-dlopen.patch \ | ||
23 | " | 25 | " |
24 | 26 | ||
25 | LICENSE = "BSD-3-Clause" | 27 | LICENSE = "BSD-3-Clause" |
@@ -29,21 +31,16 @@ inherit systemd cmake pkgconfig python3native perlnative | |||
29 | 31 | ||
30 | SYSTEMD_SERVICE:${PN} = "openwsmand.service" | 32 | SYSTEMD_SERVICE:${PN} = "openwsmand.service" |
31 | SYSTEMD_AUTO_ENABLE = "disable" | 33 | SYSTEMD_AUTO_ENABLE = "disable" |
32 | |||
33 | EXTRA_OECMAKE = "-DBUILD_BINDINGS=NO \ | 34 | EXTRA_OECMAKE = "-DBUILD_BINDINGS=NO \ |
34 | -DBUILD_LIBCIM=NO \ | 35 | -DBUILD_LIBCIM=NO \ |
35 | -DBUILD_PERL=YES \ | 36 | -DBUILD_PERL=YES \ |
36 | -DBUILD_PYTHON3=YES \ | 37 | -DBUILD_PYTHON3=YES \ |
37 | -DBUILD_PYTHON=NO \ | 38 | -DBUILD_PYTHON=NO \ |
38 | -DCMAKE_INSTALL_PREFIX=${prefix} \ | 39 | -DCMAKE_INSTALL_PREFIX=${prefix} \ |
40 | -DPACKAGE_ARCHITECTURE='${HOST_ARCH}' \ | ||
39 | -DLIB=${baselib} \ | 41 | -DLIB=${baselib} \ |
40 | " | 42 | " |
41 | 43 | ||
42 | do_configure:prepend() { | ||
43 | export STAGING_INCDIR=${STAGING_INCDIR} | ||
44 | export STAGING_LIBDIR=${STAGING_LIBDIR} | ||
45 | } | ||
46 | |||
47 | do_install:append() { | 44 | do_install:append() { |
48 | install -d ${D}/${sysconfdir}/init.d | 45 | install -d ${D}/${sysconfdir}/init.d |
49 | install -m 755 ${B}/etc/init/openwsmand.sh ${D}/${sysconfdir}/init.d/openwsmand | 46 | install -m 755 ${B}/etc/init/openwsmand.sh ${D}/${sysconfdir}/init.d/openwsmand |