X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=Makefile.tpl;h=efed1511750412f7dff03a363779b78c6ecccb41;hb=181652340b0ed4485111480306af855ec97e9c41;hp=1f23b79b4b2ab403e7e2f983a10a885de47175fb;hpb=5367a7284c4c072d62be3ebb0cac81359c4e6891;p=thirdparty%2Fgcc.git diff --git a/Makefile.tpl b/Makefile.tpl index 1f23b79b4b2a..efed15117504 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -159,6 +159,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; \ @@ -195,9 +197,11 @@ 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; \ + CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \ DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ LD="$(LD)"; export LD; \ LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \ @@ -207,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; \ @@ -215,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; \ @@ -259,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; @@ -281,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; \ @@ -288,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; \ @@ -345,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@ @@ -374,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 @@ -396,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@ @@ -411,6 +430,7 @@ LIBCFLAGS = $(CFLAGS) CXXFLAGS = @CXXFLAGS@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates GOCFLAGS = $(CFLAGS) +GDCFLAGS = $(CFLAGS) CREATE_GCOV = create_gcov @@ -452,11 +472,21 @@ 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) -STAGEtrain_CFLAGS = $(STAGE3_CFLAGS) -STAGEtrain_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) @@ -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 +] \ @@ -1460,6 +1500,10 @@ ENDIF raw_cxx +] check-target-libgomp-c++: $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp +.PHONY: check-target-libgomp-fortran +check-target-libgomp-fortran: + $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) fortran.exp" check-target-libgomp + @endif target-libgomp @if target-libitm @@ -1634,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; \ @@ -1718,8 +1762,8 @@ stageprofile-end:: stagefeedback-start:: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - for i in stageprofile-*; do \ - j=`echo $$i | sed s/^stageprofile-//`; \ + for i in prev-*; do \ + j=`echo $$i | sed s/^prev-//`; \ cd $$r/$$i && \ { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \ { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \ @@ -1814,25 +1858,46 @@ configure-target-[+module+]: maybe-all-gcc[+ (define dep-maybe (lambda () (if (exist? "hard") "" "maybe-"))) - ;; dep-kind returns "normal" if the dependency is on an "install" target, - ;; or if either module is not bootstrapped. It returns "bootstrap" for - ;; configure or build dependencies between bootstrapped modules; it returns - ;; "prebootstrap" for configure or build dependencies of bootstrapped - ;; modules on a build module (e.g. all-gcc on all-build-bison). All this - ;; is only necessary for host modules. + ;; dep-kind returns returns "prebootstrap" for configure or build + ;; dependencies of bootstrapped modules on a build module + ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is + ;; on an "install" target, or if the dependence module is not + ;; bootstrapped; otherwise, it returns "bootstrap" or + ;; "postbootstrap" depending on whether the dependent module is + ;; bootstrapped. All this is only necessary for host and target + ;; modules. It might seem like, in order to avoid build races, we + ;; might need more elaborate detection between prebootstrap and + ;; postbootstrap modules, but there are no host prebootstrap + ;; modules. If there were any non-bootstrap host modules that + ;; bootstrap modules depended on, we'd get unsatisfied per-stage + ;; dependencies on them, which would be immediately noticed. (define dep-kind (lambda () - (if (and (hash-ref boot-modules (dep-module "module")) - (=* (dep-module "on") "build-")) - "prebootstrap" + (cond + ((and (hash-ref boot-modules (dep-module "module")) + (=* (dep-module "on") "build-")) + "prebootstrap") + + ((or (= (dep-subtarget "on") "install-") + (not (hash-ref boot-modules (dep-module "on")))) + "normal") + + ((hash-ref boot-modules (dep-module "module")) + "bootstrap") - (if (or (= (dep-subtarget "on") "install-") - (not (hash-ref boot-modules (dep-module "module"))) - (not (hash-ref boot-modules (dep-module "on")))) - "normal" - "bootstrap")))) + (1 "postbootstrap")))) + + (define make-postboot-dep (lambda () + (let ((target (dep-module "module")) (dep "stage_last")) + (unless (= (hash-ref postboot-targets target) dep) + (hash-create-handle! postboot-targets target dep) + ;; All non-bootstrap modules' configure target already + ;; depend on dep. + (unless (=* target "target-") + (string-append "configure-" target ": " dep "\n")))))) ;; We now build the hash table that is used by dep-kind. (define boot-modules (make-hash-table 113)) + (define postboot-targets (make-hash-table 113)) +] [+ FOR host_modules +][+ @@ -1849,18 +1914,23 @@ configure-target-[+module+]: maybe-all-gcc[+ # to check for bootstrap/prebootstrap dependencies. To resolve # prebootstrap dependencies, prebootstrap modules are gathered in # a hash table. -[+ FOR dependencies +][+ (make-dep "" "") +] -[+ CASE (dep-kind) +] -[+ == "prebootstrap" - +][+ FOR bootstrap_stage +] -[+ (make-dep (dep-stage) "") +][+ - ENDFOR bootstrap_stage +] -[+ == "bootstrap" - +][+ FOR bootstrap_stage +] -[+ (make-dep (dep-stage) (dep-stage)) +][+ - ENDFOR bootstrap_stage +] -[+ ESAC +][+ -ENDFOR dependencies +] +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +] +[+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +] +[+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +] +[+ == "normal" +][+ (make-dep "" "") +] +[+ ESAC +][+ ENDFOR dependencies +] + +@if gcc-bootstrap +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+ +ENDFOR dependencies +]@endif gcc-bootstrap + +@unless gcc-bootstrap +[+ FOR dependencies +][+ CASE (dep-kind) +] +[+ == "postbootstrap" +][+ (make-dep "" "") +] +[+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap # Dependencies for target modules on other target modules are # described by lang_env_dependencies; the defaults apply to anything