<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Missing gcc include path when cross compiling"
href="https://llvm.org/bugs/show_bug.cgi?id=22937">22937</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missing gcc include path when cross compiling
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yyc1992@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>When cross compiling on linux with clang++, it failed to include a gcc include
path although it has clearly found the right gcc version.
With `test.cpp` being a single line of `#include <vector>`
```
% clang++ --target=arm-linux-gnueabihf -c test.cpp -v
clang version 3.6.0 (tags/RELEASE_360/final)
Target: arm--linux-gnueabihf
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9.2
Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2
Candidate multilib: .;@m32
Selected multilib: .;@m32
"/usr/bin/clang" -cc1 -triple armv6--linux-gnueabihf -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name test.cpp
-mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu arm1136jf-s
-target-abi aapcs-linux -mfloat-abi hard -target-linker-version 2.25.0 -v
-dwarf-column-info -coverage-file /home/yuyichao/tmp/llvm/test.cpp
-resource-dir /usr/bin/../lib/clang/3.6.0 -internal-isystem
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2
-internal-isystem
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/arm-linux-gnueabihf/c++/4.9.2
-internal-isystem
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/arm--linux-gnueabihf/c++/4.9.2
-internal-isystem
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.6.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/yuyichao/tmp/llvm -ferror-limit 19
-fmessage-length 83 -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
test.o -x c++ test.cpp
clang -cc1 version 3.6.0 based upon LLVM 3.6.0 default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/arm-linux-gnueabihf/c++/4.9.2"
ignoring nonexistent directory
"/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/arm--linux-gnueabihf/c++/4.9.2"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2/backward
/usr/local/include
/usr/bin/../lib/clang/3.6.0/include
/usr/include
End of search list.
In file included from test.cpp:1:
In file included from
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2/vector:60:
/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../include/c++/4.9.2/bits/stl_algobase.h:59:10:
fatal error:
'bits/c++config.h' file not found
#include <bits/c++config.h>
^
1 error generated.
```
Adding the include path manually solves the problem.
```
% clang --target=arm-linux-gnueabihf -c test.cpp
-I/usr/arm-linux-gnueabihf/include/c++/4.9.2/arm-linux-gnueabihf
```</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>