]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3729] Checked --no-undefined only when supported
authorFrancis Dupont <fdupont@isc.org>
Mon, 10 Feb 2025 20:14:20 +0000 (21:14 +0100)
committerAndrei Pavel <andrei@isc.org>
Thu, 13 Feb 2025 08:06:31 +0000 (10:06 +0200)
meson.build

index d560fe3da07881403a5ba91114d4328ae4c8e5c8..420dd9984d639890cfac400b9275bc96d28058ac 100644 (file)
@@ -283,13 +283,16 @@ result = cpp.run(
 conf_data.set('CHRONO_SAME_DURATION', result.returncode() == 0)
 
 ENVIRON_SHLIB_FLAGS = []
-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']
+# --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
 
 result = cpp.run(