Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 502318 - sys-devel/llvm: pass --with-c-include-dirs on prefix
Summary: sys-devel/llvm: pass --with-c-include-dirs on prefix
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
Depends on:
Reported: 2014-02-24 04:50 UTC by William Throwe
Modified: 2020-12-08 15:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description William Throwe 2014-02-24 04:50:37 UTC
Before the llvm and clang packages were combined, the clang ebuild had:

# Setup the search path to include the Prefix includes                      
if use prefix ; then
    CONF_FLAGS="${CONF_FLAGS} \                                             

This flag never made it into the new llvm ebuild, so clang fails to find header files on prefix.
Comment 1 Fabian Groffen gentoo-dev 2015-08-11 19:17:41 UTC
I think this refers to the situation before Darwin switched primary toolchain to Clang.
Comment 2 William Throwe 2015-09-21 03:37:21 UTC
This is still broken with sys-devel/llvm-3.7.0-r1

$ cat bar.c
#include <gmp.h>
$ gcc bar.c -fsyntax-only
$ clang bar.c -fsyntax-only
bar.c:1:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
1 error generated.
$ ls ${EPREFIX}/usr/include/gmp.h
Comment 3 Fabian Groffen gentoo-dev 2016-01-09 19:11:55 UTC
It could be that due to darwin_prefix-include-paths.patch this works on Darwin, but not on other Prefix platforms.
Comment 4 Fabian Groffen gentoo-dev 2018-02-01 09:06:02 UTC
the with-c-include-dirs equivalent in cmake setup is unknown, so I figure we need a fix like for Darwin.
Comment 5 Guilherme Amadio gentoo-dev 2018-03-13 16:31:36 UTC
(In reply to Fabian Groffen from comment #4)
> the with-c-include-dirs equivalent in cmake setup is unknown, so I figure we
> need a fix like for Darwin.

There is a -DC_INCLUDE_DIRS flag, but adding it in the clang ebuild didn't work for me. Maybe the Darwin fix will be needed in all prefix variants.
Comment 6 Fabian Groffen gentoo-dev 2018-03-13 17:33:30 UTC
should it be in clang or llvm? I'm not sure on that.
Comment 7 Jacob Floyd 2020-12-07 19:51:36 UTC
I am using C_INCLUDE_DIRS and CPLUS_INCLUDE_DIRS env vars in the script to use the correct dir on darwin prefix.
I'm not sure if that will help on linux. I'm not sure if we still need an ebuild fix. For darwin prefix, I'm patching in the appropriate paths.
Comment 8 Guilherme Amadio gentoo-dev 2020-12-08 09:41:33 UTC
What I've moved to in prefix-standalone on Linux at least is to set -DDEFAULT_SYSROOT=${EPREFIX} when configuring Clang. Clang now works out of the box there with that change.