public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] Add TFLAGS to gcc's GCC_FOR_TARGET Date: Fri, 20 May 2022 14:39:23 +0000 (GMT) [thread overview] Message-ID: <20220520143923.E8412383601E@sourceware.org> (raw) https://gcc.gnu.org/g:fd04baba59c3ac6755651ac1155a976be4809bfc commit fd04baba59c3ac6755651ac1155a976be4809bfc Author: Alexandre Oliva <oliva@adacore.com> Date: Fri May 20 11:21:22 2022 -0300 Add TFLAGS to gcc's GCC_FOR_TARGET 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. for gcc/ChangeLog * Makefile.in (TFLAGS): New. (GCC_FOR_TARGET): Add TFLAGS. (FLAGS_TO_PASS): Pass TFLAGS down. Diff: --- Makefile.in | 4 ++-- Makefile.tpl | 4 ++-- gcc/Makefile.in | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index 593495e1650..13ee95a2602 100644 --- a/Makefile.in +++ b/Makefile.in @@ -222,7 +222,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; \ @@ -1047,7 +1047,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 ef58fac2b9a..ba0727153a9 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -225,7 +225,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; \ @@ -801,7 +801,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/gcc/Makefile.in b/gcc/Makefile.in index 97e5450ecb5..27ac641270f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -146,8 +146,11 @@ endif # CFLAGS is for the user to override to, e.g., do a cross build with -O2. # TCFLAGS is used for compilations with the GCC just built. # T_CFLAGS is used for all compilations and is overridden by t-* files. +# TFLAGS is also for the user to override, passed down from the top-level +# Makefile. It is used for all compilations, T_CFLAGS = TCFLAGS = +TFLAGS = CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ LDFLAGS = @LDFLAGS@ @@ -457,7 +460,7 @@ T_STDINT_GCC_H = $(srcdir)/ginclude/stdint-gcc.h # The GCC to use for compiling crt*.o. # Usually the one we just built. # Don't use this as a dependency--use $(GCC_PASSES). -GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld +GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include -L$(objdir)/../ld $(TFLAGS) # Set if the compiler was configured with --with-build-sysroot. SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@ @@ -1193,6 +1196,7 @@ FLAGS_TO_PASS = \ "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \ "MAKEOVERRIDES=" \ "SHELL=$(SHELL)" \ + "TFLAGS=$(TFLAGS)" \ "exeext=$(exeext)" \ "build_exeext=$(build_exeext)" \ "objext=$(objext)" \
next reply other threads:[~2022-05-20 14:39 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-20 14:39 Alexandre Oliva [this message] 2022-06-27 15:45 Alexandre Oliva
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220520143923.E8412383601E@sourceware.org \ --to=aoliva@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).