]> gcc.gnu.org Git - gcc.git/blobdiff - Makefile.tpl
Daily bump.
[gcc.git] / Makefile.tpl
index 213052f82267b7d4d058b92b1d1992b88591aefe..ef58fac2b9a8b38a990371f2619c04a3c1c5a9d4 100644 (file)
@@ -276,11 +276,14 @@ POSTSTAGE1_HOST_EXPORTS = \
        $(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$(build_tooldir)/bin/ $(GDCFLAGS_FOR_TARGET) \
+         -B$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/gcc \
          -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
+         -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
          -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"; \
+         -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+         -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; \
        export GDC; \
        GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
        GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
@@ -447,6 +450,49 @@ LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
 GOCFLAGS = $(CFLAGS)
 GDCFLAGS = $(CFLAGS)
 
+# Pass additional PGO and LTO compiler options to the PGO build.
+BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
+override CFLAGS += $(BUILD_CFLAGS)
+override CXXFLAGS += $(BUILD_CFLAGS)
+
+# Additional PGO and LTO compiler options to generate profiling data
+# for the PGO build.
+PGO_BUILD_GEN_FLAGS_TO_PASS = \
+       PGO_BUILD_CFLAGS="@PGO_BUILD_GEN_CFLAGS@" \
+       PGO_BUILD_LTO_CFLAGS="@PGO_BUILD_LTO_CFLAGS@"
+
+# NB: Filter out any compiler options which may fail PGO training runs.
+PGO_BUILD_TRAINING_CFLAGS:= \
+       $(filter-out -Werror=%,$(CFLAGS))
+PGO_BUILD_TRAINING_CXXFLAGS:=\
+       $(filter-out -Werror=%,$(CXXFLAGS))
+PGO_BUILD_TRAINING_CFLAGS:= \
+       $(filter-out -Wall,$(PGO_BUILD_TRAINING_CFLAGS))
+PGO_BUILD_TRAINING_CXXFLAGS:= \
+       $(filter-out -Wall,$(PGO_BUILD_TRAINING_CXXFLAGS))
+PGO_BUILD_TRAINING_CFLAGS:= \
+       $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CFLAGS))
+PGO_BUILD_TRAINING_CXXFLAGS:= \
+       $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CXXFLAGS))
+PGO_BUILD_TRAINING_FLAGS_TO_PASS = \
+       PGO_BUILD_TRAINING=yes \
+       CFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CFLAGS)" \
+       CXXFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CXXFLAGS)"
+
+# Ignore "make check" errors in PGO training runs.
+PGO_BUILD_TRAINING_MFLAGS = -i
+
+# Additional PGO and LTO compiler options to use profiling data for the
+# PGO build.
+PGO_BUILD_USE_FLAGS_TO_PASS = \
+       PGO_BUILD_CFLAGS="@PGO_BUILD_USE_CFLAGS@" \
+       PGO_BUILD_LTO_CFLAGS="@PGO_BUILD_LTO_CFLAGS@"
+
+# PGO training targets for the PGO build.  FIXME: Add gold tests to
+# training.
+PGO-TRAINING-TARGETS = binutils gas gdb ld sim
+PGO_BUILD_TRAINING = $(addprefix maybe-check-,$(PGO-TRAINING-TARGETS))
+
 CREATE_GCOV = create_gcov
 
 TFLAGS =
@@ -487,6 +533,11 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
          --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
          --disable-build-format-warnings
 
+@if target-libphobos-bootstrap
+STAGE1_CONFIGURE_FLAGS += --with-libphobos-druntime-only
+STAGE2_CONFIGURE_FLAGS += --with-libphobos-druntime-only
+@endif target-libphobos-bootstrap
+
 # 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
@@ -776,6 +827,12 @@ configure-target: [+
 
 # The target built for a native non-bootstrap build.
 .PHONY: all
+
+# --enable-pgo-build enables the PGO build.
+# 1. First build with -fprofile-generate.
+# 2. Use "make maybe-check-*" to generate profiling data.
+# 3. Use "make clean" to remove the previous build.
+# 4. Rebuild with -fprofile-use.
 all:
 @if gcc-bootstrap
        [ -f stage_final ] || echo stage3 > stage_final
@@ -784,7 +841,7 @@ all:
        $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
 @endif gcc-bootstrap
        @: $(MAKE); $(unstage)
-       @r=`${PWD_COMMAND}`; export r; \
+       +@r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 @if gcc-bootstrap
        if [ -f stage_last ]; then \
@@ -792,7 +849,17 @@ all:
          $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
        else \
 @endif gcc-bootstrap
-         $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target \
+         $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
+               $(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \
+@if pgo-build
+       && $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
+               $(PGO_BUILD_TRAINING_MFLAGS) \
+               $(PGO_BUILD_TRAINING_FLAGS_TO_PASS) \
+               $(PGO_BUILD_TRAINING) \
+       && $(MAKE) $(RECURSE_FLAGS_TO_PASS) clean \
+       && $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
+               $(PGO_BUILD_USE_FLAGS_TO_PASS) all-host all-target \
+@endif pgo-build
 @if gcc-bootstrap
            ; \
        fi \
This page took 0.031196 seconds and 5 git commands to generate.