aboutsummaryrefslogtreecommitdiff
path: root/Makefile.tpl
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-05-29 12:43:42 +0100
committerNick Clifton <nickc@redhat.com>2019-05-29 12:43:42 +0100
commitf948b2de97884bfb4e5fc11d40a6bea9e0b096ae (patch)
treef0d2e00f2027a9eb292be6d751cfb8c02c4a46de /Makefile.tpl
parent90bd54236cb8b1c31c3662977159be971044c20d (diff)
downloadfsf-binutils-gdb-f948b2de97884bfb4e5fc11d40a6bea9e0b096ae.zip
fsf-binutils-gdb-f948b2de97884bfb4e5fc11d40a6bea9e0b096ae.tar.gz
fsf-binutils-gdb-f948b2de97884bfb4e5fc11d40a6bea9e0b096ae.tar.bz2
Sync top level files with versions from gcc.
top * Makefile.def (target_modules): Add libphobos. (flags_to_pass): Add GDC, GDCFLAGS, GDC_FOR_TARGET and GDCFLAGS_FOR_TARGET. (dependencies): Make libphobos depend on libatomic, libbacktrace configure, and zlib configure. (language): Add language d. * Makefile.in: Rebuild. * Makefile.tpl (BUILD_EXPORTS): Add GDC and GDCFLAGS. (HOST_EXPORTS): Add GDC. (POSTSTAGE1_HOST_EXPORTS): Add GDC and GDC_FOR_BUILD. (BASE_TARGET_EXPORTS): Add GDC. (GDC_FOR_BUILD, GDC, GDCFLAGS): New variables. (GDC_FOR_TARGET, GDC_FLAGS_FOR_TARGET): New variables. (EXTRA_HOST_FLAGS): Add GDC. (STAGE1_FLAGS_TO_PASS): Add GDC. (EXTRA_TARGET_FLAGS): Add GDC and GDCFLAGS. * config-ml.in: Treat GDC and GDCFLAGS like other compiler/flag environment variables. * configure: Rebuild. * configure.ac: Add target-libphobos to target_libraries. Set and substitute GDC_FOR_BUILD and GDC_FOR_TARGET.
Diffstat (limited to 'Makefile.tpl')
-rw-r--r--Makefile.tpl54
1 files changed, 47 insertions, 7 deletions
diff --git a/Makefile.tpl b/Makefile.tpl
index 5b118a8..f42cabe 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -7,7 +7,7 @@ in
# Makefile for directory with subdirs to build.
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
# 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012, 2013, 2014, 2015, 2016, 2017
+# 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019
# Free Software Foundation
#
# This file is free software; you can redistribute it and/or modify
@@ -160,6 +160,8 @@ BUILD_EXPORTS = \
GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
GOC="$(GOC_FOR_BUILD)"; export GOC; \
GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
+ GDC="$(GDC_FOR_BUILD)"; export GDC; \
+ GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
LD="$(LD_FOR_BUILD)"; export LD; \
LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
@@ -196,6 +198,7 @@ HOST_EXPORTS = \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
GOC="$(GOC)"; export GOC; \
+ GDC="$(GDC)"; export GDC; \
AR="$(AR)"; export AR; \
AS="$(AS)"; export AS; \
CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -208,6 +211,7 @@ HOST_EXPORTS = \
WINDMC="$(WINDMC)"; export WINDMC; \
OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+ OTOOL="$(OTOOL)"; export OTOOL; \
READELF="$(READELF)"; export READELF; \
AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
@@ -216,6 +220,7 @@ HOST_EXPORTS = \
NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
+ OTOOL_FOR_TARGET="$(OTOOL_FOR_TARGET)"; export OTOOL_FOR_TARGET; \
RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -224,7 +229,6 @@ HOST_EXPORTS = \
GMPINC="$(HOST_GMPINC)"; export GMPINC; \
ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
ISLINC="$(HOST_ISLINC)"; export ISLINC; \
- ISLVER="$(HOST_ISLVER)"; export ISLVER; \
LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \
LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \
XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
@@ -261,6 +265,14 @@ POSTSTAGE1_HOST_EXPORTS = \
CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
$(POSTSTAGE1_CXX_EXPORT) \
$(LTO_EXPORTS) \
+ GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
+ -B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \
+ -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
+ -I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
+ -L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
+ -L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \
+ export GDC; \
+ GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
@@ -283,6 +295,7 @@ BASE_TARGET_EXPORTS = \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
+ GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
@@ -290,6 +303,7 @@ BASE_TARGET_EXPORTS = \
NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
+ OTOOL="$(OTOOL_FOR_TARGET)"; export OTOOL; \
RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
READELF="$(READELF_FOR_TARGET)"; export READELF; \
STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
@@ -317,7 +331,6 @@ HOST_GMPINC = @gmpinc@
# Where to find isl
HOST_ISLLIBS = @isllibs@
HOST_ISLINC = @islinc@
-HOST_ISLVER = @islver@
# Where to find libelf
HOST_LIBELFLIBS = @libelflibs@
@@ -348,6 +361,7 @@ CXX_FOR_BUILD = @CXX_FOR_BUILD@
DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
GOC_FOR_BUILD = @GOC_FOR_BUILD@
+GDC_FOR_BUILD = @GDC_FOR_BUILD@
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
LD_FOR_BUILD = @LD_FOR_BUILD@
NM_FOR_BUILD = @NM_FOR_BUILD@
@@ -377,7 +391,7 @@ MAKEINFO = @MAKEINFO@
EXPECT = @EXPECT@
RUNTEST = @RUNTEST@
-AUTO_PROFILE = gcc-auto-profile -c 1000000
+AUTO_PROFILE = gcc-auto-profile -c 10000000
# This just becomes part of the MAKEINFO definition passed down to
# sub-makes. It lets flags be given on the command line while still
@@ -399,12 +413,14 @@ LD = @LD@
LIPO = @LIPO@
NM = @NM@
OBJDUMP = @OBJDUMP@
+OTOOL = @OTOOL@
RANLIB = @RANLIB@
READELF = @READELF@
STRIP = @STRIP@
WINDRES = @WINDRES@
WINDMC = @WINDMC@
+GDC = @GDC@
GNATBIND = @GNATBIND@
GNATMAKE = @GNATMAKE@
@@ -414,6 +430,7 @@ LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
GOCFLAGS = $(CFLAGS)
+GDCFLAGS = $(CFLAGS)
CREATE_GCOV = create_gcov
@@ -455,11 +472,24 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
--disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
--disable-build-format-warnings
+# When using the slow stage1 compiler disable IL verification and forcefully
+# enable it when using the stage2 compiler instead. As we later compare
+# stage2 and stage3 we are merely avoid doing redundant work, plus we apply
+# checking when building all target libraries for release builds.
+STAGE1_TFLAGS += -fno-checking
+STAGE2_CFLAGS += -fno-checking
+STAGE2_TFLAGS += -fno-checking
+STAGE3_CFLAGS += -fchecking=1
+STAGE3_TFLAGS += -fchecking=1
+
STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
-STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
-STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
+STAGEtrain_CFLAGS = $(filter-out -fchecking=1,$(STAGE3_CFLAGS))
+STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
+
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
@@ -487,6 +517,7 @@ CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
+GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
LD_FOR_TARGET=@LD_FOR_TARGET@
@@ -494,6 +525,7 @@ LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
NM_FOR_TARGET=@NM_FOR_TARGET@
OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
+OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@
RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
READELF_FOR_TARGET=@READELF_FOR_TARGET@
STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
@@ -511,6 +543,7 @@ LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
GOCFLAGS_FOR_TARGET = -O2 -g
+GDCFLAGS_FOR_TARGET = -O2 -g
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
@@ -592,6 +625,7 @@ BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
"[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
"STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
"STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
+ "STAGE[+id+]_GENERATOR_CFLAGS=$(STAGE[+id+]_GENERATOR_CFLAGS)" \
"STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
$(CXX_FOR_TARGET_FLAG_TO_PASS) \
"TFLAGS=$(TFLAGS)" \
@@ -612,10 +646,12 @@ EXTRA_HOST_FLAGS = \
'DLLTOOL=$(DLLTOOL)' \
'GFORTRAN=$(GFORTRAN)' \
'GOC=$(GOC)' \
+ 'GDC=$(GDC)' \
'LD=$(LD)' \
'LIPO=$(LIPO)' \
'NM=$(NM)' \
'OBJDUMP=$(OBJDUMP)' \
+ 'OTOOL=$(OTOOL)' \
'RANLIB=$(RANLIB)' \
'READELF=$(READELF)' \
'STRIP=$(STRIP)' \
@@ -636,6 +672,7 @@ STAGE1_FLAGS_TO_PASS = \
POSTSTAGE1_FLAGS_TO_PASS = \
CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
+ GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
GNATBIND="$${GNATBIND}" \
LDFLAGS="$${LDFLAGS}" \
HOST_LIBS="$${HOST_LIBS}" \
@@ -668,6 +705,8 @@ EXTRA_TARGET_FLAGS = \
'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
+ 'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
'LD=$(COMPILER_LD_FOR_TARGET)' \
'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
@@ -1156,6 +1195,7 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
CFLAGS="$(STAGE[+id+]_CFLAGS)" \
+ GENERATOR_CFLAGS="$(STAGE[+id+]_GENERATOR_CFLAGS)" \
CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \
LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
@@ -1638,7 +1678,7 @@ do-clean: clean-stage[+id+]
sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
files=`find stage[+id+]-* -name "*$(objext)" -print | \
sed -n s,^stage$$sed-,,p`; \
- for file in $${files}; do \
+ for file in $${files} ${extra-compare}; do \
f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
if test ! -f $$f1; then continue; fi; \
$(do-[+compare-target+]) > /dev/null 2>&1; \