[llvm-bugs] [Bug 38184] New: ThinLTO duplicates WebAssembly custom sections

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jul 16 13:33:13 PDT 2018


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

            Bug ID: 38184
           Summary: ThinLTO duplicates WebAssembly custom sections
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: alex at crichton.co
                CC: dan433584 at gmail.com, llvm-bugs at lists.llvm.org

We've recently upgraded to LLVM 7 in the Rust compiler and have started seeing
some odd behavior on WebAssembly combined with ThinLTO. We're using LLVM's
`wasm.custom_sections` metadata to create custom sections, but the encoding via
a MDNode seems to cause ThinLTO passes to duplicate it accidentally.

Specifically what we're seeing is that we've got two modules A and B. We define
a wasm custom section metadata node in module A, but if B imports some
functions from A during the ThinLTO passes then it will *also* import the named
MDNode instances from A, causing both A and B to have wasm custom sections
defined.

I believe the relevant code is around here --
https://github.com/llvm-mirror/llvm/blob/e5c7b32694a7580b9e7fcd0f1654ac205fc4eea0/lib/Linker/IRMover.cpp#L1105-L1117.
Would it be possible to add a special case there to ignore the
wasm.custom_section metadata? Or should we be preventing this through some
other means?

-- 
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/20180716/21f02786/attachment.html>


More information about the llvm-bugs mailing list