Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link error after #17401 merge #20049

Open
riidefi opened this issue Aug 16, 2023 · 3 comments
Open

Link error after #17401 merge #20049

riidefi opened this issue Aug 16, 2023 · 3 comments

Comments

@riidefi
Copy link

riidefi commented Aug 16, 2023

After #19700 was merged, I have been getting the following link error. It appears my sys cache is filled with outdated dependencies? Is there a way to evict them? I am on tot, if that is problematic.

Version of emscripten/emsdk:
I'm on tot.

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.45-git (8ab7b6d34a53113551fd211c0dd1ea37d2bac2d3)
clang version 18.0.0 (https://github.com/llvm/llvm-project 64473f1221fbc16af140407d5ea64d808f5853a7)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\Users\rii\Documents\dev\emsdk\upstream\bin

Failing command line in full:

[13/19] Linking CXX executable source\cli\rszst.js
FAILED: source/cli/rszst.js
cmd.exe /C "cd . && C:\Users\rii\Documents\dev\emsdk\upstream\emscripten\em++.bat -O3 -DNDEBUG  source/cli/CMakeFiles/cli.dir/Cli.cpp.o source/cli/CMakeFiles/cli.dir/Rszst.cpp.o -o source\cli\rszst.js  source/core/libcore.a  source/librii/liblibrii.a  source/oishii/liboishii.a  source/rsl/librsl.a  source/plate/libplate.a  source/plugins/libplugins.a  source/vendor/libvendor.a  source/rsmeshopt/librsmeshopt.a  source/librii/liblibrii.a  source/oishii/liboishii.a  source/plate/libplate.a  source/rsmeshopt/librsmeshopt.a  _deps/meshoptimizer-build/libmeshoptimizer.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libassimp.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libIrrXML.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlib.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlibstatic.a  libgctex.a  libavir_rs.a  libc_wbz.a  libszs.a  source/rsl/librsl.a  source/vendor/libvendor.a  libriistudio_rs.a  source/LibBadUIFramework/libLibBadUIFramework.a  source/core/libcore.a  _deps/fmt-build/libfmt.a  librszst_arg_parser.a && cmd.exe /C "cd /D C:\Users\rii\Documents\dev\RiiStudio\web\source\cli && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy_directory C:/Users/rii/Documents/dev/RiiStudio/source/cli/../../fonts C:/Users/rii/Documents/dev/RiiStudio/web/source/cli/fonts""
wasm-ld: warning: function signature mismatch: timegm
>>> defined as (i32) -> i32 in libriistudio_rs.a(time-d99d02750d05dc5e.time.cab54c5c5860e8ca-cgu.1.rcgu.o)
>>> defined as (i32) -> i64 in C:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc.a(mktime.o)

wasm-ld: warning: function signature mismatch: mktime
>>> defined as (i32) -> i32 in libriistudio_rs.a(time-d99d02750d05dc5e.time.cab54c5c5860e8ca-cgu.1.rcgu.o)
>>> defined as (i32) -> i64 in C:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc.a(mktime.o)

wasm-ld: error: libgctex.a(std-7c3b3f7689bc1c83.std.5a4bd94f5fe922c7-cgu.0.rcgu.o): undefined symbol: open64
em++: error: 'C:/Users/rii/Documents/dev/emsdk/upstream/bin\wasm-ld.exe -o source\cli\rszst.wasm source/cli/CMakeFiles/cli.dir/Cli.cpp.o source/cli/CMakeFiles/cli.dir/Rszst.cpp.o source/core/libcore.a source/librii/liblibrii.a source/oishii/liboishii.a source/rsl/librsl.a source/plate/libplate.a source/plugins/libplugins.a source/vendor/libvendor.a source/rsmeshopt/librsmeshopt.a source/librii/liblibrii.a source/oishii/liboishii.a source/plate/libplate.a source/rsmeshopt/librsmeshopt.a _deps/meshoptimizer-build/libmeshoptimizer.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libassimp.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libIrrXML.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlib.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlibstatic.a libgctex.a libavir_rs.a libc_wbz.a libszs.a source/rsl/librsl.a source/vendor/libvendor.a libriistudio_rs.a source/LibBadUIFramework/libLibBadUIFramework.a source/core/libcore.a _deps/fmt-build/libfmt.a librszst_arg_parser.a -LC:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr C:\Users\rii\AppData\Local\Temp\tmp22m889e3libemscripten_js_symbols.so --strip-debug --export-if-defined=main --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-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --global-base=1024' failed (returned 1)
ninja: build stopped: subcommand failed.

Full link command and output with -v appended:

em++ -O3 -DNDEBUG  source/cli/CMakeFiles/cli.dir/Cli.cpp.o source/cli/CMakeFiles/cli.dir/Rszst.cpp.o -o source\cli\rszst.js  source/core/libcore.a  source/librii/liblibrii.a  source/oishii/liboishii.a  source/rsl/librsl.a  source/plate/libplate.a  source/plugins/libplugins.a  source/vendor/libvendor.a  source/rsmeshopt/librsmeshopt.a  source/librii/liblibrii.a  source/oishii/liboishii.a  source/plate/libplate.a  source/rsmeshopt/librsmeshopt.a  _deps/meshoptimizer-build/libmeshoptimizer.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libassimp.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libIrrXML.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlib.a  C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlibstatic.a  libgctex.a  libavir_rs.a  libc_wbz.a  libszs.a  source/rsl/librsl.a  source/vendor/libvendor.a  libriistudio_rs.a  source/LibBadUIFramework/libLibBadUIFramework.a  source/core/libcore.a  _deps/fmt-build/libfmt.a  librszst_arg_parser.a -v
 "C:/Users/rii/Documents/dev/emsdk/upstream/bin\clang.exe" --version
 "C:/Users/rii/Documents/dev/emsdk/upstream/bin\wasm-ld.exe" -o source\cli\rszst.wasm source/cli/CMakeFiles/cli.dir/Cli.cpp.o source/cli/CMakeFiles/cli.dir/Rszst.cpp.o source/core/libcore.a source/librii/liblibrii.a source/oishii/liboishii.a source/rsl/librsl.a source/plate/libplate.a source/plugins/libplugins.a source/vendor/libvendor.a source/rsmeshopt/librsmeshopt.a source/librii/liblibrii.a source/oishii/liboishii.a source/plate/libplate.a source/rsmeshopt/librsmeshopt.a _deps/meshoptimizer-build/libmeshoptimizer.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libassimp.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libIrrXML.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlib.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlibstatic.a libgctex.a libavir_rs.a libc_wbz.a libszs.a source/rsl/librsl.a source/vendor/libvendor.a libriistudio_rs.a source/LibBadUIFramework/libLibBadUIFramework.a source/core/libcore.a _deps/fmt-build/libfmt.a librszst_arg_parser.a -LC:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr C:\Users\rii\AppData\Local\Temp\tmpf8kshzzwlibemscripten_js_symbols.so --strip-debug --export-if-defined=main --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-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --global-base=1024
wasm-ld: warning: function signature mismatch: timegm
>>> defined as (i32) -> i32 in libriistudio_rs.a(time-d99d02750d05dc5e.time.cab54c5c5860e8ca-cgu.1.rcgu.o)
>>> defined as (i32) -> i64 in C:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc.a(mktime.o)

wasm-ld: warning: function signature mismatch: mktime
>>> defined as (i32) -> i32 in libriistudio_rs.a(time-d99d02750d05dc5e.time.cab54c5c5860e8ca-cgu.1.rcgu.o)
>>> defined as (i32) -> i64 in C:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\libc.a(mktime.o)

wasm-ld: error: libgctex.a(std-7c3b3f7689bc1c83.std.5a4bd94f5fe922c7-cgu.0.rcgu.o): undefined symbol: open64
em++: error: 'C:/Users/rii/Documents/dev/emsdk/upstream/bin\wasm-ld.exe -o source\cli\rszst.wasm source/cli/CMakeFiles/cli.dir/Cli.cpp.o source/cli/CMakeFiles/cli.dir/Rszst.cpp.o source/core/libcore.a source/librii/liblibrii.a source/oishii/liboishii.a source/rsl/librsl.a source/plate/libplate.a source/plugins/libplugins.a source/vendor/libvendor.a source/rsmeshopt/librsmeshopt.a source/librii/liblibrii.a source/oishii/liboishii.a source/plate/libplate.a source/rsmeshopt/librsmeshopt.a _deps/meshoptimizer-build/libmeshoptimizer.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libassimp.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libIrrXML.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlib.a C:/Users/rii/Documents/dev/RiiStudio/source/librii/../vendor/assimp/libzlibstatic.a libgctex.a libavir_rs.a libc_wbz.a libszs.a source/rsl/librsl.a source/vendor/libvendor.a libriistudio_rs.a source/LibBadUIFramework/libLibBadUIFramework.a source/core/libcore.a _deps/fmt-build/libfmt.a librszst_arg_parser.a -LC:\Users\rii\Documents\dev\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr C:\Users\rii\AppData\Local\Temp\tmpf8kshzzwlibemscripten_js_symbols.so --strip-debug --export-if-defined=main --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-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export-table -z stack-size=65536 --initial-memory=16777216 --max-memory=16777216 --no-entry --global-base=1024' failed (returned 1)
@sbc100
Copy link
Collaborator

sbc100 commented Aug 16, 2023

Are you sure #19700 is to blame here? That change only changed the signature of some internal functions.. nothing public. Perhaps it was #17401 which actually changed the definition of time_t itself?

In any case libc.a here is correct. The problem is that libriistudio_rs.a needs to be rebuilt. Did you build that library yourself? Can you force a rebuild? (BTW I would recommend rebuilding all dependencies whenever you update emsdk).

@riidefi riidefi changed the title Link error after #19700 merge Link error after #17401 merge Aug 17, 2023
@riidefi
Copy link
Author

riidefi commented Aug 17, 2023

In any case libc.a here is correct. The problem is that libriistudio_rs.a needs to be rebuilt. Did you build that library yourself? Can you force a rebuild? (BTW I would recommend rebuilding all dependencies whenever you update emsdk).

This is a fresh build, which is the confusing part. I am on nightly rust as well--is it possible the rust standard library just has not been updated to account for this change yet? What older version of emscripten should I go down to to revert this time_t change?

@sbc100
Copy link
Collaborator

sbc100 commented Aug 17, 2023

time_t was changed in 3.1.16.. so going back to 3.1.15 will give you 32-bit time_t once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants