unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Robin Templeton <robin@igalia.com>
To: Tim Gesthuizen <tim.gesthuizen@yahoo.de>
Cc: 32773@debbugs.gnu.org
Subject: bug#32773: clang: missing default include paths for C++
Date: Fri, 21 Sep 2018 20:58:58 -0400	[thread overview]
Message-ID: <87fty2wdnx.fsf@terpri.org> (raw)
In-Reply-To: <19ece273-ea75-fc9d-4e4b-aa3a68deab6d@yahoo.de>

Hi Tim,

Tim Gesthuizen <tim.gesthuizen@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.)

  parent reply	other threads:[~2018-09-22  1:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 18:23 bug#32773: clang: missing default include paths for C++ Tim Gesthuizen
2018-09-19 18:33 ` Pjotr Prins
2018-09-19 18:47   ` Tim Gesthuizen
2018-10-08 13:51     ` fis trivial
2018-09-22  0:58 ` Robin Templeton [this message]
2018-09-23 17:10   ` Tim Gesthuizen
2019-11-13 16:56 ` bug#32773: [PATCH] Fix clang libstdc++ header location search David Truby
2019-11-13 19:50   ` Carl Dong
2019-11-14 10:30   ` Mathieu Othacehe
2019-11-14 13:22     ` David Truby
2019-11-14 13:40       ` Mathieu Othacehe
2019-11-14 16:16         ` David Truby
2019-11-14 16:54           ` Mathieu Othacehe
2019-11-14 17:03             ` David Truby
2019-11-15  8:42               ` Mathieu Othacehe
2019-11-17 11:21                 ` Mathieu Othacehe
2019-11-19 13:08                   ` David Truby
2019-11-19 15:30                     ` Mathieu Othacehe
2019-11-17 19:29         ` Ludovic Courtès
2019-11-17 19:23     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fty2wdnx.fsf@terpri.org \
    --to=robin@igalia.com \
    --cc=32773@debbugs.gnu.org \
    --cc=tim.gesthuizen@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).