configure: fix clang on macOS 10.15
authorJosh de Kock <josh@itanimul.li>
Tue, 14 Apr 2020 17:42:09 +0000 (18:42 +0100)
committerJosh de Kock <josh@itanimul.li>
Wed, 15 Apr 2020 14:45:31 +0000 (15:45 +0100)
Works around a bug in the newer Xcode 11's clang with -fstack-check
emitting bad code with misaligned call instructions.

This fixes Trac #8073

configure

index fdd9a7b..80fdfa1 100755 (executable)
--- a/configure
+++ b/configure
@@ -5359,6 +5359,11 @@ case $target_os in
         fi
         version_script='-exported_symbols_list'
         VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
+        # Workaround for Xcode 11 -fstack-check bug
+        if enabled clang; then
+            clang_version=$($cc -dumpversion)
+            test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
+        fi
         ;;
     msys*)
         die "Native MSYS builds are discouraged, please use the MINGW environment."