On Wed, 2022-08-17 at 13:15 +0100, Richard Purdie via Gcc-patches
wrote:
> Code such as:
> 
> 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
> 
> Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
> ---
>  libcpp/macro.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 
> directives.cc
> and would need a helper function.

The above should have said 

Code such as:

#include __FILE__

can interact poorly with...

Cheers,

Richard

Reply via email to