GNU bug report logs - #32773
clang: missing default include paths for C++

Previous Next

Package: guix;

Reported by: Tim Gesthuizen <tim.gesthuizen <at> yahoo.de>

Date: Wed, 19 Sep 2018 18:24:02 UTC

Severity: normal

Done: Mathieu Othacehe <m.othacehe <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 32773 <at> debbugs.gnu.org (full text, mbox):

From: Robin Templeton <robin <at> igalia.com>
To: Tim Gesthuizen <tim.gesthuizen <at> yahoo.de>
Cc: 32773 <at> debbugs.gnu.org
Subject: Re: bug#32773: clang: missing default include paths for C++
Date: Fri, 21 Sep 2018 20:58:58 -0400
Hi Tim,

Tim Gesthuizen <tim.gesthuizen <at> yahoo.de> writes:

> As you can see from the output, clang is missing some include paths that
> gcc has. Specifying a custom `CPLUS_INCLUDE_PATH' fixes the problem:
>
> ┌────
> │
> CPLUS_INCLUDE_PATH=$HOME/.guix-profile/include/c++:$HOME/.guix-profile/include/c++/x86_64-unknown-linux-gnu/
> clang++ test.cc
> │ ./a.out
> └────
>
> ┌────
> │ Hello, World
> └────
>
> This is already done in the package definition for the
> `C_INCLUDE_PATH'. It is not done for C++ because clang does not
> implement a feature or build system variable for changing it.
>
> Fixing this problem would probably include an upstream patch enabling a
> similar feature for C++ for what is already done in C and configuring
> this variable in build phase to add the same include paths that g++ has.

Another solution, maybe simpler than a new environment variable, is to
have clang use the C++ include path from its gcc input. On FHS systems,
clang can find C++ headers using the GCC_INSTALL_PREFIX configure
option, but it doesn't work under Guix because the GCC package puts
headers and libraries in separate outputs. Guix already patches clang to
hardcode some library directories; maybe something similar could be done
for C++ headers. (I think the function to modify for this would be
Linux::addLibStdCxxIncludePaths in lib/Driver/ToolChains/Linux.cpp.)




This bug report was last modified 5 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.