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]

Re: [3.4 PATCH] Fix powerpc*-*-linux* bootstrap (PR target/19019)


On Wed, Feb 23, 2005 at 11:31:17AM -0500, David Edelsohn wrote:
> 	This patch looks reasonable to me.
> 
> 	Alan, any comment?

Looks OK to me too.  I was developing a competing patch when I saw
Jakub's post last night, but was stuck in shell quoting hell.  I think
my patch is more elegant (I'm biased, of course!), but Jakub's patch is
simpler in the sense that he doesn't try to use much shell magic.  It's
probably safer to go with Jakub's patch for 3.4, and of course this
patch isn't needed on mainline.  Anyway, just in case some problem
arises with Jakub's patch, here's mine.

The idea here is to not mark the versioned symbols hidden, and to add
	strip -w -N '*@GCC*' $@
to the darwin-ldouble.oS rule in libgcc.mk, which will remove the
versioned symbols.  (We know strip is the GNU one, because it is
powerpc64-linux-strip.)

	* Makefile.in (libgcc.mk): Pass STATIC_LIBGCC_OBJECT.
	* mklibgcc.in (STATIC_LIBGCC_OBJECT): Define and use.
	* config/rs6000/t-linux64 (STATIC_LIBGCC_OBJECT): Define.

Tested on native powerpc64-linux and i686-linux builds and an
i686-linux -> powerpc64-linux cross.

diff -urp -xCVS -x'*~' -x'.#*' gcc-3.4-virgin/gcc/Makefile.in gcc-3.4/gcc/Makefile.in
--- gcc-3.4-virgin/gcc/Makefile.in	2005-01-21 22:04:53.000000000 +1030
+++ gcc-3.4/gcc/Makefile.in	2005-02-23 17:44:30.000000000 +1030
@@ -1178,6 +1178,7 @@ libgcc.mk: config.status Makefile mklibg
 	SHLIB_MAPFILES='$(SHLIB_MAPFILES)' \
 	SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \
 	MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \
+	STATIC_LIBGCC_OBJECT='$(STATIC_LIBGCC_OBJECT)' \
 	mkinstalldirs='$(SHELL) $(srcdir)/mkinstalldirs' \
 	  $(SHELL) mklibgcc > tmp-libgcc.mk
 	mv tmp-libgcc.mk libgcc.mk
diff -urp -xCVS -x'*~' -x'.#*' gcc-3.4-virgin/gcc/config/rs6000/t-linux64 gcc-3.4/gcc/config/rs6000/t-linux64
--- gcc-3.4-virgin/gcc/config/rs6000/t-linux64	2004-03-21 18:36:48.000000000 +1030
+++ gcc-3.4/gcc/config/rs6000/t-linux64	2005-02-24 09:23:12.246515629 +1030
@@ -4,6 +4,8 @@
 LIB2FUNCS_EXTRA = tramp.S $(srcdir)/config/rs6000/ppc64-fp.c \
 	$(srcdir)/config/rs6000/darwin-ldouble.c
 
+STATIC_LIBGCC_OBJECT = echo '\''	( '$(NM_FOR_TARGET)' '\''${SHLIB_NM_FLAGS} $${o}'\'' | $(AWK) '\'\\\'\''NF == 3 && $$$$2 !~ /^[UN]$$$$/ && $$$$3 !~ /@GCC/ { print "\t.hidden", $$$$3 }'\'\\\'\''; cat libgcc/'\''$${dir}'\''/stacknote.s ) | $$(GCC_FOR_TARGET) $$(LIBGCC2_CFLAGS) '\''$${flags}'\'' -r -nostdinc -nostdlib -o $$@ '\''$${o}'\'' -xassembler -'\''; test $${o} != libgcc/$${dir}/darwin-ldouble.o || ( echo -n '\''	'\''; if [ -f ./strip ] ; then echo -n ./strip ; elif [ -f $(objdir)/../binutils/strip ] ; then echo -n $(objdir)/../binutils/strip ; else if [ "$(host)" = "$(target)" ] ; then echo -n strip; else echo -n strip | sed -e '\''$(program_transform_name)'\'' ; fi; fi; echo '\'' -w -N '\'\\\''*@GCC*'\\\'\'' $$@'\'' )
+
 TARGET_LIBGCC2_CFLAGS = -mno-minimal-toc -fPIC -specs=bispecs
 
 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver
diff -urp -xCVS -x'*~' -x'.#*' gcc-3.4-virgin/gcc/mklibgcc.in gcc-3.4/gcc/mklibgcc.in
--- gcc-3.4-virgin/gcc/mklibgcc.in	2004-10-20 20:50:00.000000000 +0930
+++ gcc-3.4/gcc/mklibgcc.in	2005-02-23 22:41:26.761371598 +1030
@@ -40,6 +40,7 @@
 # SHLIB_NM_FLAGS
 # SHLIB_INSTALL
 # MULTILIB_OSDIRNAMES
+# STATIC_LIBGCC_OBJECT
 
 # Make needs VPATH to be literal.
 echo 'srcdir = @srcdir@'
@@ -323,6 +324,10 @@ for name in $LIBGCOV; do
   libgcov_objs="$libgcov_objs ${name}${objext}"
 done
 
+# non-GNU nm emits three fields even for undefined and typeless symbols,
+# so explicitly omit them
+test -n "$STATIC_LIBGCC_OBJECT" || STATIC_LIBGCC_OBJECT='echo '\''	( $(NM_FOR_TARGET) '\''${SHLIB_NM_FLAGS} ${o}'\'' | $(AWK) '\'\\\'\''NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden", $$3 }'\'\\\'\''; cat libgcc/'\''${dir}'\''/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '\''${flags}'\'' -r -nostdinc -nostdlib -o $@ '\''${o}'\'' -xassembler -'\'
+
 # SHLIB_MKMAP
 # SHLIB_MKMAP_OPTS
 # SHLIB_MAPFILES
@@ -409,9 +414,7 @@ EOF
       # .oS objects will have all non-local symbol definitions .hidden
       oS=`echo ${o} | sed s~${objext}'$~.oS~g'`
       echo "${oS}: stmp-dirs libgcc/${dir}/stacknote.s ${o}"
-      # non-GNU nm emits three fields even for undefined and typeless symbols,
-      # so explicitly omit them
-      echo '	( $(NM_FOR_TARGET) '${SHLIB_NM_FLAGS} ${o}' | $(AWK) '\''NF == 3 && $$2 !~ /^[UN]$$/ { print "\t.hidden", $$3 }'\''; cat libgcc/${dir}/stacknote.s ) | $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) '${flags}' -r -nostdinc -nostdlib -o $@ '${o}' -xassembler -'
+      eval "$STATIC_LIBGCC_OBJECT"
       libgcc_a_objs="${libgcc_a_objs} ${oS}"
     done
   fi

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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