[llvm-bugs] [Bug 39743] New: llvm's handling of 'llvm.linker.options' is incompatible with how clang uses it and causes crashes when building on linux

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 21 11:30:20 PST 2018


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

            Bug ID: 39743
           Summary: llvm's handling of 'llvm.linker.options' is
                    incompatible with how clang uses it and causes crashes
                    when building on linux
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: akyrtzi at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21138
  --> https://bugs.llvm.org/attachment.cgi?id=21138&action=edit
test files

Changes in r323783
(https://llvm.org/viewvc/llvm-project?view=revision&revision=323783) introduced
handling of 'llvm.linker.options' to pass linker options on ELF but the
expected format is incompatible with how clang was already emitting
'llvm.linker.options' for module linker options per r305227
(https://llvm.org/viewvc/llvm-project?view=revision&revision=305227).
The result is that clang crashes on linux when using '-fmodules' and a module
map uses auto-link.

To reproduce use the attached test files. When running clang on linux you'll
see this:

fatal error: error in backend: invalid llvm.linker.options

clang will emit this llvm IR:

!llvm.linker.options = !{!0}
!0 = !{!"-lsomelib"}

which will be rejected due to TargetLoweringObjectFileELF::emitModuleMetadata()
expecting a (key, value) pair instead.

This was tested using TOT llvm (r347143) and clang (r347141)

-- 
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/20181121/f1dd41a7/attachment.html>


More information about the llvm-bugs mailing list