m4: skip -fsanitize=object-size on clang
authorMichael Wallner <mike@php.net>
Tue, 14 Jan 2020 14:19:33 +0000 (15:19 +0100)
committerMichael Wallner <mike@php.net>
Tue, 14 Jan 2020 14:19:33 +0000 (15:19 +0100)
m4/ax_harden_compiler_flags.m4

index 9302b12d57e1552e4c7936f4f83900d4b44cf60a..8ceeca67a52f48d263367c8458e37b32eefadd25 100644 (file)
@@ -73,14 +73,17 @@ AC_DEFUN([_SET_SANITIZE_FLAGS],
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
-                               _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
                                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
-                               _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])])
+                               _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+                               AS_IF([test "$ax_cv_c_compiler_vendor" != "clang"],[
+                                 _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+                               ])
+                               ])
                       ])
                 ])
           ])