Exclude setjmp runtime from LTO (#529)

This fixes errors like:
```
wasm-ld: error: /Volumes/PortableSSD/git/wasi-sdk/build/install/bin/../share/wasi-sysroot/lib/wasm32-wasi/llvm-lto/19.1.0-wasi-sdk/libsetjmp.a(rt.o): attempt to add bitcode file after LTO (__wasm_longjmp)
```

Note: Any symbol that the compiler might generate at bitcode compile
time either need to be unconditionally included at LTO time, or not
built as LTO. This is because LTO object files cannot be added to the
link after LTO time.
This commit is contained in:
YAMAMOTO Takashi 2024-08-28 08:42:48 +09:00 committed by GitHub
parent 230d4be6c5
commit 8279f9591a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -264,6 +264,7 @@ LIBC_TOP_HALF_MUSL_SOURCES = \
LIBC_NONLTO_SOURCES = \
$(addprefix $(LIBC_TOP_HALF_MUSL_SRC_DIR)/, \
exit/atexit.c \
setjmp/wasm32/rt.c \
)
ifeq ($(WASI_SNAPSHOT), p2)