Makefile.in (LINKER, [...]): Define.

./:	* Makefile.in (LINKER, LINKER_FLAGS): Define.
	(LINKER_FOR_BUILD, BUILD_LINKERFLAGS): Define.
	(ALL_LINKERFLAGS): Define.
	(xgcc$(exeext)): Change $(COMPILER) to $(LINKER).
	(cpp$(exeext), cc1-dummy$(exeext), cc1$(exeext)): Likewise.
	(collect2$(exeext), mips-tfile, mips-tdump): Likewise.
	(gcov$(exeext), gcov-dump$(exeext)): Likewise.
	(build/gen%$(build_exeext)): Change $(COMPILER_FOR_BUILD) to
	$(LINKER_FOR_BUILD).
	(build/gcov-iov$(build_exeext)): Likewise.
cp/:
	* Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
	(cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
fortran/:
	* Make-lang.in (gfortran$(exeext)): Change $(COMPILER) to
	$(LINKER).
	(f951$(exeext)): Likewise.
java/:
	* Make-lang.in ($(XGCJ)$(exeext)): Change $(COMPILER) to
	$(LINKER).
	(jc1$(exeext), jcf-dump$(exeext), jvgenmain$(exeext)): Likewise.
objc/:
	* Make-lang.in (cc1obj-dummy$(exeext)): Change $(COMPILER) to
	$(LINKER).
	(cc1obj$(exeext)): Likewise.
objcp/:
	* Make-lang.in (cc1objplus-dummy$(exeext)): Change $(COMPILER) to
	$(LINKER).
	(cc1objplus$(exeext)): Likewise.

From-SVN: r147927
This commit is contained in:
Ian Lance Taylor 2009-05-27 19:51:15 +00:00 committed by Ian Lance Taylor
parent 86c3c481e9
commit c607156f99
12 changed files with 75 additions and 24 deletions

View File

@ -1,3 +1,16 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Makefile.in (LINKER, LINKER_FLAGS): Define.
(LINKER_FOR_BUILD, BUILD_LINKERFLAGS): Define.
(ALL_LINKERFLAGS): Define.
(xgcc$(exeext)): Change $(COMPILER) to $(LINKER).
(cpp$(exeext), cc1-dummy$(exeext), cc1$(exeext)): Likewise.
(collect2$(exeext), mips-tfile, mips-tdump): Likewise.
(gcov$(exeext), gcov-dump$(exeext)): Likewise.
(build/gen%$(build_exeext)): Change $(COMPILER_FOR_BUILD) to
$(LINKER_FOR_BUILD).
(build/gcov-iov$(build_exeext)): Likewise.
2009-05-27 Julian Brown <julian@codesourcery.com>
* gcse.c (target.h): Include.

View File

@ -201,6 +201,8 @@ RANLIB_FLAGS = @ranlib_flags@
# future this may change to $(CXX).
COMPILER = $(CC)
COMPILER_FLAGS = $(CFLAGS)
LINKER = $(CC)
LINKER_FLAGS = $(CFLAGS)
# -------------------------------------------
# Programs which operate on the build machine
@ -707,6 +709,10 @@ BUILD_CFLAGS= @BUILD_CFLAGS@ -DGENERATOR_FILE
COMPILER_FOR_BUILD = $(CC_FOR_BUILD)
BUILD_COMPILERFLAGS = $(BUILD_CFLAGS)
# Native linker that we use.
LINKER_FOR_BUILD = $(CC_FOR_BUILD)
BUILD_LINKERFLAGS = $(BUILD_CFLAGS)
# Native linker and preprocessor flags. For x-fragment overrides.
BUILD_LDFLAGS=@BUILD_LDFLAGS@
BUILD_CPPFLAGS=$(ALL_CPPFLAGS)
@ -919,6 +925,9 @@ ALL_CPPFLAGS = $(INCLUDES) $(CPPFLAGS)
# This is the variable to use when using $(COMPILER).
ALL_COMPILERFLAGS = $(ALL_CFLAGS)
# This is the variable to use when using $(LINKER).
ALL_LINKERFLAGS = $(ALL_CFLAGS)
# Build and host support libraries.
LIBIBERTY = ../libiberty/libiberty.a
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
@ -1640,7 +1649,7 @@ libbackend.a: $(OBJS@onestep@)
# and CC is `gcc'. It is renamed to `gcc' when it is installed.
xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \
version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
gccspec.o intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
# cpp is to cpp0 as gcc is to cc1.
@ -1648,7 +1657,7 @@ xgcc$(exeext): $(GCC_OBJS) gccspec.o version.o intl.o prefix.o \
# instead of gccspec.o.
cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \
version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
cppspec.o intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
# Dump a specs file to make -B./ read these specs over installed ones.
@ -1665,7 +1674,7 @@ gcc-cross$(exeext): xgcc$(exeext)
dummy-checksum.o : dummy-checksum.c
cc1-dummy$(exeext): $(C_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
dummy-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(build_exeext)
@ -1674,7 +1683,7 @@ cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(build_exeext)
cc1-checksum.o : cc1-checksum.c
cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
cc1-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
#
@ -1891,7 +1900,7 @@ COLLECT2_OBJS = collect2.o tlink.o intl.o version.o
COLLECT2_LIBS = @COLLECT2_LIBS@
collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
# Don't try modifying collect2 (aka ld) in place--it might be linking this.
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o T$@ \
$(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS)
mv -f T$@ $@
@ -3119,14 +3128,14 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
# Build auxiliary files that support ecoff format.
mips-tfile: mips-tfile.o version.o $(LIBDEPS)
$(COMPILER) $(COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
mips-tfile.o version.o $(LIBS)
mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \
$(TM_H) version.h $(srcdir)/../include/getopt.h $(GSTAB_H) intl.h
mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(COMPILER) $(COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
mips-tdump.o version.o $(LIBS)
mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \
@ -3492,7 +3501,7 @@ build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
# As a general rule...
build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
$(COMPILER_FOR_BUILD) $(BUILD_COMPILERFLAGS) $(BUILD_LDFLAGS) -o $@ \
$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) -o $@ \
$(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
# All these programs use the MD reader ($(BUILD_RTL)).
@ -3550,7 +3559,7 @@ build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \
$(SYSTEM_H) coretypes.h $(TM_H)
build/gcov-iov$(build_exeext): build/gcov-iov.o
$(COMPILER_FOR_BUILD) $(BUILD_COMPILERFLAGS) $(BUILD_LDFLAGS) \
$(LINKER_FOR_BUILD) $(BUILD_LINKERFLAGS) $(BUILD_LDFLAGS) \
build/gcov-iov.o -o $@
gcov-iov.h: s-iov
@ -3567,10 +3576,10 @@ gcov-dump.o: gcov-dump.c gcov-io.c $(GCOV_IO_H) $(SYSTEM_H) coretypes.h \
GCOV_OBJS = gcov.o intl.o version.o errors.o
gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o
gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
$(LIBS) -o $@
#
# Build the include directories. The stamp files are stmp-* rather than

View File

@ -1,3 +1,8 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
(cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
2009-05-26 Ian Lance Taylor <iant@google.com>
* Make-lang.in (g++spec.o): Use $(COMPILER).

View File

@ -60,7 +60,7 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CON
# Create the compiler driver for g++.
GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o
g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
@ -92,7 +92,7 @@ c++_OBJS = $(CXX_OBJS) dummy-checksum.o cc1plus-checksum.o cp/g++spec.o
cp-warn = $(STRICT_WARN)
cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext)
@ -101,7 +101,7 @@ cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(build_exeext)
cc1plus-checksum.o : cc1plus-checksum.c
cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
# Special build rules.

View File

@ -1,3 +1,9 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Make-lang.in (gfortran$(exeext)): Change $(COMPILER) to
$(LINKER).
(f951$(exeext)): Likewise.
2009-05-27 Tobias Burnus <burnus@net-b.de>
PR fortran/40270

View File

@ -86,7 +86,7 @@ gfortranspec.o: $(srcdir)/fortran/gfortranspec.c $(SYSTEM_H) $(TM_H) $(GCC_H) \
# Create the compiler driver gfortran.
GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o version.o prefix.o intl.o
gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
# Create a version of the gfortran driver which calls the cross-compiler.
@ -97,7 +97,7 @@ gfortran-cross$(exeext): gfortran$(exeext)
# The compiler itself is called f951.
f951$(exeext): $(F95_OBJS) \
$(BACKEND) $(LIBDEPS) attribs.o
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(F95_OBJS) $(BACKEND) $(LIBS) attribs.o $(BACKENDLIBS)
gt-fortran-trans.h : s-gtype; @true

View File

@ -1,3 +1,9 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Make-lang.in ($(XGCJ)$(exeext)): Change $(COMPILER) to
$(LINKER).
(jc1$(exeext), jcf-dump$(exeext), jvgenmain$(exeext)): Likewise.
2009-05-26 Ian Lance Taylor <iant@google.com>
* Make-lang.in (jvspec.o): Use $(COMPILER).

View File

@ -65,7 +65,7 @@ jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) coretypes.h $(TM_H) \
# Create the compiler driver for $(XGCJ).
$(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o version.o \
prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
jvspec.o java/jcf-path.o prefix.o intl.o \
version.o $(EXTRA_GCC_OBJS) $(LIBS)
@ -100,17 +100,17 @@ jvspec.o-warn = -Wno-error
jc1$(exeext): $(JAVA_OBJS) $(BACKEND) $(LIBDEPS) attribs.o
rm -f $@
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(JAVA_OBJS) $(BACKEND) $(ZLIB) $(LIBICONV) $(LIBS) attribs.o $(BACKENDLIBS)
jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS)
rm -f $@
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
$(CPPLIBS) $(ZLIB) $(LDEXP_LIB) $(LIBS)
jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
rm -f $@
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(JVGENMAIN_OBJS) \
$(LIBS)
#

View File

@ -1,3 +1,9 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Make-lang.in (cc1obj-dummy$(exeext)): Change $(COMPILER) to
$(LINKER).
(cc1obj$(exeext)): Likewise.
2009-05-26 Ian Lance Taylor <iant@google.com>
* Make-lang.in (cc1obj-dummy$(exeext)): Use $(COMPILER).

View File

@ -52,7 +52,7 @@ OBJC_OBJS = objc/objc-lang.o objc/objc-act.o
objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o \
$(BACKEND) $(LIBS) $(BACKENDLIBS)
@ -62,7 +62,7 @@ cc1obj-checksum.c : cc1obj-dummy$(exeext) build/genchecksum$(build_exeext)
cc1obj-checksum.o : cc1obj-checksum.c
cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \
$(BACKEND) $(LIBS) $(BACKENDLIBS)

View File

@ -1,3 +1,9 @@
2009-05-27 Ian Lance Taylor <iant@google.com>
* Make-lang.in (cc1objplus-dummy$(exeext)): Change $(COMPILER) to
$(LINKER).
(cc1objplus$(exeext)): Likewise.
2009-05-26 Ian Lance Taylor <iant@google.com>
* Make-lang.in (cc1objplus-dummy$(exeext)): Use $(COMPILER).

View File

@ -55,7 +55,7 @@ obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o
cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \
$(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
cc1objplus-checksum.c : cc1objplus-dummy$(exeext) build/genchecksum$(build_exeext)
@ -64,7 +64,7 @@ cc1objplus-checksum.c : cc1objplus-dummy$(exeext) build/genchecksum$(build_exeex
cc1objplus-checksum.o : cc1objplus-checksum.c
cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS)
$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o $@ \
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
$(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
# Objective C++ language specific files.