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

Linking in Emscripten >= 3.1.52 doesn't work #633

Closed
bz-next opened this issue Feb 5, 2024 · 4 comments
Closed

Linking in Emscripten >= 3.1.52 doesn't work #633

bz-next opened this issue Feb 5, 2024 · 4 comments

Comments

@bz-next
Copy link

bz-next commented Feb 5, 2024

I think the issue is analogous to emscripten-core/emscripten#21128

The cube example builds with emscripten 3.1.51, but on 3.1.52 and above, I get the following error during linking of Release/bin/magnum-primitives.js

[100%] Linking CXX executable Release/bin/magnum-primitives.js
Release/lib/MagnumSdl2Application.bc:1:2: error: expected integer
    1 | !<arch>
      |  ^
1 error generated.
em++: error: '/home/user/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default --sysroot=/home/user/emsdk/upstream/emscripten/cache/sysroot -DEMSCRIPTEN -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -DNDEBUG -O3 -flto -O3 -DNDEBUG -O3 -flto Release/lib/MagnumSdl2Application.bc -c -o /tmp/emscripten_temp_zy0k2l8p/MagnumSdl2Application_0.o' failed (returned 1)
make[2]: *** [CMakeFiles/magnum-primitives.dir/build.make:112: Release/bin/magnum-primitives.js] Error 1
make[1]: *** [CMakeFiles/Makefile2:762: CMakeFiles/magnum-primitives.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
@mosra
Copy link
Owner

mosra commented Feb 5, 2024

Ugh, this one is annoying. I don't see why would they want to change a behavior that worked well for a decade...

But what can I do 😅 I'll have to update all my Emscripten toolchains and builds to not use *.bc but *.a instead and ensure everything reflects that. It'll take a while for this to propagate to all repos, and I don't really have time to do such a sweeping change at the moment. Is it fine if this waits a bit, can you stay on 3.1.51 for now? (It'll bite me as soon as I have 3.1.52 in Arch repos, so it will get fixed eventually, just not now.)

@mosra mosra added this to the 2023.0a milestone Feb 5, 2024
@bz-next
Copy link
Author

bz-next commented Feb 5, 2024

Of course, no worries. It seems like anything tangentially related to web or js is doomed to break randomly anyway :) Just thought you should know!

@mosra
Copy link
Owner

mosra commented Feb 5, 2024

Oh yeah, thanks for that!

Emscripten breaks a lot and very often, so this is something to be aware of. Basically every other upgrade breaks something, last time it was with 3.1.49 in 8048b65. So ideally on your side if possible you pin to some particular Emscripten version and upgrade only when you feel like you need to, or when you have a lot of extra time on your hands :D

@mosra mosra changed the title Magnum cube example won't build with emscripten >= 3.1.52 Linking in Emscripten >= 3.1.52 doesn't work Feb 5, 2024
@mosra
Copy link
Owner

mosra commented Feb 17, 2024

This is fixed with mosra/toolchains@7c5e504, update of the submodule in Magnum repos will follow soon as well.

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

No branches or pull requests

2 participants