diff mbox

[3/3] Add make autoprofiledbootstrap

Message ID 20160624183602.GH7387@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek June 24, 2016, 6:36 p.m. UTC
On Wed, Jun 22, 2016 at 05:37:06AM -0700, Andi Kleen wrote:
> gcc/cp/:
> 
> 2016-06-22  Andi Kleen  <ak@linux.intel.com>
> 
> 	* Make-lang.in: Add support for autofdo.

...

This results in annoying errors in stderr each time make is
performed in non-bootstrapped build (3 times even for each case).

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2016-06-24  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in: Don't cat ../stage_current if it does not exist.
c/
	* Make-lang.in: Don't cat ../stage_current if it does not exist.
cp/
	* Make-lang.in: Don't cat ../stage_current if it does not exist.
lto/
	* Make-lang.in: Don't cat ../stage_current if it does not exist.



	Jakub

Comments

Andi Kleen June 24, 2016, 8:56 p.m. UTC | #1
> This results in annoying errors in stderr each time make is
> performed in non-bootstrapped build (3 times even for each case).
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

Looks good to me, thanks.

-Andi
diff mbox

Patch

--- gcc/Makefile.in.jj	2016-06-24 12:59:28.000000000 +0200
+++ gcc/Makefile.in	2016-06-24 14:44:35.861407698 +0200
@@ -1569,7 +1569,8 @@  ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OB
 
 # for anything that is shared use the cc1plus profile data, as that
 # is likely the most exercised during the build
-ifeq ($(shell cat ../stage_current),stageautofeedback)
+ifeq ($(if $(wildcard ../stage_current),$(shell cat \
+  ../stage_current)),stageautofeedback)
 $(ALL_HOST_BACKEND_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1plus.fda
 $(ALL_HOST_BACKEND_OBJS): cc1plus.fda
 endif
--- gcc/c/Make-lang.in.jj	2016-06-24 12:59:22.000000000 +0200
+++ gcc/c/Make-lang.in	2016-06-24 14:45:57.115410249 +0200
@@ -60,7 +60,8 @@  c_OBJS = $(C_OBJS) cc1-checksum.o c/gccs
 # Use strict warnings for this front end.
 c-warn = $(STRICT_WARN)
 
-ifeq ($(shell cat ../stage_current),stageautofeedback)
+ifeq ($(if $(wildcard ../stage_current),$(shell cat \
+  ../stage_current)),stageautofeedback)
 $(C_OBJS): ALL_COMPILERFLAGS += -fauto-profile=cc1.fda
 $(C_OBJS): cc1.fda
 endif
--- gcc/cp/Make-lang.in.jj	2016-06-24 12:59:22.000000000 +0200
+++ gcc/cp/Make-lang.in	2016-06-24 14:46:26.392050859 +0200
@@ -81,7 +81,8 @@  CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.
  cp/vtable-class-hierarchy.o cp/constexpr.o cp/cp-ubsan.o \
  cp/constraint.o cp/logic.o $(CXX_C_OBJS)
 
-ifeq ($(shell cat ../stage_current),stageautofeedback)
+ifeq ($(if $(wildcard ../stage_current),$(shell cat \
+  ../stage_current)),stageautofeedback)
 $(CXX_AND_OBJCXX_OBJS): CFLAGS += -fauto-profile=cc1plus.fda
 $(CXX_AND_OBJCXX_OBJS): cc1plus.fda
 endif
--- gcc/lto/Make-lang.in.jj	2016-06-24 12:59:27.000000000 +0200
+++ gcc/lto/Make-lang.in	2016-06-24 14:47:04.387584437 +0200
@@ -29,7 +29,8 @@  lto_OBJS = $(LTO_OBJS)
 # now. Should reenable after this is fixed, but only when LTO bootstrap
 # is enabled.
 
-#ifeq ($(shell cat ../stage_current),stageautofeedback)
+#ifeq ($(if $(wildcard ../stage_current),$(shell cat \
+#  ../stage_current)),stageautofeedback)
 #$(LTO_OBJS): CFLAGS += -fauto-profile=lto1.fda
 #$(LTO_OBJS): lto1.fda
 #endif