This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix Darwin bootstrap


The Darwin version of ranlib does not make common definitions
available in the archive table of contents -- unless you pass it the
"-c" option.  Most other versions of ranlib do make such definitions
available, and GCC presently depends on that behavior, accidentally.

(On a meta note, how is libbackend.a a win?  I'd love it if we really
have a library for the back end, but we don't, and to get there we
need to change the code, not the build process.  Right now, it seems
like building this .a file is just a way of slowing down the
bootstrap...)

Tested on powerpc-apple-darwin7.4.0, installed on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-07-04  Mark Mitchell  <mark@codesourcery.com>

	* configure.ac (ranlib_flags): New variable.
	* Makefile.in (RANLIB_FLAGS): New variable.
	(libbackend.a): Use it.

Index: Makefile.in
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1316
diff -c -5 -p -r1.1316 Makefile.in
*** Makefile.in	1 Jul 2004 04:08:57 -0000	1.1316
--- Makefile.in	4 Jul 2004 04:57:54 -0000
*************** BISONFLAGS =
*** 222,231 ****
--- 222,232 ----
  FLEX = @FLEX@
  FLEXFLAGS =
  AR = ar
  AR_FLAGS = rc
  RANLIB = @RANLIB@
+ RANLIB_FLAGS = @ranlib_flags@
  
  # -------------------------------------------
  # Programs which operate on the build machine
  # -------------------------------------------
  
*************** compilations: $(BACKEND)
*** 1145,1155 ****
  
  # This archive is strictly for the host.
  libbackend.a: $(OBJS@onestep@)
  	-rm -rf libbackend.a
  	$(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
! 	-$(RANLIB) libbackend.a
  
  # We call this executable `xgcc' rather than `gcc'
  # to avoid confusion if the current directory is in the path
  # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
  xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
--- 1146,1156 ----
  
  # This archive is strictly for the host.
  libbackend.a: $(OBJS@onestep@)
  	-rm -rf libbackend.a
  	$(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
! 	-$(RANLIB) $(RANLIB_FLAGS) libbackend.a
  
  # We call this executable `xgcc' rather than `gcc'
  # to avoid confusion if the current directory is in the path
  # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
  xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
Index: configure.ac
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.43
diff -c -5 -p -r2.43 configure.ac
*** configure.ac	18 Jun 2004 01:59:45 -0000	2.43
--- configure.ac	4 Jul 2004 04:57:38 -0000
*************** case ${AWK} in
*** 727,736 ****
--- 727,749 ----
  esac
  
  gcc_AC_PROG_LN_S
  ACX_PROG_LN($LN_S)
  AC_PROG_RANLIB
+ case "${host}" in
+ *-*-darwin*)
+   # By default, the Darwin ranlib will not treat common symbols as
+   # definitions when  building the archive table of contents.  Other 
+   # ranlibs do that; pass an option to the Darwin ranlib that makes
+   # it behave similarly.
+   ranlib_flags="-c" 
+   ;;
+ *)
+   ranlib_flags=""
+ esac
+ AC_SUBST(ranlib_flags)
+      
  gcc_AC_PROG_INSTALL
  
  # See if cmp has --ignore-initial.
  gcc_AC_PROG_CMP_IGNORE_INITIAL
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]