Skip to content

Commit 53ee5b5

Browse files
committed
Try to only use the GCC workaround if gcc version is 4.8
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@24587 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 2e7ebe9 commit 53ee5b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

configure.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ AC_TRY_LINK([void abc() {}], [abc();], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([n
146146
fi
147147
fi
148148

149+
TRY_FLAGS="-fno-stack-protector"
149150
# GCC 4.8 generates bad code with some optimisation flags. Let's try to disable them.
150-
for flag in -fno-tree-ch -fno-tree-vrp -fno-tree-pre -fno-stack-protector; do
151+
if $CC --version | head -n1 | sed "s/ *[(].*[)]//" | grep -q 4[.]8; then
152+
TRY_FLAGS="$TRY_FLAGS -fno-tree-ch -fno-tree-vrp -fno-tree-pre"
153+
fi
154+
for flag in $TRY_FLAGS; do
151155
OLD_CFLAGS="$CFLAGS"
152156
CFLAGS="$RUNTIMECFLAGS $flag -Werror"
153157
AC_TRY_LINK([], [return 0;], [CFLAGS="$OLD_CFLAGS $flag"],[CFLAGS="$OLD_CFLAGS"])

0 commit comments

Comments
 (0)