% ./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)
%
the same program works ok with -flto=full and w/o LTO.
the same symptom with Clang from LLVM 46435ac19e09039fb146fa6c12da0e640a66d435
a test code: https://github.com/yamt/garbage/tree/1deee3044926115ca949e4cc7056da819c118663/lto3
symptom:
the same program works ok with
-flto=full
and w/o LTO.the same symptom with Clang from LLVM 46435ac19e09039fb146fa6c12da0e640a66d435