]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Compile with -ftrivial-auto-var-init=zero in release mode
authorJan Janssen <medhefgo@web.de>
Sat, 7 May 2022 09:31:26 +0000 (11:31 +0200)
committerJan Janssen <medhefgo@web.de>
Fri, 13 May 2022 15:15:03 +0000 (17:15 +0200)
meson.build

index e43dcf7d509074242c2b35a2d0abc25adac51215..b36e02797d44c1211bffabb74934bd0630ce3ee9 100644 (file)
@@ -413,6 +413,13 @@ if cc.get_id() == 'clang'
         ]
 endif
 
+if get_option('mode') == 'release'
+        # We could enable 'pattern' for developer mode, but that can interfere with
+        # valgrind and sanitizer builds. Also, clang does not zero-initialize unions,
+        # breaking some of our code (https://reviews.llvm.org/D68115).
+        possible_common_cc_flags += '-ftrivial-auto-var-init=zero'
+endif
+
 possible_cc_flags = possible_common_cc_flags + [
         '-Werror=missing-declarations',
         '-Werror=missing-prototypes',