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]

Committed: fix libgcc build for MMIX


At r156927, libgcc build for MMIX is broken as follows, a regression
which is probably the same for all libgcc "legacy" targets; those
where libgcc call out for make in the gcc build directory for building
some libgcc files.  This issue might be related to some build timing
issues; IIRC it has been mentioned earlier.  This might have been
broken for quite some while.  I don't recall a better fix than
completely migrating the target libgcc build rules into libgcc/, to
avoid the make call-out, so that's what I did.

Along that way I found that the tmake_file-"docommentation" in
libgcc/config.host is lying when it implies that $cpu_type/t-$cpu_type
(if it exists) is the default for tmake_file; the default is empty.
I left fixing that for...another day; not obvious whether fixing
the code or the comment is preferable.

Unfortunately the MULTILIB_EXTRA_OPTS-not-applied-at-base-multilib
comment is still true, so I just copied that comment over.

With the committed patch below, the build completes and testing
progresses well into the libstdc++ testsuite with no apparent
libgcc-related failures along the way.  I'll have to check whether
this patch is needed for the other open branches as well.

----------
...
# Recursively invoke make in the GCC directory to build any
# startfiles (for now).  We must do this just once, passing
# it all the GCC_EXTRA_PARTS as simultaneous goal targets,
# so that rules which cannot execute simultaneously are properly
# serialized.  We indirect through T_TARGET in case any multilib
# directories contain an equals sign, to prevent make from
# interpreting any of the goals as variable assignments.
# We must use cd && make rather than make -C, or else the stage
# number will be embedded in debug information.
T=`${PWDCMD-pwd}`/ \
	&& cd ../../.././gcc \
	&& make GCC_FOR_TARGET="/tmp/mmix/gccobj/./gcc/xgcc -B/tmp/mmix/gccobj/./gcc/ -nostdinc -B/tmp/mmix/gccobj/mmix/newlib/ -isystem /tmp/mmix/gccobj/mmix/newlib/targ-include -isystem /tmp/mmix/gcc/newlib/libc/include -B/tmp/mmix/gccobj/mmix/libgloss/mmix -L/tmp/mmix/gccobj/mmix/libgloss/libnosys -L/tmp/mmix/gcc/libgloss/mmix -B/tmp/mmix/pre/mmix/bin/ -B/tmp/mmix/pre/mmix/lib/ -isystem /tmp/mmix/pre/mmix/include -isystem /tmp/mmix/pre/mmix/sys-include   " \
	  MULTILIB_CFLAGS="-g -O2 -mabi=gnu" \
	  T=$T \
	  T_TARGET="${T}crtbegin.o ${T}crtend.o ${T}crti.o ${T}crtn.o" \
	  T_TARGET
make[5]: Entering directory `/tmp/mmix/gccobj/gcc'
/tmp/mmix/gccobj/./gcc/xgcc -B/tmp/mmix/gccobj/./gcc/ -nostdinc -B/tmp/mmix/gccobj/mmix/newlib/ -isystem /tmp/mmix/gccobj/mmix/newlib/targ-include -isystem /tmp/mmix/gcc/newlib/libc/include -B/tmp/mmix/gccobj/mmix/libgloss/mmix -L/tmp/mmix/gccobj/mmix/libgloss/libnosys -L/tmp/mmix/gcc/libgloss/mmix -B/tmp/mmix/pre/mmix/bin/ -B/tmp/mmix/pre/mmix/lib/ -isystem /tmp/mmix/pre/mmix/include -isystem /tmp/mmix/pre/mmix/sys-include    -c  -g -O2  -mabi=gnu -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I/tmp/mmix/gcc/gcc -I/tmp/mmix/gcc/gcc/. -I/tmp/mmix/gcc/gcc/../include -I/tmp/mmix/gcc/gcc/../libcpp/include -I/tmp/mmix/gccobj/./gmp -I/tmp/mmix/gcc/gmp -I/tmp/mmix/gccobj/./mpfr -I/tmp/mmix/gcc/mpfr -I/tmp/mmix/gcc/mpc/src  -I/tmp/mmix/gcc/gcc/../libdecnumber -I/tmp/mmix/gcc/gcc/../libdecnumber/dpd -I../libdecnumber     \
		/tmp/mmix/gcc/gcc/config/mmix/mmix.c -o mmix.o
In file included from /tmp/mmix/gcc/gcc/config/mmix/mmix.c:23:0:
/tmp/mmix/gcc/gcc/system.h:199:22: fatal error: strings.h: No such file or directory
compilation terminated.
make[5]: *** [mmix.o] Error 1
make[5]: Leaving directory `/tmp/mmix/gccobj/gcc'
----------

libgcc:
	Migrate from broken pre-libgcc legacy support to libgcc-centric rules.
	* config/mmix/t-mmix: New file.
	* config.host <mmix-knuth-mmixware> (extra_parts, tmake_file): Set.

gcc:
	Migrate crti, crtn, crtbegin, crtend build rules to libgcc.
	* config/mmix/t-mmix (EXTRA_MULTILIB_PARTS): Don't set.
	($(T)crti.o, $(T)crtn.o): Remove rules.

Index: libgcc/config.host
===================================================================
--- libgcc/config.host	(revision 156940)
+++ libgcc/config.host	(working copy)
@@ -432,6 +432,8 @@ mips-wrs-vxworks)
 mipstx39-*-elf* | mipstx39el-*-elf*)
 	;;
 mmix-knuth-mmixware)
+	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
+	tmake_file="${tmake_file} ${cpu_type}/t-${cpu_type}"
 	;;
 mn10300-*-*)
 	;;
--- /dev/null	Tue Oct 29 15:57:07 2002
+++ libgcc/config/mmix/t-mmix	Sun Feb 21 17:53:08 2010
@@ -0,0 +1,14 @@
+# Don't use global registers in libraries.
+# FIXME: Not applied at "root" level, so disabled at the moment to stop
+# incorrect comparisons with -mabi=gnu.
+#MULTILIB_EXTRA_OPTS = mno-base-addresses
+
+$(T)crti.o: $(gcc_srcdir)/config/mmix/crti.asm $(GCC_PASSES)
+	$(crt_compile) $(INCLUDES) \
+	$(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
+	$(gcc_srcdir)/config/mmix/crti.asm
+
+$(T)crtn.o: $(gcc_srcdir)/config/mmix/crtn.asm $(GCC_PASSES)
+	$(crt_compile) $(INCLUDES) \
+	$(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
+	$(gcc_srcdir)/config/mmix/crtn.asm
Index: gcc/config/mmix/t-mmix
===================================================================
--- gcc/config/mmix/t-mmix	(revision 156937)
+++ gcc/config/mmix/t-mmix	(working copy)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2009 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -20,8 +20,6 @@

 TARGET_LIBGCC2_CFLAGS = -mlibfuncs -O2

-EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o
-
 # We need to turn off some assumptions on normality for code in crtstuff.c
 # and crt{i,n}.asm, specifically about execution not continuing past the
 # end of the section in the file being compiled.  Thus we must stop the
@@ -31,18 +29,3 @@ CRTSTUFF_T_CFLAGS = -Wa,--no-stubs

 MULTILIB_OPTIONS = mabi=gnu
 MULTILIB_DIRNAMES = gnuabi
-
-# Don't use global registers in libraries.
-# FIXME: Not applied at "root" level, so disabled at the moment to stop
-# incorrect comparisons with -mabi=gnu.
-#MULTILIB_EXTRA_OPTS = mno-base-addresses
-
-$(T)crti.o: $(srcdir)/config/mmix/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	$(CRTSTUFF_T_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp \
-	$(srcdir)/config/mmix/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mmix/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	$(CRTSTUFF_T_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp \
-	$(srcdir)/config/mmix/crtn.asm

brgds, H-P


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