Skip to content

Commit b932a12

Browse files
committed
Fix lto0.test_longjmp_standalone_standalone. NFC
As part of emscripten-core#21502 some assertions were added to the wasm SjLj helpers. Because calls to these functions can be generated during LTO we exclude compiler-rt from LTO and always build it as normal object files. Because these normal object files could be pulled in after LTO takes place, they cannot themsleves refer to LTO objects. Sadly `assert` referees to printf and stdout stuff which is compiled as LTO. This leads the failures we are currently setting for lto0.test_longjmp_standalone_standalone: ``` wasm-ld: error: /usr/local/google/home/sbc/dev/wasm/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc-debug.a(stderr.o): attempt to add bitcode file after LTO (__stderr_FILE) wasm-ld: error: /usr/local/google/home/sbc/dev/wasm/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc-debug.a(fprintf.o): attempt to add bitcode file after LTO (fprintf) ``` Building with `-DNDEBUG` works around this issue by not actually including the assert code. Its also more correct to do so for compiler-rt which is not a debug library.
1 parent d72d722 commit b932a12

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ jobs:
550550
lto2.test_dylink_syslibs_all
551551
lto2.test_float_builtins
552552
lto0.test_exceptions_allowed_uncaught
553+
lto0.test_longjmp_standalone_standalone
553554
core3
554555
core2g.test_externref
555556
corez.test_dylink_iostream

tools/system_libs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ class libcompiler_rt(MTLibrary, SjLjLibrary):
923923
# restriction soon: https://reviews.llvm.org/D71738
924924
force_object_files = True
925925

926-
cflags = ['-fno-builtin']
926+
cflags = ['-fno-builtin', '-DNDEBUG']
927927
src_dir = 'system/lib/compiler-rt/lib/builtins'
928928
includes = ['system/lib/libc']
929929
# gcc_personality_v0.c depends on libunwind, which don't include by default.

0 commit comments

Comments
 (0)