[llvm-bugs] [Bug 33155] New: LLD does not find system libraries on NetBSD

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 24 09:12:22 PDT 2017


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

            Bug ID: 33155
           Summary: LLD does not find system libraries on NetBSD
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: NetBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: n54 at gmx.com
                CC: llvm-bugs at lists.llvm.org

Clang with LLD cannot build any executable that uses regular system libraries.

$ cat test.c                                                                    
#include <stdio.h>
int main(int argc, char **argv)
{
        printf("Hello world!\n");
        return 0;
}

$ clang -v -fuse-ld=lld test.c 
clang version 5.0.0 (trunk)
Target: x86_64-unknown-netbsd7.99
Thread model: posix
InstalledDir: /usr/pkg/bin
 "/usr/pkg/bin/clang-5.0" -cc1 -triple x86_64-unknown-netbsd7.99 -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name test.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/pkg/lib/clang/5.0.0 -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 157 -fobjc-runtime=gnustep -fdiagnostics-show-option
-fcolor-diagnostics -o /var/tmp/test-24ce18.o -x c test.c
clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target
x86_64-unknown-netbsd7.99
#include "..." search starts here:
#include <...> search starts here:
 /usr/pkg/lib/clang/5.0.0/include
 /usr/include
End of search list.
 "/usr/pkg/bin/ld.lld" --eh-frame-hdr -dynamic-linker /libexec/ld.elf_so -o
a.out /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o
/var/tmp/test-24ce18.o -lc /usr/lib/crtend.o /usr/lib/crtn.o
/usr/pkg/bin/ld.lld: error: unable to find library -lc
clang-5.0: error: linker command failed with exit code 1 (use -v to see
invocation)

LLVM+Clang+LLD SVN r. 303743 (pre 5.0.0)

It's not a recent regression, it was that since ever I was trying to use it.


For the comparison GNU ld(1) works

$ clang -v -fuse-ld=ld test.c   
clang version 5.0.0 (trunk)
Target: x86_64-unknown-netbsd7.99
Thread model: posix
InstalledDir: /usr/pkg/bin
 "/usr/pkg/bin/clang-5.0" -cc1 -triple x86_64-unknown-netbsd7.99 -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name test.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -resource-dir
/usr/pkg/lib/clang/5.0.0 -fdebug-compilation-dir /tmp -ferror-limit 19
-fmessage-length 157 -fobjc-runtime=gnustep -fdiagnostics-show-option
-fcolor-diagnostics -o /var/tmp/test-a8fc54.o -x c test.c
clang -cc1 version 5.0.0 based upon LLVM 5.0.0svn default target
x86_64-unknown-netbsd7.99
#include "..." search starts here:
#include <...> search starts here:
 /usr/pkg/lib/clang/5.0.0/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld.elf_so -o a.out
/usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o /var/tmp/test-a8fc54.o -lc
/usr/lib/crtend.o /usr/lib/crtn.o

-- 
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/20170524/1e9888c5/attachment-0001.html>


More information about the llvm-bugs mailing list