[llvm-bugs] [Bug 26531] New: Clang ignores --gcc-toolchain, --sysroot, and -B when looking for linker

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 8 09:34:45 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26531

            Bug ID: 26531
           Summary: Clang ignores --gcc-toolchain, --sysroot, and -B when
                    looking for linker
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alexchandel at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Despite a directory configuration of:

~/x86_64-unknown-linux-gnu/
~/x86_64-unknown-linux-gnu/bin/
~/x86_64-unknown-linux-gnu/bin/ld
~/x86_64-unknown-linux-gnu/bin/gcc
~/x86_64-unknown-linux-gnu/usr -> .
~/x86_64-unknown-linux-gnu/lib/
~/x86_64-unknown-linux-gnu/lib/gcc/
~/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/
~/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/5 -> ../../../bin


Clang absolutely refuses to invoke ~/x86_64-unknown-linux-gnu/bin/ld as the
linker, instead using /usr/bin/ld. Setting --sysroot and -B do not help.

Tested with `clang --gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu`,
`clang --gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/bin`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu`,
and `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/5`.

Why is it so hard to use LLD with clang ?!?!?

Notes: Tested on OSX x86_64 with clang trunk. ~ is /Users/alex.
~/x86_64-unknown-linux-gnu also contains myriad headers and libraries as
appropriate for a toolchain. ~/x86_64-unknown-linux-gnu/bin/ld is a shell
script that forwards arguments to `lld-gnu -target x86_64-unknown-linux-gnu`.
~/x86_64-unknown-linux-gnu/bin/gcc is a shell script that invokes clang.

-- 
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/20160208/abdf6ca8/attachment.html>


More information about the llvm-bugs mailing list