PING: PATCH Re: [DARWIN]: Add -mdynamic-no-pic to Darwin-specific options
Robert Bowdidge
bowdidge@apple.com
Tue Aug 31 20:17:00 GMT 2004
Ping:
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01485.html
This change adds the flag "-mdynamic-no-pic" when compiling gcc itself
on Darwin, improving the efficiency of gcc's code and thus improving
compile times. On our compiler timing test projects, this change
improved compile times by 3-5%. gcc still bootstraps after this
change, and the flag was correctly applied to gcc but not to libraries.
See the original message for full details of the change, and see
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg01165.html
for details of why this flag is needed on Mac OS X.
This version includes changes suggested by Mike Stump and Andrew
Pinski. The compiler bootstraps on Darwin, and (for Apple folks)
builds correctly using Apple's internal build tools.
Ok to submit to mainline?
Robert
In addition to these changes, configure was regenerated with autoconf
version 2.13. I also added
the file config/mh-ppc-darwin with the following contents:
# The -mdynamic-no-pic ensures that the compiler executable is built
without
# position-independent-code -- the usual default on Darwin. This fix
speeds
# compiles by 3-5%.
BOOT_CFLAGS=-g -O2 -mdynamic-no-pic
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/ChangeLog,v
retrieving revision 1.536.2.46.2.4
diff -u -b -d -r1.536.2.46.2.4 ChangeLog
--- ChangeLog 23 Aug 2004 19:20:30 -0000 1.536.2.46.2.4
+++ ChangeLog 31 Aug 2004 19:35:26 -0000
@@ -1,3 +1,11 @@
+2004-08-31 Robert Bowdidge <bowdidge@apple.com>
+
+ * Makefile.in: Move BOOT_CFLAGS above host makefile fragment include.
+ * configure.in: add test for powerpc-*-darwin* to specify makefile
frag
+ * configure: regenerate
+ * config/mh-ppc-darwin: create file, override BOOT_CFLAGS for
+ -mdynamic-no-pic
+
2004-08-19 Michael Koch <konqueror@gmx.de>
* gcc/doc/install.texi: Update entry about automake for libjava.
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/Makefile.in,v
retrieving revision 1.104.2.35.2.4
diff -u -b -d -r1.104.2.35.2.4 Makefile.in
--- Makefile.in 23 Aug 2004 19:20:31 -0000 1.104.2.35.2.4
+++ Makefile.in 31 Aug 2004 19:35:27 -0000
@@ -486,6 +486,11 @@
@echo Please reconfigure without --enable-bootstrap
@endif gcc-bootstrap
+# Flags to pass to stage2 and later makes. -- define here so fragments
can
+# override them.
+BOOT_CFLAGS= -g -O2
+
+
# The first rule in the file had better be this one. Don't put any
above it.
# This lives here to allow makefile fragments to contain dependencies.
@default_target@:
@@ -28137,7 +28142,6 @@
objext = .o
# Flags to pass to stage2 and later makes.
-BOOT_CFLAGS= -g -O2
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
STAGE_PREFIX=$$r/stage-gcc/ \
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.161.2.40.2.4
diff -u -b -d -r1.161.2.40.2.4 configure.in
--- configure.in 23 Aug 2004 19:20:37 -0000 1.161.2.40.2.4
+++ configure.in 31 Aug 2004 19:35:27 -0000
@@ -945,6 +945,9 @@
tentative_cc="/usr/cygnus/progressive/bin/gcc"
host_makefile_frag="config/mh-lynxrs6k"
;;
+ powerpc-*-darwin*)
+ host_makefile_frag="config/mh-ppc-darwin"
+ ;;
*-*-lynxos*)
# /bin/cc is less than useful for our purposes. Always use GCC
tentative_cc="/bin/gcc"
More information about the Gcc-patches
mailing list