Skip to content

Conversation

@kraj
Copy link
Contributor

@kraj kraj commented Aug 4, 2025

This encodes absolutes paths currently, via LIB_SSL which is detected in cmake and then passed to compiler via a define in src/server/CMakeLists.txt#L19

ADD_DEFINITIONS(-DSSL_LIB="${SSL_LIB}")

This define is then used by a dlopen() call in
src/server/shttpd/shttpd.c#L1514

if ((lib = dlopen(SSL_LIB, RTLD_LAZY)) == NULL) {

This ends up emitting absolute path into openwsmand binary

It breaks reproducible builds, especially in cross-build e.g. yocto, where build time install dir will never be same as runtime install dir, this absolute path will be
non-existent on targets and this call will fail.

Removing path element and leaving libssl.so which will/can be in /usr/lib on targets

This approach makes your binary more portable
since it doesn't hardcode absolute paths.

This encodes absolutes paths currently, via LIB_SSL
which is detected in cmake and then passed to compiler
via a define in src/server/CMakeLists.txt#L19

ADD_DEFINITIONS(-DSSL_LIB="${SSL_LIB}")

This define is then used by a dlopen() call in
src/server/shttpd/shttpd.c#L1514

if ((lib = dlopen(SSL_LIB, RTLD_LAZY)) == NULL) {

This ends up emitting absolute path into openwsmand
binary

It breaks reproducible builds, especially in cross-build
e.g. yocto, where build time install dir will never be same as
runtime install dir, this absolute path will be
non-existent on targets and this call will fail.

Removing path element and leaving libssl.so which will/can be
in /usr/lib on targets

This approach makes your binary more portable
since it doesn't hardcode absolute paths.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant