Fix fwrite$UNIX2003 symbols when cross-compiling for Tiger
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>
Mon, 26 May 2008 07:35:46 +0000 (07:35 +0000)
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>
Mon, 26 May 2008 07:35:46 +0000 (07:35 +0000)
- When compiling with -mmacos-deployment-target=10.4, we need
  --no-builtin-fprintf, as the use of GCC's builtin function
  optimisation for fprintf together with #include "PosixSource" in the
  RTS leads to the use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X
  10.5.2).

mk/config.mk.in

index 14fd667..1279523 100644 (file)
@@ -192,13 +192,18 @@ MACOSX_DEPLOYMENT_SDK = @MACOSX_DEPLOYMENT_SDK@
 
 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
 
 ifneq "$(MACOSX_DEPLOYMENT_VERSION)" ""
 MACOSX_DEPLOYMENT_CC_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
-                           -isysroot $(MACOSX_DEPLOYMENT_SDK)
+                           -isysroot $(MACOSX_DEPLOYMENT_SDK) \
+                           --no-builtin-fprintf
 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
                            -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
 # overwritten in build.mk and (b) we must not use the deployment options in
 # stage 1 or we get a linker error if the bootstrap compiler is for a more 
 # recent OS version.
 MACOSX_DEPLOYMENT_LD_OPTS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_VERSION) \
                            -Wl,-syslibroot,$(MACOSX_DEPLOYMENT_SDK)
 # We don't extend SRC_CC_OPTS and friends here directly, as (a) they may get
 # overwritten in build.mk and (b) we must not use the deployment options in
 # stage 1 or we get a linker error if the bootstrap compiler is for a more 
 # recent OS version.
+#
+# We need --no-builtin-fprintf, as the use of the builtin function optimisation
+# for fprintf together with #include "PosixSource" in the RTS leads to the
+# use of fwrite$UNIX2003 (with GCC 4.0.1 on Mac OS X 10.5.2).
 endif
 
 ################################################################################
 endif
 
 ################################################################################