Fix undefined weak symbol reloc tests
[platform/upstream/binutils.git] / Makefile.tpl
index f2c3f48..54a8dc3 100644 (file)
@@ -169,7 +169,7 @@ BUILD_EXPORTS = \
        WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
 
 # These variables must be set on the make command line for directories
-# built for the build system to override those in BASE_FLAGS_TO_PASSS.
+# built for the build system to override those in BASE_FLAGS_TO_PASS.
 EXTRA_BUILD_FLAGS = \
        CFLAGS="$(CFLAGS_FOR_BUILD)" \
        LDFLAGS="$(LDFLAGS_FOR_BUILD)"
@@ -238,13 +238,13 @@ POSTSTAGE1_CXX_EXPORT = \
 @if target-libstdc++-v3-bootstrap
 # Override the above if we're bootstrapping C++.
 POSTSTAGE1_CXX_EXPORT = \
-       CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/g++$(exeext) \
+       CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xg++$(exeext) \
          -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
          -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
          -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
-         -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-         -I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
-         -I$$s/libstdc++-v3/libsupc++ \
+         `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
+         `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
+         `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$s/libstdc++-v3/libsupc++ \
          -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
          -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
          export CXX; \
@@ -367,7 +367,7 @@ BUILD_PREFIX_1 = @BUILD_PREFIX_1@
 # here so that they can be overridden by Makefile fragments.
 BOOT_CFLAGS= -g -O2
 BOOT_LDFLAGS=
-BOOT_ADAFLAGS=-gnatpg -gnata
+BOOT_ADAFLAGS= -gnatpg
 
 AWK = @AWK@
 SED = @SED@
@@ -451,8 +451,10 @@ STAGE1_LANGUAGES = @stage1_languages@
 #   the last argument when conflicting --enable arguments are passed.
 # * Likewise, we force-disable coverage flags, since the installed
 #   compiler probably has never heard of them.
+# * We also disable -Wformat, since older GCCs don't understand newer %s.
 STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
-         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
+         --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
+         --disable-build-format-warnings
 
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
@@ -615,6 +617,12 @@ EXTRA_HOST_FLAGS = \
 
 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
 
+# Flags to pass to stage1 or when not bootstrapping.
+
+STAGE1_FLAGS_TO_PASS = \
+       LDFLAGS="$${LDFLAGS}" \
+       HOST_LIBS="$${HOST_LIBS}"
+
 # Flags to pass to stage2 and later makes.
 
 POSTSTAGE1_FLAGS_TO_PASS = \
@@ -1076,7 +1084,7 @@ all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELS
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        [+exports+] [+extra_exports+] \
        (cd [+subdir+]/[+module+] && \
-         $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
+         $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
                $(TARGET-[+prefix+][+module+]))
 @endif [+prefix+][+module+]
 
@@ -1109,9 +1117,8 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
                CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
                CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
                LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
-               [+args+] [+
-               IF prev +][+poststage1_args+][+ ENDIF prev
-               +] [+extra_make_flags+] \
+               [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
+               [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
                TFLAGS="$(STAGE[+id+]_TFLAGS)" \
                $(TARGET-stage[+id+]-[+prefix+][+module+])
 
@@ -1125,9 +1132,8 @@ clean-stage[+id+]-[+prefix+][+module+]:
          $(MAKE) stage[+id+]-start; \
        fi; \
        cd [+subdir+]/[+module+] && \
-       $(MAKE) [+args+] [+ IF prev +] \
-               [+poststage1_args+] [+ ENDIF prev +] \
-               [+extra_make_flags+] clean
+       $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
+       [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
 @endif [+prefix+][+module+]-bootstrap
 
 [+ ENDFOR bootstrap_stage +]
@@ -1162,6 +1168,7 @@ clean-stage[+id+]-[+prefix+][+module+]:
        exports="$(HOST_EXPORTS)"
        poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
        args="$(EXTRA_HOST_FLAGS)"
+       stage1_args="$(STAGE1_FLAGS_TO_PASS)"
        poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
 
 .PHONY: check-[+module+] maybe-check-[+module+]
@@ -1399,13 +1406,6 @@ ENDIF raw_cxx +]
 [+ ENDFOR recursive_targets +]
 [+ ENDFOR target_modules +]
 
-@if target-libmudflap
-.PHONY: check-target-libmudflap-c++
-check-target-libmudflap-c++:
-       $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++frags.exp" check-target-libmudflap
-
-@endif target-libmudflap
-
 @if target-libgomp
 .PHONY: check-target-libgomp-c++
 check-target-libgomp-c++: