<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Clang fails to properly find the gcc installation when cross-compiling"
href="https://bugs.llvm.org/show_bug.cgi?id=33847">33847</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang fails to properly find the gcc installation when cross-compiling
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>Driver
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jacekswierk@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Files like crtbegin.o and libgcc.a cannot be found by clang 5.0 while it worked
just fine for clang 4.0 and older releases. Using the following command fails
with clang from trunk with the message indicating missing crtbegin and libgcc:
clang -mthumb -mfloat-abi=hard -mfpu=neon-vfpv4 -mcpu=cortex-a15
--target=arm-poky-linux-gnueabi --gcc-toolchain=<target_sysroot>/usr
--sysroot=<target_sysroot> -B<native_sysroot>/usr/bin/arm-poky-linux-gnueabi
test.c -v
I can see that there is some issue with finding gcc toolchain as the verbose
output is missing few lines:
```
Found candidate GCC installation:
<target_sysroot>/usr/lib/gcc/arm-poky-linux-gnueabi/5.4.0
```
The same command works with older clangs and give verbose output:
```
Found candidate GCC installation:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0
Found candidate GCC installation:
<target_sysroot>/usr/lib/gcc/arm-poky-linux-gnueabi/5.4.0
Selected GCC installation:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0
Candidate multilib: .;@m32
Selected multilib: .;@m32
```
Adding -print-search-dirs gives similar results - clang 5.0:
```
programs: =
<llvm-5.0>/bin:
/..//bin
libraries: =
<llvm-5.0>/lib/clang/5.0.0:
<target_sysroot>/lib/../lib:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi:
<target_sysroot>/usr/lib/../lib:
<target_sysroot>/lib:
<target_sysroot>/usr/lib
```
and clang 4.0:
```
programs: =
<llvm-4.0>/bin:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0/../../../arm-poky-linux-gnueabi/bin
libraries: =
<llvm-4.0>/bin/../lib/clang/4.0.1:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0/../../arm-poky-linux-gnueabi:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0/../../../lib:
<target_sysroot>/lib/../lib:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi:
<target_sysroot>/usr/lib/../lib:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/../../lib:
<target_sysroot>/usr/lib/arm-poky-linux-gnueabi/5.4.0/../..:
<target_sysroot>/lib:
<target_sysroot>/usr/lib
```</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>