Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 6f85ead

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Do not add weird GCC CFLAGS when using ccc-analyzer
ccc-analyzer uses both gcc and clang commands to analyze code. The check for the flags seem to not trigger clang to be called; possibly because the function is empty. Belonging to [master]: - #2688
1 parent 317fb48 commit 6f85ead

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

configure.ac

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,17 +198,21 @@ LIBS="$LIBS_BEFORE"
198198

199199
TRY_FLAGS="-fno-stack-protector"
200200

201-
# GCC 5.x generates bad code due to detecting some impure functions as pure
202-
if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^5"; then
203-
TRY_FLAGS="$TRY_FLAGS -fno-ipa-pure-const"
204-
fi
201+
if echo $CC | grep -v ccc-analyzer; then # ccc-analyzer calls gcc first and then clang; the CFLAGS need to work in both compilers...
202+
203+
# GCC 5.x generates bad code due to detecting some impure functions as pure
204+
if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^5"; then
205+
TRY_FLAGS="$TRY_FLAGS -fno-ipa-pure-const"
206+
fi
207+
208+
# GCC 7.x issues:
209+
# - RUNPATH instead of RPATH, disable that via -Wl,--disable-new-dtags
210+
# - sqrt from libcolamd is not found in -lm if -Wl,--no-as-needed is not specified
211+
if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^7"; then
212+
TRY_FLAGS="$TRY_FLAGS -Wl,--no-as-needed"
213+
RPATH_EXTRA="-Wl,--disable-new-dtags"
214+
fi
205215

206-
# GCC 7.x issues:
207-
# - RUNPATH instead of RPATH, disable that via -Wl,--disable-new-dtags
208-
# - sqrt from libcolamd is not found in -lm if -Wl,--no-as-needed is not specified
209-
if $CC --version | grep -q gcc && $CC -dumpversion | grep -q "^7"; then
210-
TRY_FLAGS="$TRY_FLAGS -Wl,--no-as-needed"
211-
RPATH_EXTRA="-Wl,--disable-new-dtags"
212216
fi
213217

214218
AC_MSG_CHECKING([for flags to append to CFLAGS ($TRY_FLAGS)])

0 commit comments

Comments
 (0)