Skip to content

Commit

Permalink
Trac #34293: rubiks: Work around build failure with XCode
Browse files Browse the repository at this point in the history
On Apple clang version 13.1.6 (clang-1316.0.21.2.5), building `g++
-std=gnu++11 -g -O2  -c mcube.cpp` appears to hang forever.

We work around this by reducing the optimization level on macOS.

URL: https://trac.sagemath.org/34293
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): John Palmieri
  • Loading branch information
Release Manager committed Aug 27, 2022
2 parents 945c339 + 6b9e1d7 commit 2f94ddf
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions build/pkgs/rubiks/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
## rubiks
###########################################

# Work around a bug in gcc 4.6.0: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702
if [ "`testcc.sh $CC`" = GCC ] ; then
if $CC -dumpversion 2>/dev/null |grep >/dev/null '^4\.6\.[01]$' ; then
echo "Warning: Working around bug in gcc 4.6.0"
EXTRA_FLAG="-fno-ivopts"
fi
fi

# Most packages do not need all these set
# But it is better to do them all each time, rather than ommit
# a flag by mistake.
Expand Down Expand Up @@ -50,6 +42,11 @@ else
INSTALL=install; export INSTALL
fi

if [ $UNAME = "Darwin" ]; then
# #34293: Work around compiler hang
export CXXFLAGS="$CXXFLAGS -O1"
fi

cd src

echo "Building Rubiks cube solvers"
Expand Down

0 comments on commit 2f94ddf

Please sign in to comment.