From: Michal Sekletar Date: Wed, 22 May 2024 15:15:07 +0000 (+0200) Subject: libsystemd: link with '-z nodelete' X-Git-Tag: v256-rc3~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9d8533b7152daf792356c601516b57c6412d3e52;p=thirdparty%2Fsystemd.git libsystemd: link with '-z nodelete' We want to avoid reinitialization of our global variables with static storage duration in case we get dlopened multiple times by the same application. This will avoid potential resource leaks that could have happened otherwise (e.g. leaking journal socket fd). --- diff --git a/meson.build b/meson.build index 0d68f146fd4..dfea903b60e 100644 --- a/meson.build +++ b/meson.build @@ -2069,6 +2069,8 @@ libsystemd = shared_library( version : libsystemd_version, include_directories : libsystemd_includes, link_args : ['-shared', + # Make sure our library is never deleted from memory, so that our open logging fds don't leak on dlopen/dlclose cycles. + '-z', 'nodelete', '-Wl,--version-script=' + libsystemd_sym_path], link_with : [libbasic], link_whole : [libsystemd_static],