[llvm-bugs] [Bug 35414] New: WASM backend cannot build libcxx - fails on .text.__startup section

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 24 10:42:39 PST 2017


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

            Bug ID: 35414
           Summary: WASM backend cannot build libcxx - fails on
                    .text.__startup section
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: ncw at realvnc.com
                CC: llvm-bugs at lists.llvm.org

Another problem found from building libcxx.  This time, it fails generating a
WASM data section.

fatal error: error in backend: only data supported in data sections
clang-6.0: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 6.0.0 (trunk 318652)
Target: wasm32-unknown-unknown-wasm
Thread model: single
InstalledDir: /home/ncw/workspace/llvm/llvm/bld/bin
clang-6.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.


I've isolated the problem, down to a minimal example that focuses on the use of
function pointers in the ".text.__startup" section.

I'll have a look at seeing how to integrate this with LLD - perhaps via
emitting a custom section that contains a list of the function indices to put
together into a generated section, or maybe simply putting in a named WASM
"data" section that contain the indices into the allfuncs table, for use by
libc to run them during the entry-point.

Has anyone decided what the WASM ABI for this is going to be?


=== Minimal example ===

extern void extFn();

struct TestData {
  TestData() { extFn(); }
} testData;

void expFn() {}

-- 
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/20171124/759d3c09/attachment.html>


More information about the llvm-bugs mailing list