From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 8C49C383B6B5 for ; Tue, 6 Dec 2022 21:07:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C49C383B6B5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,223,1665475200"; d="scan'208";a="91892863" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 06 Dec 2022 13:07:02 -0800 IronPort-SDR: /5JZ9p5/ASuNzZWbRSbbhrklkgAj9LwBcgLZ4OiYF6ypEbuqOaau4QUSuX3iELaQ5qRBit1AM4 1ZujG7k7UGFSYgii2HYqfawXyvO+mEA8WocWpTs4LjWBDxzJ5xSBwhX4al7Z5IIh4jsokp6uSC LMzCbjVBkDHHMTNHEvX8OETEDd680+25xUaG3QhEeCLBcynyVWK8jTkuv9t8gxxQp3nb62xv5T Fb2wvcnrXzYud9yOrKypoiT8qSpr8CZRL6FSajrCgztdrjhhRX0Vgk/c4LBIJSRyqU3W+NE4MC JOQ= From: Thomas Schwinge To: Sebastian Huber CC: Jeff Law , Subject: Re: [PATCH v2 1/2] Allow subtarget customization of CC1_SPEC In-Reply-To: <20221121072526.103446-1-sebastian.huber@embedded-brains.de> References: <20221121072526.103446-1-sebastian.huber@embedded-brains.de> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/27.1 (i686-pc-linux-gnu) Date: Tue, 6 Dec 2022 22:06:48 +0100 Message-ID: <87k034s0lz.fsf@dirichlet.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi! I suppose I just fail to see some detail here, but: On 2022-11-21T08:25:25+0100, Sebastian Huber wrote: > gcc/ChangeLog: > > * gcc.cc (SUBTARGET_CC1_SPEC): Define if not defined. > (cc1_spec): Append SUBTARGET_CC1_SPEC. > --- > v2: Append SUBTARGET_CC1_SPEC directly to cc1_spec and not through CC1_SP= EC. > This avoids having to modify all the CC1_SPEC definitions in the targ= ets. > > gcc/gcc.cc | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/gcc/gcc.cc b/gcc/gcc.cc > index 830ab88701f..4e1574a4df1 100644 > --- a/gcc/gcc.cc > +++ b/gcc/gcc.cc > @@ -706,6 +706,13 @@ proper position among the other output files. */ > #define CPP_SPEC "" > #endif > > +/* Subtargets can define SUBTARGET_CC1_SPEC to provide extra args to cc1= and > + cc1plus or extra switch-translations. The SUBTARGET_CC1_SPEC is appe= nded > + to CC1_SPEC. */ > +#ifndef SUBTARGET_CC1_SPEC > +#define SUBTARGET_CC1_SPEC "" > +#endif > + > /* config.h can define CC1_SPEC to provide extra args to cc1 and cc1plus > or extra switch-translations. */ > #ifndef CC1_SPEC > @@ -1174,7 +1181,7 @@ proper position among the other output files. */ > static const char *asm_debug =3D ASM_DEBUG_SPEC; > static const char *asm_debug_option =3D ASM_DEBUG_OPTION_SPEC; > static const char *cpp_spec =3D CPP_SPEC; > -static const char *cc1_spec =3D CC1_SPEC; > +static const char *cc1_spec =3D CC1_SPEC SUBTARGET_CC1_SPEC; > static const char *cc1plus_spec =3D CC1PLUS_SPEC; > static const char *link_gcc_c_sequence_spec =3D LINK_GCC_C_SEQUENCE_SPEC= ; > static const char *link_ssp_spec =3D LINK_SSP_SPEC; ... doesn't this (at least potentially?) badly interact with any existing 'SUBTARGET_CC1_SPEC' definitions -- which pe rabove get appended to 'cc1_spec'? gcc/config/loongarch/gnu-user.h- and provides this hook instead. */ gcc/config/loongarch/gnu-user.h:#undef SUBTARGET_CC1_SPEC gcc/config/loongarch/gnu-user.h:#define SUBTARGET_CC1_SPEC GNU_USER_TAR= GET_CC1_SPEC gcc/config/loongarch/gnu-user.h- -- gcc/config/loongarch/loongarch.h-#define EXTRA_SPECS \ gcc/config/loongarch/loongarch.h: {"subtarget_cc1_spec", SUBTARGET_CC1= _SPEC}, \ gcc/config/loongarch/loongarch.h- {"subtarget_cpp_spec", SUBTARGET_CPP= _SPEC}, \ -- gcc/config/mips/gnu-user.h- and provides this hook instead. */ gcc/config/mips/gnu-user.h:#undef SUBTARGET_CC1_SPEC gcc/config/mips/gnu-user.h:#define SUBTARGET_CC1_SPEC GNU_USER_TARGET_C= C1_SPEC gcc/config/mips/gnu-user.h- -- gcc/config/mips/linux-common.h- gcc/config/mips/linux-common.h:#undef SUBTARGET_CC1_SPEC gcc/config/mips/linux-common.h:#define SUBTARGET_CC1_SPEC = \ gcc/config/mips/linux-common.h- LINUX_OR_ANDROID_CC (GNU_USER_TARGET_C= C1_SPEC, \ -- gcc/config/mips/mips.h- gcc/config/mips/mips.h:/* SUBTARGET_CC1_SPEC is passed to the compiler = proper. It may be gcc/config/mips/mips.h- overridden by subtargets. */ gcc/config/mips/mips.h:#ifndef SUBTARGET_CC1_SPEC gcc/config/mips/mips.h:#define SUBTARGET_CC1_SPEC "" gcc/config/mips/mips.h-#endif -- gcc/config/mips/mips.h-#define EXTRA_SPECS = \ gcc/config/mips/mips.h: { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, = \ gcc/config/mips/mips.h- { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, = \ -- gcc/config/mips/r3900.h-/* By default (if not mips-something-else) prod= uce code for the r3900 */ gcc/config/mips/r3900.h:#undef SUBTARGET_CC1_SPEC gcc/config/mips/r3900.h:#define SUBTARGET_CC1_SPEC "\ gcc/config/mips/r3900.h-%{mhard-float:%e-mhard-float not supported} \ Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955