This is the mail archive of the 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]

Preparatory patch for toplevel libgcc - use $(T) for EXTRA_PARTS

[CC'ing build system maintainers, whom I haven't heard back from, plus
the two global maintainers who foolishly (:-)) offered to review top
level libgcc patches.]

The history is a little murky, but I believe that EXTRA_PARTS predates
EXTRA_MULTILIB_PARTS.  The former are built only once, the latter once
per multilib.  But for most things, especially startup files, this isn't
right: if there are multilibs they should be built once per multilib.

The new top level libgcc mechanism doesn't distinguish between EXTRA_PARTS
and EXTRA_MULTILIB_PARTS.  So files which currently are built once per
compiler will suddenly become once per multilib.  I consider this
a bug fix.  Note that it's not part of this patch, though - this patch
does not change behavior at all.

When building EXTRA_MULTILIB_PARTS, there's a make variable $(T) which
specifies which subdirectory the result should be compiled into.  Top
level libgcc's transition mechanism uses $(T) to build startfiles into the
correct multilib subdirectory (since the layout has changed).  That means
we need $(T) for both EXTRA_PARTS and EXTRA_MULTILIB_PARTS.  So this patch
adds it to every target-specific rule used to generate a file for
EXTRA_PARTS.  It has no affect for now; T is explicitly set empty except
when recursing for multilibs.

I tested this by building and installing an x86_64-pc-linux-gnu to
sparc-elf cross compiler.  The files from EXTRA_PARTS were built (once)
properly, and installed in the normal location.

Is this patch OK to commit?

Daniel Jacobowitz

2006-12-16  Daniel Jacobowitz  <>

	* config/alpha/t-crtfm: Use $(T) in rules for EXTRA_PARTS.
	* config/alpha/t-vms, config/alpha/t-vms64, config/fr30/t-fr30,
	config/i386/t-rtems-i386, config/ia64/t-ia64, config/rs6000/t-beos,
	config/rs6000/t-newas, config/sparc/t-elf: Likewise.

diff -ur trunk/gcc/config/alpha/t-crtfm fsf-branch/gcc/config/alpha/t-crtfm
--- trunk/gcc/config/alpha/t-crtfm	2006-11-25 11:26:12.000000000 -0500
+++ fsf-branch/gcc/config/alpha/t-crtfm	2006-11-24 17:35:53.000000000 -0500
@@ -1,5 +1,5 @@
 EXTRA_PARTS += crtfastmath.o
-crtfastmath.o: $(srcdir)/config/alpha/crtfastmath.c $(GCC_PASSES)
+$(T)crtfastmath.o: $(srcdir)/config/alpha/crtfastmath.c $(GCC_PASSES)
 	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -frandom-seed=gcc-crtfastmath -c \
-		-o crtfastmath.o $(srcdir)/config/alpha/crtfastmath.c
+		-o $(T)crtfastmath.o $(srcdir)/config/alpha/crtfastmath.c
diff -ur trunk/gcc/config/alpha/t-vms fsf-branch/gcc/config/alpha/t-vms
--- trunk/gcc/config/alpha/t-vms	2006-11-25 11:26:12.000000000 -0500
+++ fsf-branch/gcc/config/alpha/t-vms	2006-11-24 17:35:54.000000000 -0500
@@ -7,18 +7,18 @@
 # This object must be linked with in order to make the executable debuggable.
 # vms-ld handles it automatically when passed -g.
-vms-dwarf2.o : $(srcdir)/config/alpha/vms-dwarf2.asm
+$(T)vms-dwarf2.o : $(srcdir)/config/alpha/vms-dwarf2.asm
 	gcc -c -x assembler $< -o $@
-vms-dwarf2eh.o : $(srcdir)/config/alpha/vms-dwarf2eh.asm
+$(T)vms-dwarf2eh.o : $(srcdir)/config/alpha/vms-dwarf2eh.asm
 	gcc -c -x assembler $< -o $@
 # Assemble startup files.
-vcrt0.o: $(CRT0_S) $(GCC_PASSES)
-	decc -c /names=as_is $(srcdir)/config/alpha/vms-crt0.c -o vcrt0.o
+$(T)vcrt0.o: $(CRT0_S) $(GCC_PASSES)
+	decc -c /names=as_is $(srcdir)/config/alpha/vms-crt0.c -o $(T)vcrt0.o
-pcrt0.o: $(CRT0_S) $(GCC_PASSES)
-	decc -c /names=as_is $(srcdir)/config/alpha/vms-psxcrt0.c -o pcrt0.o
+$(T)pcrt0.o: $(CRT0_S) $(GCC_PASSES)
+	decc -c /names=as_is $(srcdir)/config/alpha/vms-psxcrt0.c -o $(T)pcrt0.o
diff -ur trunk/gcc/config/alpha/t-vms64 fsf-branch/gcc/config/alpha/t-vms64
--- trunk/gcc/config/alpha/t-vms64	2006-11-25 11:26:12.000000000 -0500
+++ fsf-branch/gcc/config/alpha/t-vms64	2006-11-24 17:35:54.000000000 -0500
@@ -1,8 +1,8 @@
 # Assemble startup files.
-vcrt0.o: $(CRT0_S) $(GCC_PASSES)
+$(T)vcrt0.o: $(CRT0_S) $(GCC_PASSES)
 	decc -c /names=as_is /pointer_size=64  \
-	     $(srcdir)/config/alpha/vms-crt0-64.c -o vcrt0.o
+	     $(srcdir)/config/alpha/vms-crt0-64.c -o $(T)vcrt0.o
-pcrt0.o: $(CRT0_S) $(GCC_PASSES)
+$(T)pcrt0.o: $(CRT0_S) $(GCC_PASSES)
 	decc -c /names=as_is /pointer_size=64 \
-	     $(srcdir)/config/alpha/vms-psxcrt0-64.c -o pcrt0.o
+	     $(srcdir)/config/alpha/vms-psxcrt0-64.c -o $(T)pcrt0.o
diff -ur trunk/gcc/config/fr30/t-fr30 fsf-branch/gcc/config/fr30/t-fr30
--- trunk/gcc/config/fr30/t-fr30	2006-11-25 11:26:14.000000000 -0500
+++ fsf-branch/gcc/config/fr30/t-fr30	2006-11-24 17:36:22.000000000 -0500
@@ -2,11 +2,11 @@
 LIB1ASMFUNCS  = _udivsi3 _divsi3 _umodsi3 _modsi3
 # Assemble startup files.
-crti.o: $(srcdir)/config/fr30/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o crti.o -x assembler $(srcdir)/config/fr30/crti.asm
+$(T)crti.o: $(srcdir)/config/fr30/crti.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -c -o $(T)crti.o -x assembler $(srcdir)/config/fr30/crti.asm
-crtn.o: $(srcdir)/config/fr30/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o crtn.o -x assembler $(srcdir)/config/fr30/crtn.asm
+$(T)crtn.o: $(srcdir)/config/fr30/crtn.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -c -o $(T)crtn.o -x assembler $(srcdir)/config/fr30/crtn.asm
 # We want fine grained libraries, so use the new code to build the
 # floating point emulation libraries.
diff -ur trunk/gcc/config/i386/t-rtems-i386 fsf-branch/gcc/config/i386/t-rtems-i386
--- trunk/gcc/config/i386/t-rtems-i386	2006-11-25 11:26:15.000000000 -0500
+++ fsf-branch/gcc/config/i386/t-rtems-i386	2006-11-24 17:36:04.000000000 -0500
@@ -5,12 +5,12 @@
 # version of these files.
-crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
+$(T)crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s
-	$(GCC_FOR_TARGET) -c -o crti.o crti.s
-crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -c -o $(T)crti.o crti.s
+$(T)crtn.o: $(srcdir)/config/i386/sol2-cn.asm $(GCC_PASSES)
 	sed -e '/^!/d' <$(srcdir)/config/i386/sol2-cn.asm >crtn.s
-	$(GCC_FOR_TARGET) -c -o crtn.o crtn.s
+	$(GCC_FOR_TARGET) -c -o $(T)crtn.o crtn.s
 # We want fine grained libraries, so use the new code to build the
 # floating point emulation libraries.
diff -ur trunk/gcc/config/ia64/t-ia64 fsf-branch/gcc/config/ia64/t-ia64
--- trunk/gcc/config/ia64/t-ia64	2006-11-25 11:26:16.000000000 -0500
+++ fsf-branch/gcc/config/ia64/t-ia64	2006-11-24 18:50:48.000000000 -0500
@@ -24,21 +24,21 @@
 T = disable
 # Assemble startup files.
-crtbegin.o: $(srcdir)/config/ia64/crtbegin.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -I. -c -o crtbegin.o -x assembler-with-cpp \
+$(T)crtbegin.o: $(srcdir)/config/ia64/crtbegin.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -I. -c -o $(T)crtbegin.o -x assembler-with-cpp \
-crtend.o: $(srcdir)/config/ia64/crtend.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -I. -c -o crtend.o -x assembler-with-cpp \
+$(T)crtend.o: $(srcdir)/config/ia64/crtend.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -I. -c -o $(T)crtend.o -x assembler-with-cpp \
-crtbeginS.o: $(srcdir)/config/ia64/crtbegin.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -I. -DSHARED -c -o crtbeginS.o \
+$(T)crtbeginS.o: $(srcdir)/config/ia64/crtbegin.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -I. -DSHARED -c -o $(T)crtbeginS.o \
 		-x assembler-with-cpp \
-crtendS.o: $(srcdir)/config/ia64/crtend.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -I. -DSHARED -c -o crtendS.o -x assembler-with-cpp \
+$(T)crtendS.o: $(srcdir)/config/ia64/crtend.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -I. -DSHARED -c -o $(T)crtendS.o -x assembler-with-cpp \
-crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o crtfastmath.o \
+$(T)crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES)
+	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o $(T)crtfastmath.o \
 LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
diff -ur trunk/gcc/config/rs6000/t-beos fsf-branch/gcc/config/rs6000/t-beos
--- trunk/gcc/config/rs6000/t-beos	2006-11-25 11:26:19.000000000 -0500
+++ fsf-branch/gcc/config/rs6000/t-beos	2006-11-24 17:36:07.000000000 -0500
@@ -25,6 +25,6 @@
 # Aix 3.2.x needs milli.exp for -mcpu=common
 EXTRA_PARTS = milli.exp
-milli.exp: $(srcdir)/config/rs6000/milli.exp
-	rm -f milli.exp
-	cp $(srcdir)/config/rs6000/milli.exp ./milli.exp
+$(T)milli.exp: $(srcdir)/config/rs6000/milli.exp
+	rm -f $(T)milli.exp
+	cp $(srcdir)/config/rs6000/milli.exp $(T)milli.exp
diff -ur trunk/gcc/config/rs6000/t-newas fsf-branch/gcc/config/rs6000/t-newas
--- trunk/gcc/config/rs6000/t-newas	2006-11-25 11:26:19.000000000 -0500
+++ fsf-branch/gcc/config/rs6000/t-newas	2006-12-16 16:56:56.000000000 -0500
@@ -32,6 +32,6 @@
 # Aix 3.2.x needs milli.exp for -mcpu=common
 EXTRA_PARTS = milli.exp
-milli.exp: $(srcdir)/config/rs6000/milli.exp
-	rm -f milli.exp
-	cp $(srcdir)/config/rs6000/milli.exp ./milli.exp
+$(T)milli.exp: $(srcdir)/config/rs6000/milli.exp
+	rm -f $(T)milli.exp
+	cp $(srcdir)/config/rs6000/milli.exp $(T)milli.exp
diff -ur trunk/gcc/config/sparc/t-elf fsf-branch/gcc/config/sparc/t-elf
--- trunk/gcc/config/sparc/t-elf	2006-11-25 11:26:21.000000000 -0500
+++ fsf-branch/gcc/config/sparc/t-elf	2006-11-24 17:35:59.000000000 -0500
@@ -23,7 +23,7 @@
 INSTALL_LIBGCC = install-multilib
 # Assemble startup files.
-crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
-crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm
+$(T)crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-ci.asm
+$(T)crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
+	$(GCC_FOR_TARGET) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sparc/sol2-cn.asm

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