Skip to content

Commit 2f94ddf

Browse files
author
Release Manager
committed
Trac #34293: rubiks: Work around build failure with XCode
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
2 parents 945c339 + 6b9e1d7 commit 2f94ddf

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

build/pkgs/rubiks/spkg-install.in

+5-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
## rubiks
33
###########################################
44

5-
# Work around a bug in gcc 4.6.0: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702
6-
if [ "`testcc.sh $CC`" = GCC ] ; then
7-
if $CC -dumpversion 2>/dev/null |grep >/dev/null '^4\.6\.[01]$' ; then
8-
echo "Warning: Working around bug in gcc 4.6.0"
9-
EXTRA_FLAG="-fno-ivopts"
10-
fi
11-
fi
12-
135
# Most packages do not need all these set
146
# But it is better to do them all each time, rather than ommit
157
# a flag by mistake.
@@ -50,6 +42,11 @@ else
5042
INSTALL=install; export INSTALL
5143
fi
5244

45+
if [ $UNAME = "Darwin" ]; then
46+
# #34293: Work around compiler hang
47+
export CXXFLAGS="$CXXFLAGS -O1"
48+
fi
49+
5350
cd src
5451

5552
echo "Building Rubiks cube solvers"

0 commit comments

Comments
 (0)