[llvm-bugs] [Bug 52338] New: target-features are not preserved in LTO object files that contain no functions
llvm-bugs at lists.llvm.org
Thu Oct 28 15:52:02 PDT 2021
Bug ID: 52338
Summary: target-features are not preserved in LTO object files
that contain no functions
Component: Backend: WebAssembly
Assignee: unassignedbugs at nondot.org
Reporter: sbc at chromium.org
CC: llvm-bugs at lists.llvm.org
LLVM target features are attached to functions, so if there are no functions in
a given TU then the resulting LTO object file will not include any
For native object files problem does not occurs.
The problem arrises, for example, in emscripten when one does
$ emcc -s SIDE_MODULE -O2 -fPIC empty.c
wasm-ld: error: mutable global imported but 'mutable-globals' feature not
present in inputs: `__stack_pointer`. Use --no-check-features to suppress.
This is because clang injects the mutable-globals features when
`RelocationModel == llvm::Reloc::PIC_`, but when there is no function in the
object file this information is lost, and then when the LTO/bitcode object is
compiled it lacks this feature.
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs