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

            Bug ID: 43211
           Summary: [wasm] __import_module__, __import_name__ attributes
                    do not work with -flto
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedb...@nondot.org
          Reporter: alonza...@gmail.com
                CC: llvm-bugs@lists.llvm.org

extern void foo() __attribute__((__import_module__("module"),
__import_name__("base")));

int main() {
  foo();
}

Building with say

emcc a.cpp -s ERROR_ON_UNDEFINED_SYMBOLS=0 -g

the output contains

 (import "module" "base" (func $foo\28\29))

However, adding -flto to that command breaks things - it now imports as

 (import "env" "_Z3foov" (func $foo\28\29))

Perhaps the attributes information is supported in wasm object files but not in
LLVM bitcode files?

This affects wasi which uses those attributes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to