Build failure with ASan shells and cranelift
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | affected |
People
(Reporter: gkw, Unassigned)
Details
Compiling asan (with --enable-address-sanitizer) with js shells with cranelift (i.e. without --disable-cranelift) fails on m-c rev tip 0b014ee5cd51
Compiling failure v0.1.3
Compiling baldrdash v0.1.0 (/home/fuzz3/trees/mozilla-central/js/src/wasm/cranelift)
Compiling serde_json v1.0.26
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/fuzz3/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unk
= note: /usr/bin/ld: /home/fuzz3/shell-cache/js-dbg-64-dm-asan-linux-x86_64-0b014ee5cd51/objdir-js/debug/deps/liblibloading-32e3106fdd3b0910.rlib(glob
/home/fuzz3/trees/mozilla-central/third_party/rust/libloading/src/os/unix/global_static.c:10: undefined reference to `__asan_handle_no_return'
/usr/bin/ld: /home/fuzz3/shell-cache/js-dbg-64-dm-asan-linux-x86_64-0b014ee5cd51/objdir-js/debug/deps/liblibloading-32e3106fdd3b0910.rlib(glob
/home/fuzz3/trees/mozilla-central/third_party/rust/libloading/src/os/unix/global_static.c:18: undefined reference to `__asan_handle_no_return'
/usr/bin/ld: /home/fuzz3/shell-cache/js-dbg-64-dm-asan-linux-x86_64-0b014ee5cd51/objdir-js/debug/deps/liblibloading-32e3106fdd3b0910.rlib(glob
global_static.c:(.text.asan.module_ctor+0x2): undefined reference to `__asan_init'
/usr/bin/ld: global_static.c:(.text.asan.module_ctor+0x7): undefined reference to `__asan_version_mismatch_check_v8'
collect2: error: ld returned 1 exit status
Command to be run:
'CC="clang -fsanitize=address"' AR=ar 'CXX="clang++ -fsanitize=address"' sh ./configure --enable-debug --enable-more-deterministic --enable-address-sanitizer --disable-jemalloc --with-ccache --enable-gczeal --enable-debug-symbols --disable-tests
:bbouvier mentioned over email that there might be "flags that should be passed to the Cranelift build and are not getting passed, when ASAN support is enabled".
Alas, Benjamin's going to be away on PTO for a few weeks and Nathan isn't going to be back for a couple more days, so setting needinfo? from Lars as a start. Feel free to punt, though. For now, I'll set disable cranelift with ASan builds.
![]() |
Reporter | |
Comment 1•6 years ago
|
||
The corresponding error on macOS is:
= note: Undefined symbols for architecture x86_64:
"___asan_init", referenced from:
_asan.module_ctor in liblibloading-b033c52a0a62a377.rlib(global_static.o)
"___asan_version_mismatch_check_apple_1001", referenced from:
_asan.module_ctor in liblibloading-b033c52a0a62a377.rlib(global_static.o)
"___asan_handle_no_return", referenced from:
_rust_libloading_dlerror_mutex_lock in liblibloading-b033c52a0a62a377.rlib(global_static.o)
_rust_libloading_dlerror_mutex_unlock in liblibloading-b033c52a0a62a377.rlib(global_static.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Not sure if this is related, and I'm not sure whether Windows builds (with ASan and cranelift) are supported either.
Comment 2•6 years ago
|
||
Can you please try without -fsanitize=address
in your CC and CXX variables? This flag is not supposed to be there.
Updated•6 years ago
|
![]() |
Reporter | |
Comment 3•6 years ago
|
||
decoder's suggestion works for me instead. Historically both worked, but I guess not having -fsanitize=address
in CC/CXX variables is the canonical way forward.
Description
•