[llvm-bugs] [Bug 42802] New: lld errors out on -L/usr/lib

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jul 28 06:58:27 PDT 2019


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

            Bug ID: 42802
           Summary: lld errors out on -L/usr/lib
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bero at lindev.ch
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

On an OpenMandriva x86_64 system (where x86_64 libraries live in /usr/lib64 and
i686 libraries live in /usr/lib), trying to link any x86_64 application while
-L/usr/lib is in the compiler flags [which, of course, is wrong, but happens to
be accepted by ld.bfd and ld.gold - they skip the bogus files in /usr/lib and
find the correct files in default search paths] results in

$ clang -o test test.c
$ clang -o test test.c -L/usr/lib -fuse-ld=bfd
$ clang -o test test.c -L/usr/lib -fuse-ld=gold
$ clang -o test test.c -L/usr/lib
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crt1.o
is incompatible with elf_x86_64
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crti.o
is incompatible with elf_x86_64
ld: error: /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/crtbegin.o
is incompatible with elf_x86_64
ld: error: /tmp/test-549d3a.o is incompatible with elf_x86_64
ld: error: /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/crtend.o
is incompatible with elf_x86_64
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crtn.o
is incompatible with elf_x86_64
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)


Aside from the fact that it probably shouldn't error out at all, the error
message is wrong -- the crt*.o files are the ones in lib64 that are compatible
with elf_x86_64.

-- 
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/20190728/1c095001/attachment.html>


More information about the llvm-bugs mailing list