From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id A4B933858D1E for ; Wed, 17 Aug 2022 14:19:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A4B933858D1E Received: by mail-wm1-x335.google.com with SMTP id k6-20020a05600c1c8600b003a54ecc62f6so1010349wms.5 for ; Wed, 17 Aug 2022 07:19:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc; bh=umFi8GoLxjeSlb35YScyftWrIxRWnWMHXGRbzimDOCM=; b=YKf2d2TJlBDDU2fCg7kQLuT+358E3tIHh6EAZ9usRqwdPZz0I0Vi2HOMIAcphyUBl0 QbHFY/yOBfLyMDgXdpJbQa29mJxEiJJ7wxGzHSipVUPtT0cc0wN73Gdu4IUezOrzKttk ba2aolVSQJWphyiVEsRpdnFG3whvfFAH1ESEd/jz3L5pvX77OMEX+1eBUEcqBZlxlced C/h4Pa1Fp37SwQk3hztGwHJx1fhttlbvAWmqD8KOlZNndLY2fW2R4cnSdp8Jg1/Ec9Gs a8km37JjqmzF+fN8nw72FpIkXq/ol9oabBXR5x37o2GsVZI4MXsHij7tvUWUe7/1BSBA khTA== X-Gm-Message-State: ACgBeo0kg/y+O3t4beqk2xoEztvmZU+jggJ1Za5XI8bZcKoke8kOlWK4 MAcuxykD6ZEhzsvpp/5/yYWAdqPXCz93og== X-Google-Smtp-Source: AA6agR41vbISwCTD0mnVknYMgPjuScrZZ0QMIdiJkk0gjp+y6iifYpgT6jdv4vzqp+DmqwkXeG1DKg== X-Received: by 2002:a05:600c:1d26:b0:3a5:d146:6f07 with SMTP id l38-20020a05600c1d2600b003a5d1466f07mr2347197wms.202.1660745993386; Wed, 17 Aug 2022 07:19:53 -0700 (PDT) Received: from ?IPv6:2001:8b0:aba:5f3c:3694:2ef4:2932:37d5? ([2001:8b0:aba:5f3c:3694:2ef4:2932:37d5]) by smtp.gmail.com with ESMTPSA id b6-20020a05600c4e0600b003a601707174sm2351837wmq.33.2022.08.17.07.19.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 07:19:52 -0700 (PDT) Message-ID: Subject: Re: [PATCH 2/2] libcpp: Avoid remapping filenames within directives From: Richard Purdie To: gcc-patches@gcc.gnu.org Date: Wed, 17 Aug 2022 15:19:52 +0100 In-Reply-To: <20220817121534.1825108-2-richard.purdie@linuxfoundation.org> References: <20220817121534.1825108-1-richard.purdie@linuxfoundation.org> <20220817121534.1825108-2-richard.purdie@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2022 14:19:57 -0000 On Wed, 2022-08-17 at 13:15 +0100, Richard Purdie via Gcc-patches wrote: > Code such as: >=20 > can interact poorly with file-prefix-map options when cross compiling. In > general you're after to remap filenames for use in target context but the > local paths should be used to find include files at compile time. Ingorin= g > filename remapping for directives is one way to avoid such failures. >=20 > libcpp/ChangeLog: >=20 > * macro.cc (_cpp_builtin_macro_text): Don't remap filenames within di= rectives >=20 > Signed-off-by: Richard Purdie > --- > libcpp/macro.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > I wasn't sure if this should apply to all directives or whether this may = need > filtering to includes (along the lines of pfile->directive.flags & INCL).= That > gets a little more complex as the flag isn't available outside of directi= ves.cc > and would need a helper function. The above should have said=C2=A0 Code such as: #include __FILE__ can interact poorly with... Cheers, Richard