Browse Source

Only try to enable _FORTIFY_SOURCE if the user has not disabled optimizations (#15284)

Only try to enable _FORTIFY_SOURCE if the user has not disabled optimizations.
Austin S. Hemmelgarn 1 year ago
parent
commit
435cf76e73
1 changed files with 1 additions and 1 deletions
  1. 1 1
      configure.ac

+ 1 - 1
configure.ac

@@ -434,7 +434,7 @@ if ! echo "${originalCFLAGS}" | grep -q '-D_FORTIFY_SOURCE'; then
         [HAVE_FORTIFY_SOURCE=2]
     )
 
-    if test "x${HAVE_FORTIFY_SOURCE}" = "x2"; then
+    if test "x${HAVE_FORTIFY_SOURCE}" = "x2" && echo "${originalCFLAGS}" | grep -qv '-O0'; then
         AC_CHECK_DECL(
             __builtin_dynamic_object_size,
             [AX_CHECK_COMPILE_FLAG(