Skip to content

Undefined symbols __stack_high and __stack_low #19282

Description

@willcohen

Now that nix has LLVM 15 available, I'm trying to get emscripten to 3.1.30. Nix emscripten precompiles all of libc etc in all variants for caching, which causes the build to fail due to #18057 (see log below). Do you have a sense of if I need to somehow additionally provide __stack_high and __stack_low to emcc accordingly, or does this mean that nix needs to fix its LLVM environment more generally? Per the PR, it seems like this was supposed to be a behind-the-scenes change.

cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a" for subsequent builds)
system_libs:INFO: compiled 175 inputs
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc++-noexcept.a... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc++-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 48 inputs
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libc++abi-debug-noexcept.a... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libc++abi-debug-noexcept.a" for subsequent builds)
system_libs:INFO: compiled 16 inputs
cache:INFO:  - ok
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/lto/libsockets.a... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libsockets.a" for subsequent builds)
system_libs:INFO: compiled 21 inputs
cache:INFO:  - ok
cache:INFO: generating system asset: symbol_lists/f8cec6923d2e3e34f6340a748a3754531fdda931.txt... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/symbol_lists/f8cec6923d2e3e34f6340a748a3754531fdda931.txt" for subsequent builds)
cache:INFO: generating system asset: sysroot/lib/wasm32-emscripten/struct_info.json... (this will be cached in "/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/struct_info.json" for subsequent builds)
cache:INFO:  - ok
cache:INFO:  - ok
wasm-ld: error: /nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a(stack_limits.o): undefined symbol: __stack_high
wasm-ld: error: /nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/libcompiler_rt.a(stack_limits.o): undefined symbol: __stack_low
emcc: error: '/nix/store/9r7fl3yf66ygmc072laxnbjdv20jrmss-emscripten-llvm-3.1.30/bin/wasm-ld -o a.out.wasm /private/tmp/nix-build-emscripten-3.1.30.drv-0/emscripten_temp_hlqdi0xn/test_0.o -L/nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto /nix/store/xrwl9qs67178cwrszilavssx32dxkwbh-emscripten-3.1.30/share/emscripten/cache/sysroot/lib/wasm32-emscripten/lto/crt1.o -lGL -lal -lhtml5 -lstandalonewasm -lstubs-debug -lc-debug -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-debug-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined-file=/private/tmp/nix-build-emscripten-3.1.30.drv-0/tmpl6h6wlk7.undefined --strip-debug --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --stack-first' failed (returned 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions