@@ -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
@@ -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
@@ -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
@@ -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