build: Support building using clang-usan and disable-optimization
authorKaterina Barone-Adesi <katerinab@gmail.com>
Fri, 16 May 2014 16:07:34 +0000 (18:07 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 16 May 2014 17:58:34 +0000 (19:58 +0200)
Clang Undefined Behaviour Sanitizer seems to make non-constant constant
expressions, making the compilation fail when they are used within
inline assembly if no optimization is requested.

Add -O1 to the cflags to hide the misbehaviour.

Bug-Id: 683

configure

index 6f84dfa..74a4df1 100755 (executable)
--- a/configure
+++ b/configure
@@ -2443,7 +2443,7 @@ case "$toolchain" in
     ;;
     clang-usan)
         cc_default="clang"
-        add_cflags  -fsanitize=undefined
+        add_cflags  -fsanitize=undefined -O1
         add_ldflags -fsanitize=undefined
     ;;
     gcc-asan)