On Wed, Dec 12, 2012 at 12:59 AM, Etienne Le Sueur <elesu...@vmware.com> wrote: > Hi Richard, > > Thanks for your reply. > > The sysroot of /dev/null is basically to force the user or build system to > pass a valid --sysroot argument. This helps us to ensure that we only link > against known libraries (that are in a specific location) and there isn't > any leakage from the host system. > > I'm not sure if we're using sysroot the way it was intended, but it is > certainly helping us to maintain some sanity in our build. > > It seems to me like the sysroot that the user passes in as an argument to > gcc should definitely be forwarded to cc1plus.
Currently --sysroot is only accepted by the driver and passed on to the compiler as -isysroot, -isystem combination. So I suppose distcc does not replicate this behavior properly? Richard. > Etienne > > > > On 4/12/12 1:21 AM, Richard Biener wrote: >> >> On Mon, Dec 3, 2012 at 9:03 PM, Etienne Le Sueur <elesu...@vmware.com> >> wrote: >>> >>> First ping... anyone? >> >> A sysroot of /dev/null does not sound like something that we should >> support. >> If we do the semantics of this setting should be documented somewhere. >> >> Richard. >> >>> On 28/11/12 1:21 PM, Etienne Le Sueur wrote: >>>> >>>> Hi, >>>> >>>> With a sysroot of /dev/null, passing a .i file to cc1plus causes it to >>>> attempt to open /dev/null/usr/include, which fails. This causes problems >>>> for >>>> ccache and distcc. There is an open bugzilla ticket at [1]. >>>> >>>> The patch below applies on to 4.6.3, but it appears the bug is still >>>> present in 4.7.2. >>>> >>>> If this is not the correct way to solve this problem, please suggest a >>>> better approach. >>>> >>>> Regards, >>>> Etienne Le Sueur >>>> >>>> [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54560 >>>> >>>> >>>> diff --git a/gcc-4.6.3/gcc/cp/lang-specs.h >>>> b/gcc-4.6.3/gcc/cp/lang-specs.h >>>> index a73aba3..873609a 100644 >>>> --- a/gcc-4.6.3/gcc/cp/lang-specs.h >>>> +++ b/gcc-4.6.3/gcc/cp/lang-specs.h >>>> @@ -64,5 +64,5 @@ along with GCC; see the file COPYING3. If not see >>>> {".ii", "@c++-cpp-output", 0, 0, 0}, >>>> {"@c++-cpp-output", >>>> "%{!M:%{!MM:%{!E:\ >>>> - cc1plus -fpreprocessed %i %(cc1_options) %2\ >>>> + cc1plus -fpreprocessed %i %I %(cc1_options) %2\ >>>> %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, >>>> diff --git a/gcc-4.6.3/gcc/gcc.c b/gcc-4.6.3/gcc/gcc.c >>>> index 75f522e..214ef29 100644 >>>> --- a/gcc-4.6.3/gcc/gcc.c >>>> +++ b/gcc-4.6.3/gcc/gcc.c >>>> @@ -950,7 +950,7 @@ static const struct compiler default_compilers[] = >>>> %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0}, >>>> {".i", "@cpp-output", 0, 0, 0}, >>>> {"@cpp-output", >>>> - "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) >>>> %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, >>>> + "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) >>>> %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, >>>> {".s", "@assembler", 0, 0, 0}, >>>> {"@assembler", >>>> "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", >>>> 0, >>>> 0, 0}, >>>> >