Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 404057 - The =sys-devel/clang-3.0-r2 fails to add proper includepath on multilib + -m32
Summary: The =sys-devel/clang-3.0-r2 fails to add proper includepath on multilib + -m32
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-16 06:44 UTC by Sergei Trofimovich (RETIRED)
Modified: 2012-02-16 11:35 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2012-02-16 06:44:44 UTC
Host arch is amd64 multilib.

USE="static-analyzer system-cxx-headers -debug -multitarget -test" =sys-devel/clang-3.0-r2

Simple example:

$ cat a.cc
#include <iostream>

int main() {
    return 0;
}
$ clang++ -c a.cc # works fine
$ clang++ -m32 -c a.cc
> In file included from a.cc:1:
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/iostream:38:10: fatal error: 'bits/c++config.h' file
>       not found
> #include <bits/c++config.h>
>          ^
> 1 error generated.

Fails. running with -v reveals the problem:

$ clang++ -v -m32 -c a.cc
clang version 3.0 (tags/RELEASE_30/final)
Target: i386-pc-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name a.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -coverage-file a.o -resource-dir /usr/bin/../lib/clang/3.0 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/x86_64-pc-linux-gnu32 -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include -fdeprecated-macro -ferror-limit 19 -fmessage-length 115 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o a.o -x c++ a.cc
clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/x86_64-pc-linux-gnu32"
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/backward
 /usr/bin/../lib/clang/3.0/include
 /usr/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include
End of search list.
In file included from a.cc:1:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/iostream:38:10: fatal error: 'bits/c++config.h' file not
      found
#include <bits/c++config.h>
         ^
1 error generated.


The interesting bit is:
> ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4/x86_64-pc-linux-gnu32"

It misses '/' separator in the end: x86_64-pc-linux-gnu32 -> x86_64-pc-linux-gnu/32

I currently workaround it by adding proper '-I' explicitely.
Comment 1 Bernard Cafarelli gentoo-dev 2012-02-16 11:35:08 UTC
From bug #402365 the path setup will be better/easier in 3.1 (I hope). 

In the meantime I have added the missing "/" in the configure step, that has to be one of the bumps with least changes I ever made!

Fixed with clang-3.0-r3