[llvm-bugs] [Bug 25185] New: -nostdlib -rtlib=compiler_rt fails, no mechanism to link libc.so
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Wed Oct 14 13:40:02 PDT 2015
    
    
  
https://llvm.org/bugs/show_bug.cgi?id=25185
            Bug ID: 25185
           Summary: -nostdlib -rtlib=compiler_rt fails, no mechanism to
                    link libc.so
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nsz at port70.net
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified
-rtlib is ignored after -nostdlib:
$ clang -nostdlib -rtlib=compiler-rt t.c -o t
clang-3.6: warning: argument unused during compilation: '-rtlib=compiler-rt'
$ clang --version
clang version 3.6.2 (tags/RELEASE_362/final)
Target: armv6-alpine-linux-muslgnueabihf
this makes it impossible to link libc.so which must use -nostdlib,
but has to be linked against the right compiler runtime.
there seems to be no way to discover (e.g. in a configure script) how to
link to the right clang compiler runtime (this is most likely necessary
for other freestanding code too, not just the c runtime).
(the problem persists on trunk and target independent.)
on gcc one can use either of
gcc -nostdlib t.c -lgcc
gcc -nostdlib t.c `gcc -print-file-name=libgcc.a`
clang should either accept -rtlib or needs a similar mechanism
to -print-file-name, in fact there are patches proposed along
those lines:
http://reviews.llvm.org/D10049
http://reviews.llvm.org/D10050
http://reviews.llvm.org/D10051
http://reviews.llvm.org/D10052
-- 
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/20151014/c441b0a9/attachment.html>
    
    
More information about the llvm-bugs
mailing list