gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/02: configure: do not use -Og with Clang when ASAN en


From: gnunet
Subject: [libmicrohttpd] 01/02: configure: do not use -Og with Clang when ASAN enabled
Date: Sun, 29 May 2022 14:54:41 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit cf26c7b44377070de6253f99cb44546cca458fbe
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun May 29 15:37:05 2022 +0300

    configure: do not use -Og with Clang when ASAN enabled
---
 configure.ac | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index cac74b51..be6b43a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,7 +159,32 @@ AS_CASE([${enable_build_type}],[debug|debugger],
   [ # Debug build or build for walking with debugger
     CFLAGS="${user_CFLAGS}"
     AS_VAR_IF([enable_build_type],["debug"],
-      [MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Og], [-O0])],
+      [
+        AS_IF([test "x${enable_sanitizers}" != "xno"],
+          [
+            AC_CACHE_CHECK([whether workarounds for clang are required],
+              [mhd_cv_cc_clang_based],
+              [
+                AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#if ! defined(__clang__) && ! defined(__llvm__)
+#error Compiler is not clang-based
+choke me now
+#endif
+                      ]]
+                    )
+                  ],
+                  [mhd_cv_cc_clang_based="yes"],[mhd_cv_cc_clang_based="no"]
+                )
+              ]
+            )
+          ]
+        )
+        # Clang has ASAN (pointer compare) broken when '-Og' optimisations are 
used
+        AS_IF([test "x${enable_sanitizers}" != "xno" && test 
"x${mhd_cv_cc_clang_based}" = "xyes"],
+          [MHD_CHECK_ADD_CC_CFLAG([-O0], [CFLAGS_ac])],
+          [MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-Og], [-O0])]
+        )
+      ],
       [MHD_CHECK_ADD_CC_CFLAG([-O0], [CFLAGS_ac])]
     )
     MHD_FIND_ADD_CC_CFLAG([CFLAGS_ac], [-ggdb3], [-g3], [-ggdb], [-g])

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]