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} \ --with-c-include-dirs=${EPREFIX}/usr/include:/usr/include" fi This flag never made it into the new llvm ebuild, so clang fails to find header files on prefix.
I think this refers to the situation before Darwin switched primary toolchain to Clang.
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 /home/supernova/wthrowe/gentoo/usr/include/gmp.h
It could be that due to darwin_prefix-include-paths.patch this works on Darwin, but not on other Prefix platforms.
the with-c-include-dirs equivalent in cmake setup is unknown, so I figure we need a fix like for Darwin.
(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.
should it be in clang or llvm? I'm not sure on that.
I am using C_INCLUDE_DIRS and CPLUS_INCLUDE_DIRS env vars in the bootstrap-prefix.sh 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.
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.