[m-rev.] for review: enable asm_fast* (and reg*) grades on 64-bit OS X
Julien Fischer
jfischer at opturion.com
Thu Sep 4 14:36:00 AEST 2014
For review by anyone.
The asm_fast* grades don't seem to currently work on 32-bit OS X due
to the configure check for GCC labels failing; I am looking into this.
The 32-bit reg* grades do work, but I haven't yet tested them very
extensively.
-------------------------------------------
Enable the asm_fast* (and reg*) grades on x86_64 OS X machines.
configure.ac:
Do not set the LLDS base grade to 'none' if we are on 64-bit OS X and
we are using GCC 4.3 onwards. (Older versions of GCC are either
broken or do not work on this platform anyway.)
README.MacOS:
Mention that the asm_fast* and reg* grades do work on x86_64
systems.
NEWS:
Announce that the asm_fast* and reg* grades are now supported
on x86_64 OS X machines.
Julien.
diff --git a/NEWS b/NEWS
index 3482cee..489e398 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,11 @@ Changes to the Mercury compiler:
* We configure Boehm GC to use mmap in threaded grades on Linux to avoid
conflicts with glibc malloc leading to memory corruption.
+* The asm_fast* and reg* grades now work on 64-bit Intel OS X systems when
+ using GCC as the C compiler.
+
+ See README.MacOS for further details.
+
Changes to the extras distribution:
* We have added support for Unicode and other enhancements to the lex and
diff --git a/README.MacOS b/README.MacOS
index 2189b32..c0c79b2 100644
--- a/README.MacOS
+++ b/README.MacOS
@@ -24,14 +24,18 @@ from version 10.5 or later. For information about installing Mercury on
versions of Mac OS X before 10.5, including on PowerPC systems, see the
sections below.
-The 'asm_fast*' and 'reg*' grades are not available on Intel Mac OS X systems.
-The only low-level C grades available are the 'none*' grades. The high-level
-C, Java, Erlang and C# grades all work. The 'erlang' grade requires an Erlang
-installation to be available and the C# grades require the Mono .NET
-implementation. (See README.Erlang and README.CSharp for further details.)
-
-Unless otherwise directed, the 'hlc.gc' grade will be used as the default grade
-for compiling applications.
+The 'asm_fast*' and 'reg*' grades are only available on 64-bit Intel Mac OS X
+systems and only when using GCC version 4.3 or later as the C compiler.
+(This has only been tested with the MacPorts builds of GCC however.)
+
+If clang is being used as the C compiler then the only low-level C grades
+available are the 'none*' grades. The high-level C, Java, Erlang and C# grades
+all work. The 'erlang' grade requires an Erlang installation to be available
+and the C# grades require the Mono .NET implementation. (See README.Erlang and
+README.CSharp for further details.)
+
+If the 'asm_fast.gc' grade is not available and unless otherwise directed, the
+'hlc.gc' grade will be used as the default grade for compiling applications.
By default, 64-bit versions of the executables and libraries in the Mercury
system will be installed on x86-64 machines running Mac OS X 10.6 or later. To
diff --git a/configure.ac b/configure.ac
index 20285b1..6df5f7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3314,16 +3314,22 @@ case "$mercury_cv_user_base_grade" in
;;
esac
-# Force the use of the none grade on Apple x86/Darwin systems,
-# since the default gcc supplied with that system doesn't
-# work with either the reg or asm_fast grades.
-# XXX provide a workaround for the former; the latter is a problem
-# with gcc's Darwin support.
+# Force the use of the none grade on Apple x86_64 systems when using
+# GCC 4.1 or 4.2. The asm_fast and reg grades do not work with those versions.
+# They do work properly on x86_64 systems with GCC version 4.3 onwards.
#
+case "$C_COMPILER_TYPE" in
+ gcc_4_1_*|gcc_4_2_*)
+ case "$host" in x86_64*apple*darwin*) BEST_LLDS_BASE_GRADE=none ;;
+ esac
+esac
+
+# Force the use of the none grade on x86/Darwin systems.
+# XXX we should check whether asm_fast or reg work with recent GCCs.
# The asm_fast and reg grades also do not currently work on Linux/PPC.
#
case "$host" in
- i*86*apple*darwin*|x86_64*apple*darwin*|powerpc*-linux-gnu)
+ i*86*apple*darwin*|powerpc*-linux-gnu)
BEST_LLDS_BASE_GRADE=none
;;
esac
More information about the reviews
mailing list