public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC_FOR_TARGET x linker scripts
@ 2002-10-24 20:18 Alexandre Oliva
  2002-10-24 21:16 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2002-10-24 20:18 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

The top-level GCC_FOR_TARGET is set such that, if we're building GNU
ld, it contains -L$$r/ld, such that we find any linker scripts we
might need.

Unfortunately, the definition in gcc/Makefile.in doesn't ever search
that directory, so when running make bootstrap in the gcc
subdirectory, if we need linker scripts from the unified-build
directory, we don't find them.  There was also some condition that I
don't remember exactly that led me to conclude that we had to pass
GCC_FOR_TARGET down to sub-makes, otherwise the definition without
the ability to find linker scripts would supersede.  I wish I had
contributed this earlier, just when I found the need for it, but I had
forgotten about it.  My apologies.

Anyway, here's the patch, tested on mips-sgi-irix6.5 with GNU ld, only
to the point in which I verified that the right definition of
GCC_FOR_TARGET was being used for building target libraries in stage1
of a bootstrap, started from both the top level and from the gcc
sub-directory.  It was also fully tested in hundreds of bootstraps
that I ran after coming up with this patch.

I'm checking this in the 3.4-b-i-branch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gcc-for-target.patch --]
[-- Type: text/x-patch, Size: 1756 bytes --]

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.in (GCC_FOR_TARGET): Add -L$(objdir)/../ld.
	(STAGE2_FLAGS_TO_PASS): Pass GCC_FOR_TARGET.
	(stage1_build): Likewise.

Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.939.2.10
diff -u -p -r1.939.2.10 Makefile.in
--- gcc/Makefile.in 21 Oct 2002 17:51:50 -0000 1.939.2.10
+++ gcc/Makefile.in 25 Oct 2002 03:04:57 -0000
@@ -182,7 +182,7 @@ USER_H = $(srcdir)/ginclude/float.h \
 # The GCC to use for compiling libgcc.a and crt*.o.
 # Usually the one we just built.
 # Don't use this as a dependency--use $(GCC_PASSES) or $(GCC_PARTS).
-GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include
+GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld
 
 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
 # It omits XCFLAGS, and specifies -B./.
@@ -3314,6 +3314,7 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_O
 # the context of the stage_x rule.
 STAGE2_FLAGS_TO_PASS = \
 	ADAC="\$$(CC)" \
+	GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 	CFLAGS="$(BOOT_CFLAGS)" \
 	LDFLAGS="$(BOOT_LDFLAGS)" \
 	WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
@@ -3331,6 +3332,7 @@ STAGE2_FLAGS_TO_PASS = \
 stage1_build:
 	$(MAKE) CC="$(CC)" libdir=$(libdir) LANGUAGES="$(BOOT_LANGUAGES)" \
 		CFLAGS="$(STAGE1_CFLAGS)" MAKEINFO="$(MAKEINFO)" \
+		GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
 		MAKEINFOFLAGS="$(MAKEINFOFLAGS)" COVERAGE_FLAGS=
 	$(STAMP) stage1_build
 	echo stage1_build > stage_last

[-- Attachment #3: Type: text/plain, Size: 289 bytes --]


-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-11-06 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-24 20:18 GCC_FOR_TARGET x linker scripts Alexandre Oliva
2002-10-24 21:16 ` Daniel Jacobowitz
2002-10-24 21:23   ` Alexandre Oliva
2002-10-28 12:37     ` Pass FLAGS_FOR_TARGET to subdirectories (was: Re: GCC_FOR_TARGET x linker scripts) Daniel Jacobowitz
2002-10-28 20:01       ` Daniel Jacobowitz
2002-11-06 10:16       ` Alexandre Oliva
2002-11-06 11:25         ` Daniel Jacobowitz
2002-11-06 12:51           ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).