| Issue |
91711
|
| Summary |
thin LTO + wasm + _Thread_local + -pthread doesn't work well
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
yamt
|
a test code: https://github.com/yamt/garbage/tree/1deee3044926115ca949e4cc7056da819c118663/lto3
symptom:
```shell
spacetanuki% ./build.sh
+ CC='/opt/wasi-sdk-22.0/bin/clang -Os -flto=thin -pthread -target wasm32-wasi-threads'
+ /opt/wasi-sdk-22.0/bin/clang -Os -flto=thin -pthread -target wasm32-wasi-threads -c a.c
+ /opt/wasi-sdk-22.0/bin/clang -Os -flto=thin -pthread -target wasm32-wasi-threads -c main.c
+ /opt/wasi-sdk-22.0/bin/clang -Os -flto=thin -pthread -target wasm32-wasi-threads main.o a.o
wasm-ld: error: --shared-memory is disallowed by lto.tmp because it was not compiled with 'atomics' or 'bulk-memory' features.
wasm-ld: error: lto.tmp: relocation R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against non-TLS symbol `x`
wasm-ld: error: lto.tmp: relocation R_WASM_MEMORY_ADDR_TLS_SLEB cannot be used against `x` in non-TLS section: .bss
clang: error: linker command failed with exit code 1 (use -v to see invocation)
spacetanuki%
```
the same program works ok with -flto=full and w/o lto.
the same symptom with clang from LLVM 46435ac19e09039fb146fa6c12da0e640a66d435
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs