From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2086.outbound.protection.outlook.com [40.107.237.86]) by sourceware.org (Postfix) with ESMTPS id E31B23858D35 for ; Wed, 4 Jan 2023 21:06:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E31B23858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=neuralpropulsion.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=neuralpropulsion.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PuUNwUlQ6r/mzjQobPdX5WJiUHfjcGNgwmaa+E1qgBsQFzL13S2D48i51zjJ4EM9rcqGnk4Qtst0luXdiMeM4GlDK2w9em0GFruwg7U6G0Me9JI5WRrSWjrV3k6b/wK6ru6GUDXMHrOiC+J7xnmMnVkodiudzGAZx4856jwYppOcanmgKknFtwqGb9UOor58BcsJjIviWug/c7GiOfYtl52JF5WZwxoBGTXON/eO9ASsSHigYK4HgC2cvsjsRGKTtEpiVelN1HjuC6v0cHIH9kbPvedZLL7lArML5IT3XD1d65E1NTpoJxbzajE0ubAC7FohT0jWk0zGq45kmcKvCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5cDh6rJPYLhi2GIsLjs7Dd1vEjBNBgxQHWR4x6b8UAk=; b=IwJw24E90YAXfeM3cd5ukiAVgoj51queduLEhCiF2SEZ7Zw0AiSiwCNUrbbfGsVMaJvtR9lzkaRsToaH6tE8sY47Hp8N8b7mnpslb6HMdxbGB6CTR1cEA2XpdrJA2t6JedlS6Q+fSCrfNtDwjZ+zMRH0RWm2bHD65uVuyw63WZLAC7OTamN8DRrWi1CrrETvcIqQIOUFPf63b0ZODNYBx6fXraBXtBcNCA6UdQ98/3Wi9ga483rf76FY59yQslO2CIODYEcA52DjkWCU5uUMPc4XWv3tt8MD9Vv7YB2nXf9bCdyJGMsQg79qNKbhaXGDlPIjbIaZbU9tDqN0BZa7bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=neuralpropulsion.com; dmarc=pass action=none header.from=neuralpropulsion.com; dkim=pass header.d=neuralpropulsion.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neuralpropulsioncom.onmicrosoft.com; s=selector2-neuralpropulsioncom-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5cDh6rJPYLhi2GIsLjs7Dd1vEjBNBgxQHWR4x6b8UAk=; b=ks5+2G59J/0C2jKS76WHM4vEp9ZDv8SYRXSafcB/1ejoLFmDGJSJwsmRi67IMVs17JsusQ/Cl/BYCQeNb/0R1Iu5c1EgkrNCaQjRl8mbG7P1ei4ge/laRNPbLt9b/e+tnXnJV5SnNM9D0yH6aY632M0rB9h8NxV5K+XeFU/SV/0= Received: from MW4PR19MB5655.namprd19.prod.outlook.com (2603:10b6:303:18b::22) by PH8PR19MB6949.namprd19.prod.outlook.com (2603:10b6:510:22e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 21:06:51 +0000 Received: from MW4PR19MB5655.namprd19.prod.outlook.com ([fe80::c810:29ea:7696:a4e2]) by MW4PR19MB5655.namprd19.prod.outlook.com ([fe80::c810:29ea:7696:a4e2%9]) with mapi id 15.20.5944.019; Wed, 4 Jan 2023 21:06:50 +0000 From: Alexander Hans To: Jonathan Wakely CC: libstdc++ Subject: Re: Re: [committed] libstdc++: Allow Clang to use before C++23 Thread-Topic: Re: [committed] libstdc++: Allow Clang to use before C++23 Thread-Index: AQHZIFndk5FiZXP+H02ZUaR2ETmwm66OeqcAgAA9khs= Date: Wed, 4 Jan 2023 21:06:50 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=neuralpropulsion.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR19MB5655:EE_|PH8PR19MB6949:EE_ x-ms-office365-filtering-correlation-id: 1d5ac161-18cb-405b-67dd-08daee979911 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w3sMpSjog/6Nxu0y4N2J/k41bHA5D488JT14ucieFpSfQVzLoOhXLEZifN1paFh88hzOVSbKaOUICEO3feyOz9Y2NlhM3ajWBWuPTyyjPCQvC+FzWWVE80xMfLIyYROLi/fkKUAudpKCytqVBoSFV2WsOpJAcrFfgCO2hadPpDvpX5JvaewHn0q/pteYPizwApYR4OJOqHmA68IzhE2Hjp6EqTW4JLLLXmTQ9C1FWC1HblAQdwQSDeBdqTjDFTrIQFiYYBDBnRBT/YUqhfbXh2YHboXQnbxVfUNQURaYdt6Azala//goII4/nFUc1FNZ7/VH+bQ7myEa49ILfLrn+ZVonV1sWlREASv+ziRWB30jHfIvbFq3JsJ3ZNG796gs1SleswulfmpXCAgnFPsoG0XVkVVqE6TC/2odOM+o8Q7qJfWW/cCT58SZOzz/AprHZS48B7mQPERm86gx1N4YOKl6KFxfdAN+r3+scliHccrxhkpC0oJBJoq8aFqsxl3fwRggalDpJv95o53U6ORp4KE67bKnJPICAF8nC8mTrZT73ys5xOPqy2fAw/rT5I2I2LiuYRgnya32IHnFfxe2tcXUBa1LSPlgYQIja3h6jR4Eokq+3QiVmCR9/CYrIOg/tZ2mRshWO76FiAvyl8Ibp4yjLBItnrquWxi5Nzjg592dAhp8mFuIfy0DDH95Fb2JeXXeLQQAjxqDIFdqpMHHpNpdr6UF4l1bIwiY3cBqxNs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR19MB5655.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(376002)(366004)(346002)(136003)(396003)(39830400003)(451199015)(186003)(9686003)(83380400001)(86362001)(55016003)(33656002)(38070700005)(38100700002)(122000001)(316002)(66556008)(52536014)(6916009)(64756008)(2906002)(4326008)(66946007)(8936002)(41300700001)(8676002)(91956017)(5660300002)(76116006)(66446008)(66476007)(478600001)(71200400001)(7696005)(966005)(6506007);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ueLBm0u+rcJlj2+Surp9d8XFixIu5vrHr6ynaLO2N6XbRB52F8qLYQoeeJ?= =?iso-8859-1?Q?2l9JE9WPpcOZc98yK6cJ0FhJbNUVC/OUE5/jJJA23ruMsirn2xtF/UxfRR?= =?iso-8859-1?Q?M4wEOr+V455WC07AyQ1CWa1R69r9HIYQ8fK0Qo9XkWyeu1pHRSWkD47iYK?= =?iso-8859-1?Q?SbnX7sY/4Xymm6RJObbQq2ncvAXz0siq+Z5269JL0RR4fn5V9BIRN52d2T?= =?iso-8859-1?Q?Hdd9lLRqmpPRFva5bmRVGKaV4cUsFYUxMG98f/fCUoNruaZlLPrrFBuASs?= =?iso-8859-1?Q?aPaXTBGkwHywedjvDacoi/ZRqZ7UPq87pUUmpmPhdHRrnQNUryGeDfdWW4?= =?iso-8859-1?Q?4yMGnfGAhxne321VJnoOWweh8I/cGlK+Lh76QYpJ3E4DIvYwLiytUVpiaY?= =?iso-8859-1?Q?isQcpO2hZI7Fu94BF4O39HLPJp23tD0fY1tT3MorFx+S3sSCrs1D+266zO?= =?iso-8859-1?Q?21IZB9aV4V9vK8YtZBQC3h8pLm93bKfo+zPkmX2uWqwPx7b4UWsfibfTfu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SNMNoZYBJilG2eK4IX/WbZW7TSwFWJkdfd4?= =?iso-8859-1?Q?hqLxAwaY0X5rROqWW0K+PpbabUhUuW5bmT1FWChxKeWRHeBzO0Q3rlrw5E?= =?iso-8859-1?Q?W5bJIFr8zaNYRQywDjGOKhAoYYAAVzJEGB+o5krBdeFAP+jdw6Tt1Hu5V6?= =?iso-8859-1?Q?siAz4nSWYfxmAKzepb7w+fHdEMYQmvSRTkM+y+T1X1d83oRF+lleYqaU89?= =?iso-8859-1?Q?zizC+or7lKRBh0IWFAuX7/ZD5IjF0OfCsvL+p0rmi+C0x0zBMSFN7kTmvW?= =?iso-8859-1?Q?J/9Nn6YPPBZWr30Gu9HpIdJLYHDqPlHVxOmcTbLQ?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: neuralpropulsion.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR19MB5655.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d5ac161-18cb-405b-67dd-08daee979911 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2023 21:06:50.1717 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 936ce1c6-2407-48ba-bc49-aff739d6965c X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RrrEi8SILUgg9IFPNtHjHmZXPA3WvO2i0OmmpP15p6LZqXBpVIVyP2hvwOIq1ZEH+rCuGKKHj2Etj5TKzAbdRoJNN2lEemqqj/KZGnYSAwE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR19MB6949 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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,=0A= =0A= Thanks for your prompt reply. Now things are much clearer!=0A= =0A= =0A= > Then Bazel is broken. The assumption that "there are no name clashes=0A= > between C++ and C header files" has never been true.=0A= =0A= > I suppose we could support that silliness like this:=0A= > [...]=0A= > But I don't really like having to patch libstdc++ to support broken tools= .=0A= =0A= I agree that libstdc++ is not the right place to fix this. But thanks for t= he=0A= patch in any case, that's better than my unconditional #else and I'll keep= =0A= it in mind. That would also allow me to work around the issue.=0A= =0A= Regarding your question why this happens in the first place:=0A= =0A= > Why does Bazel even need to know those directories? It should not be=0A= > adding them for compiling C code nor for compiling C++ code, because=0A= > GCC does that automatically (and gets it right).=0A= =0A= Bazel can detect a local toolchain and use it. Then everything works as=0A= expected. But it can also support some other toolchain, contained in some= =0A= archive you tell it to download from somewhere. I'm trying to integrate=0A= gcc 12 via this route and do this based on some existing Bazel rules that a= re=0A= pretty close to what I need [1]. They call gcc passing -nostdinc and giving= =0A= the include directories via -isystem arguments. However, some preliminary= =0A= testing suggests you should actually use only --sysroot for that and avoid= =0A= -nostdinc and any extra -isystem arguments. If that's true, the fix should= =0A= happen in the gcc toolchain-specific Bazel rules. The section I quoted=0A= about the cxx_builtin_include_directories parameter and the assumption=0A= that there are no name clashes is probably not an issue: I believe this=0A= is only about telling Bazel where those files live, so that it can make the= m=0A= available (Bazel is all about hermetic builds and to that end it wants to= =0A= know exactly what is used for the build). Using --sysroot, they will be=0A= made available for C compilations as well, but ignored as you explained.=0A= The only unclean part about this is that we cannot tell Bazel which=0A= toolchain-supplied files a C-only build depends on (it will always be both,= =0A= C and C++ files), but that is acceptable.=0A= =0A= Thanks again!=0A= =0A= Alex=0A= =0A= [1] https://github.com/aspect-build/gcc-toolchain=