From: Andrei Pavel Date: Mon, 5 May 2025 05:13:45 +0000 (+0300) Subject: [#3866] Meson: disable b_lundef to fix sanitizers X-Git-Tag: Kea-2.7.9~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ffbaa27a90fb3c9c19f0e4e325e12084e804a99;p=thirdparty%2Fkea.git [#3866] Meson: disable b_lundef to fix sanitizers --- diff --git a/meson.build b/meson.build index ec86d4b79b..450ea0c6f7 100644 --- a/meson.build +++ b/meson.build @@ -23,6 +23,7 @@ project( license_files: ['COPYING'], default_options: [ 'b_asneeded=true', + 'b_lundef=false', # required for clang++ when used with sanitizers and for BSD ld when linking with extern char **environ. 'b_pch=false', 'b_pie=true', 'warning_level=2', @@ -399,19 +400,6 @@ result = cpp.run( ) conf_data.set('CHRONO_SAME_DURATION', result.returncode() == 0) -ENVIRON_SHLIB_FLAGS = [] -# --no-undefined is not supported by all loaders. -if cpp.has_link_argument('-Wl,--no-undefined') - result = cpp.links( - fs.read('compiler-checks/environ-in-shlib.cc'), - name: 'ENVIRON_SHLIB_FLAGS', - args: ['--shared', '-fPIC', '-Wl,--no-undefined'], - ) - if not result - ENVIRON_SHLIB_FLAGS += 'b_lundef=false' - endif -endif - if CRYPTO_DEP.name() == openssl.name() result1 = cpp.run( fs.read('compiler-checks/have-generic-tls-method.cc'), diff --git a/src/lib/asiolink/meson.build b/src/lib/asiolink/meson.build index ddde758fee..aa4a5e96f2 100644 --- a/src/lib/asiolink/meson.build +++ b/src/lib/asiolink/meson.build @@ -22,8 +22,6 @@ kea_asiolink_lib = shared_library( build_rpath: BUILD_RPATH, link_with: LIBS_BUILT_SO_FAR, version: '85.0.0', - # Avoids: ld: error: undefined symbol: environ on FreeBSD - override_options: ENVIRON_SHLIB_FLAGS, ) LIBS_BUILT_SO_FAR = [kea_asiolink_lib] + LIBS_BUILT_SO_FAR subdir('testutils')