On 10/27/2021 2:05 PM, Richard Purdie via Gcc-patches wrote:
OpenEmbedded/Yocto Project extensively uses the --sysroot support within gcc.
We discovered that when compiling preprocessed source (.i or .ii files), the
compiler will try and access the builtin sysroot location rather than the
--sysroot option specified on the commandline. If access to that directory is
permission denied (unreadable), gcc will error. This is particularly problematic
when ccache is involved.

This patch adds %I to the cpp-output spec macro so the default substitutions for
-iprefix, -isystem, -isysroot happen and the correct sysroot is used.

2021-10-27 Richard Purdie <richard.pur...@linuxfoundation.org>

gcc/cp/ChangeLog:

     * lang-specs.h: Pass sysroot options to cpp for preprocessed source

gcc/ChangeLog:

     * gcc.c: Pass sysroot options to cpp for preprocessed source
So generally OK, though I think this is incomplete.  If I understand the underlying bits correctly a similar change is needed in:

{lto,objc,fortran,ada/gcc-interface,objcp}/lang-specs.h.

I think d/lang-specs.h is OK, though it'd probably be useful to double check that.

jeff

Reply via email to