[PATCH 15/45] Add TFLAGS to gcc's GCC_FOR_TARGET
Arsen Arsenović
arsen@aarsen.me
Mon Aug 7 11:07:18 GMT 2023
From: Alexandre Oliva <oliva@adacore.com>
When the GCC build runs GCC_FOR_TARGET, e.g. for selftests or for
dumping specs, it doesn't use TFLAGS in non-bootstrap scenarios. This
patch arranges for TFLAGS to be passed from the top level down to gcc
in GCC_FOR_TARGET in this case.
Another issue related with TFLAGS fixed herein is that there's no easy
way to add a TFLAGS to GCC_FOR_TARGET when running "make gnatlib"
within the gcc directory. Overriding all of GCC_FOR_TARGET is
somewhat cumbersome, so I'm adding TFLAGS support to gcc/Makefile.in,
getting it added to GCC_FOR_TARGET, as it would when passed down from
the top level.
for ChangeLog
* Makefile.tpl (HOST_EXPORTS): Add TFLAGS to GCC_FOR_TARGET.
(EXTRA_GCC_FLAGS): Likewise.
* Makefile.in: Rebuilt.
---
Makefile.in | 4 ++--
Makefile.tpl | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 7453d4ea0c2..c4e679d386e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -223,7 +223,7 @@ HOST_EXPORTS = \
AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL_FOR_TARGET; \
- GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
+ GCC_FOR_TARGET="$(GCC_FOR_TARGET) $$TFLAGS"; export GCC_FOR_TARGET; \
LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
@@ -1038,7 +1038,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
# The BUILD_* variables are a special case, which are used for the gcc
# cross-building scheme.
EXTRA_GCC_FLAGS = \
- "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
+ "GCC_FOR_TARGET=$(GCC_FOR_TARGET) $$TFLAGS" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
diff --git a/Makefile.tpl b/Makefile.tpl
index 88db8f44d53..54faca6fbac 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -226,7 +226,7 @@ HOST_EXPORTS = \
AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL_FOR_TARGET; \
- GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
+ GCC_FOR_TARGET="$(GCC_FOR_TARGET) $$TFLAGS"; export GCC_FOR_TARGET; \
LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
@@ -796,7 +796,7 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
# The BUILD_* variables are a special case, which are used for the gcc
# cross-building scheme.
EXTRA_GCC_FLAGS = \
- "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
+ "GCC_FOR_TARGET=$(GCC_FOR_TARGET) $$TFLAGS" \
"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
--
2.41.0
More information about the Gdb-patches
mailing list