[llvm-bugs] [Bug 40412] New: Unconvertable type leads to invalid WebAssembly

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 22 12:40:11 PST 2019


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

            Bug ID: 40412
           Summary: Unconvertable type leads to invalid WebAssembly
           Product: libraries
           Version: trunk
          Hardware: Other
                OS: other
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: dan433584 at gmail.com
                CC: llvm-bugs at lists.llvm.org

On this C++ testcase:


class c;

template<class> class basic_streambuf {
  virtual c seekoff(unsigned);
};

basic_streambuf<char> x;


Clang produces LLVM IR for wasm32 containing this:

@_ZTV15basic_streambufIcE = linkonce_odr hidden unnamed_addr constant { [3 x
i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }*
@_ZTI15basic_streambufIcE to i8*), i8* bitcast (void ()*
@_ZN15basic_streambufIcE7seekoffEj to i8*)] }, comdat, align 4

declare void @_ZN15basic_streambufIcE7seekoffEj() unnamed_addr


seekoff's argument types don't match the types in the C++ source file, which
causes wasm-ld to ultimately complain about the signature mismatch.

This is a reduced form of code in libcxx which causes wasm-ld to complain when
linking C++ programs:

wasm-ld: warning: function signature mismatch:
_ZNSt3__115basic_streambufIwNS_11char_traitsIwEEE7seekoffExNS_8ios_base7seekdirEj
>>> defined as (i32, i32, i64, i32, i32) -> void in [...]/libc++.a(ios.cpp.obj)
>>> defined as () -> void in [...]/libc++.a(iostream.cpp.obj)

-- 
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/20190122/84bd474f/attachment.html>


More information about the llvm-bugs mailing list