aboutsummaryrefslogtreecommitdiffstats
path: root/erts/aclocal.m4
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-08-30 17:01:14 +0200
committerBjörn Gustavsson <[email protected]>2011-09-20 14:02:45 +0200
commitdd24ca1cb76de9973220fed356540f190a05ac83 (patch)
tree7171c03de6e57d2de3fa3f72e7a820a78f73a42e /erts/aclocal.m4
parente84f232326b2800ca806c867b2bfbe3652d423cb (diff)
downloadotp-dd24ca1cb76de9973220fed356540f190a05ac83.tar.gz
otp-dd24ca1cb76de9973220fed356540f190a05ac83.tar.bz2
otp-dd24ca1cb76de9973220fed356540f190a05ac83.zip
Fix build problems on MacOS 10.7 (Lion)
On MacOS 10.7 (Lion) with Xcode 4.1 installed, the default C compiler is llvm-gcc-4.2. That compiler compiles beam_emu.c incorrectly, resulting in an emulator that will not start. The problem can be worked around by turning off all optimizations, but that will significantly degrade the performance of the run-time system. The problem can also be worked around manually like this: CC=gcc-4.2 ./configure To allow a working system to be built "out of the box", have the configure script set up the emulator Makefile so that gcc-4.2 will be used to compile beam_emu.c if the default compiler is llvm-based. All other C files will still be compiled with the default compiler.
Diffstat (limited to 'erts/aclocal.m4')
-rw-r--r--erts/aclocal.m45
1 files changed, 4 insertions, 1 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index b64380e817..9956835dc8 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -125,6 +125,9 @@ AC_DEFUN(LM_FIND_EMU_CC,
ac_cv_prog_emu_cc,
[
AC_TRY_COMPILE([],[
+#ifdef __llvm__
+#error "llvm is currently unable to compile beam_emu.c"
+#endif
__label__ lbl1;
__label__ lbl2;
int x = magic();
@@ -140,7 +143,7 @@ lbl2:
],ac_cv_prog_emu_cc=$CC,ac_cv_prog_emu_cc=no)
if test $ac_cv_prog_emu_cc = no; then
- for ac_progname in emu_cc.sh gcc; do
+ for ac_progname in emu_cc.sh gcc-4.2 gcc; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do