diff options
author | Rose <83477269+AtariDreams@users.noreply.github.com> | 2023-05-06 18:07:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-06 18:07:14 +0100 |
commit | 00d07e7682d289c3afee9df557ae909b9b403f9c (patch) | |
tree | 0844f7c818889c4d1d59ec8baa09fdf81af775a1 /src/configure.ac | |
parent | 3ab3a864814f903da8a158c01820e4fbe1013c08 (diff) |
patch 9.0.1517: MacOS: configure removes -O2 from $CFLAGSv9.0.1517
Problem: MacOS: configure removes -O2 from $CFLAGS.
Solution: Only adjust $CFLAGS for gcc. (closes #12351)
Diffstat (limited to 'src/configure.ac')
-rw-r--r-- | src/configure.ac | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/configure.ac b/src/configure.ac index 6936ac9b7b..d56001f9b5 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -93,14 +93,19 @@ if test -z "$CFLAGS"; then CFLAGS="-O" test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall -Wno-deprecated-declarations" fi + if test "$GCC" = yes; then - dnl method that should work for nearly all versions + dnl Method that should work for nearly all gcc versions. gccversion=`$CC -dumpversion` if test "x$gccversion" = "x"; then dnl old method; fall-back for when -dumpversion doesn't work gccversion=`$CC --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` fi - dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki + + dnl Gcc version 4.0.1 was reported to cause trouble on Macintosh by Marcin + dnl Dalecki. For Mac with Intel the symptom reported is: malloc() reports + dnl double free. This happens in expand_filename(), because the optimizer + dnl swaps two blocks of code, both using "repl", that can't be swapped. if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"' CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-O/'` @@ -299,14 +304,6 @@ if test "$vim_cv_uname_output" = Darwin; then with_x=no fi fi - - dnl Avoid a bug with -O2 with gcc 4.0.1. Symptom: malloc() reports double - dnl free. This happens in expand_filename(), because the optimizer swaps - dnl two blocks of code, both using "repl", that can't be swapped. - if test "$MACARCH" = "intel" -o "$MACARCH" = "both"; then - CFLAGS=`echo "$CFLAGS" | sed 's/-O[[23456789]]/-Oz/'` - fi - else AC_MSG_RESULT(no) fi |