From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id BB341385842A for ; Tue, 1 Nov 2022 19:32:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BB341385842A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x629.google.com with SMTP id p3so14501826pld.10 for ; Tue, 01 Nov 2022 12:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=mkJh0BlRDd+DKzpGL8z6ucDFF4mtqqd0DXAeVZWFvwk=; b=ljnGe2VmJYEdzg0DjUW2NeaVf1+H/24gXs/owwc0k9M5lAMJ/ef+bd7KZV5HRJxW2G fAguX3sQlpqy4S5Vjtk4hUKa4wZJ7e0Dpv3s8pSvnZyQiAZXNL5V9dEF5MzMetF3w0Tm euytDMwSjnPv63OFXfE/+CMfouqslIHfAo555J4gblxyJ+qhxDDszbKU+bx9oSG62BIm 1IjlD2NfTV2/0T7Zlw7J/zZdgdue1+aRfZU937chHTXnn5uPvfXSup/FWNRp/nm5OklW kMq/yWLI7aQWgSaLMuCzpF4+7Yt8oWPWgnPPIXihIoIyvQ6KEeqHf2nKULSt6FkkLGQm EMKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mkJh0BlRDd+DKzpGL8z6ucDFF4mtqqd0DXAeVZWFvwk=; b=gU4cJYDelto9WWM403SVDZIqud8si6+xPIyaYmDkk6855qAGYfSqbYksuPLkRKz/ms xtmBL/m7jkKNPQwyzVaXFyUjJo0iP9LY7F2Uen1vW6htYYgif/zltS2Aid8pLb9800y/ HdY1lv4UlD0hWi3OQcCbKCCmTU/cquWdPmAN0NGdXRJbCP9KBXUVYjSW7BghxDnhAjTp Qb2j/fDx1sab+xyYwZNi89c93rmFskzyEm6B8thgVWoFDe8WRvMR1skO1zVVC3z+vmKZ t7tp5116sLHyJ1SUtdthH+o1ldeX6lizxdV0YGSB7pIVEYtXti/xClGVuvhLCaLDmgoC 8eQw== X-Gm-Message-State: ACrzQf1ZpJd96Xd/Ov5c4/mRHKC3rgSPWyN90Saygi18kkOJNoClJ4my i4099E6SDAFpY623Y6zF13o= X-Google-Smtp-Source: AMsMyM45br4dyldCwE3pZsKBc8rt1XcS9EzKfA1jX5d/pr3Z0BOA35j2kRa0zVTjoa3r/7iWfmEKNA== X-Received: by 2002:a17:902:c745:b0:186:b287:7d02 with SMTP id q5-20020a170902c74500b00186b2877d02mr21271114plq.87.1667331169603; Tue, 01 Nov 2022 12:32:49 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b00186c3727294sm6662533plb.270.2022.11.01.12.32.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Nov 2022 12:32:48 -0700 (PDT) Message-ID: Date: Tue, 1 Nov 2022 13:32:47 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 2/2] libcpp: Avoid remapping filenames within directives Content-Language: en-US To: Richard Purdie , gcc-patches@gcc.gnu.org References: <20220817121534.1825108-1-richard.purdie@linuxfoundation.org> <20220817121534.1825108-2-richard.purdie@linuxfoundation.org> From: Jeff Law In-Reply-To: <20220817121534.1825108-2-richard.purdie@linuxfoundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: On 8/17/22 06:15, Richard Purdie via Gcc-patches wrote: > Code such as: #include __FILE__ > > 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. Ingoring > filename remapping for directives is one way to avoid such failures. > > libcpp/ChangeLog: > > * macro.cc (_cpp_builtin_macro_text): Don't remap filenames within directives So I went back and reviewed the old PR which introduced this code.  It was actually the Yocto project that got this code in to begin with :-)  There wasn't really any discussion AFAICT about whether or not to remap in directives that I saw in the PR. ISTM that given the change in behavior, we should probably document that we don't remap in directives.  Probably doc/invoke.texi. With suitable documentation, this should be fine.  It seems like it ought to be independent of the first patch in this series which adds support for remapping relative paths. jeff