[llvm-bugs] [Bug 33847] New: Clang fails to properly find the gcc installation when cross-compiling
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Wed Jul 19 01:02:37 PDT 2017
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=33847
            Bug ID: 33847
           Summary: Clang fails to properly find the gcc installation when
                    cross-compiling
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jacekswierk at gmail.com
                CC: llvm-bugs at lists.llvm.org
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
```
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170719/59af3607/attachment.html>
    
    
More information about the llvm-bugs
mailing list