Subject: Re: bug#43023: clang++ in a {clang-toolchain + gcc-toolchain} environment

From: Ludovic Courtès <[email-masked]>
Date: Thu, 22 Oct 2020 10:10:05 +0200

Hi Emmanuel,

Emmanuel Agullo <[email-masked]> skribis:

> A typical "hello world" C++ fails in an environment with both
> `gcc-toolchain' and `clang-toolchain', apperently due to the setup of
> the `CPLUS_INCLUDE_PATH' environment variable (used because of the
> `#include <iostream>' instruction), when compiling with `clang++'.

Did you want to have both toolchains in the environment, or was the goal
to use Clang, but GCC just happened to be already there (being the
default toolchain)?

In the latter case, the new ‘--with-c-toolchain’ option may help: it
allows you to select ‘clang-toolchain’ instead of the default GCC tool
chain.  Note “instead of” rather than “in addition to”, which means that
there’s only one tool chain in the environment, so no risk of
interference.

  https://guix.gnu.org/manual/devel/en/html_node/Package-Transformation-Options.html

Now, if you really want the two toolchains in the same environment,
we’ll have to investigate, though I’m not sure it’s even fixable as it
breaks assumptions behind uses of #include_next in libstdc++ and
elsewhere.

Thanks,
Ludo’.