]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Add --warn-common and --fatal-warnings to link flags
authorJan Janssen <medhefgo@web.de>
Thu, 4 Nov 2021 18:03:45 +0000 (19:03 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 8 Nov 2021 23:57:29 +0000 (08:57 +0900)
meson.build

index f1be04e5aea7124f4b019be109db8e527f3f9af1..cf10dd82c80778efc667bc014be00d462fe2b54a 100644 (file)
@@ -387,11 +387,16 @@ endif
 # --as-needed and --no-undefined are provided by meson by default,
 # run 'meson configure' to see what is enabled
 possible_link_flags = [
-        '-Wl,-z,relro',
+        '-Wl,--fatal-warnings',
         '-Wl,-z,now',
+        '-Wl,-z,relro',
         '-fstack-protector',
 ]
 
+if get_option('b_sanitize') == 'none'
+        possible_link_flags += '-Wl,--warn-common'
+endif
+
 if cc.get_id() == 'clang'
         possible_common_cc_flags += [
                 '-Wno-typedef-redefinition',