]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3866] Meson: disable b_lundef to fix sanitizers
authorAndrei Pavel <andrei@isc.org>
Mon, 5 May 2025 05:13:45 +0000 (08:13 +0300)
committerAndrei Pavel <andrei@isc.org>
Mon, 5 May 2025 05:14:43 +0000 (08:14 +0300)
meson.build
src/lib/asiolink/meson.build

index ec86d4b79be0788f081971246eb6341665e1c2a4..450ea0c6f77cdea6d2b21d0a841ac330c16ef55c 100644 (file)
@@ -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'),
index ddde758fee040e36836e09a4aad0b16cb0022372..aa4a5e96f2a1be558fb39e5612b64360eee1ac6f 100644 (file)
@@ -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')