You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Emscripten version 3.1.52 static linking broken #21128
It looks like the libretro_emscripten.bc file is actually a static library so should be probably be named .a?
I'm curious to know what emcc command caused this error though, and to figure out which emscripten change caused this change in behaviour. Could you run the failing make command with VERBOSE=1 (or V=1.. whatever makes it show you the failing command)? (The error here is only showing the failing clang command, not the outer emcc command that was run).
Looks like #20922 is almost certainly what caused this change. Technically I think its good change since it makes emcc match clang's behaviour. If you pass a .bc file to clang it will try to compile it, before passing it to the linker. If you pass .a archive named with the .bc extension it will fail, and emcc now does the same time.
Hopefully it should be easy enough to fix the file extension here? If this problem is very widespread we should consider reverting.
If you pass .a archive named with the .bc extension it will fail, and emcc now does the same time.
Renaming the make target for the linker mixed this (libretro_emscripten.bc -> libretro_emscripten.a) fixed this
Hopefully it should be easy enough to fix the file extension here?
Seems to be, though does this check happen everywhere? My snes9x_libretro_emscripten.bc file contains the same header and renaming to have a.a extension changes nothing (does not error with .bc) (though it appears it goes through some middle man on my end?) nevermind. I completely missed the line of code where libretro_emscripten.bc is just the snes9x file renamed, so not too hard to patch
If I rename libopenFrameworks.bc to libopenFrameworks.a in the config file I get this error: em++: error: /mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.a: Unknown format, not a static library!
What does file /mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.bc report? (i.e. what type of file is it actually?)
Can you attach the /mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.bc file to this ticket perhaps?
Removing the check should work. But its still best to give the file the correct extension as a general principle.
The that file is designed to be an ar archive then its being built wrong somehow. If its supposed of be a single object file it should probably have the .o extension and should not have the lib prefix.
Activity
sbc100 commentedon Jan 22, 2024
It looks like the
libretro_emscripten.bcfile is actually a static library so should be probably be named.a?I'm curious to know what emcc command caused this error though, and to figure out which emscripten change caused this change in behaviour. Could you run the failing
makecommand withVERBOSE=1(orV=1.. whatever makes it show you the failing command)? (The error here is only showing the failing clang command, not the outer emcc command that was run).sbc100 commentedon Jan 22, 2024
Looks like #20922 is almost certainly what caused this change. Technically I think its good change since it makes emcc match clang's behaviour. If you pass a
.bcfile to clang it will try to compile it, before passing it to the linker. If you pass.aarchive named with the.bcextension it will fail, and emcc now does the same time.Hopefully it should be easy enough to fix the file extension here? If this problem is very widespread we should consider reverting.
ethanaobrien commentedon Jan 22, 2024
Renaming the make target for the linker mixed this (
libretro_emscripten.bc->libretro_emscripten.a) fixed thisSeems to be, though does this check happen everywhere? Mynevermind. I completely missed the line of code where libretro_emscripten.bc is just the snes9x file renamed, so not too hard to patchsnes9x_libretro_emscripten.bcfile contains the same header and renaming to have a.aextension changes nothing (does not error with.bc) (though it appears it goes through some middle man on my end?)ethanaobrien commentedon Jan 22, 2024
Sorry... it was supposed to be
V=1sbc100 commentedon Jan 22, 2024
Glad you were able to fix. Hopefully this doesn't bite any other folks.
[-]Emscripten version 2.1.52 static linking broken[/-][+]Emscripten version 3.1.52 static linking broken[/+]Jonathhhan commentedon Mar 11, 2024
I have the same issue with Open Frameworks. Since 3.1.52 I get this error:
If I rename
libopenFrameworks.bctolibopenFrameworks.ain the config file I get this error: em++: error:/mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.a: Unknown format, not a static library!Any idea how to solve this? Thanks!
sbc100 commentedon Mar 11, 2024
What does
file /mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.bcreport? (i.e. what type of file is it actually?)Can you attach the
/mnt/c/Users/Jonat/Desktop/openFrameworks-audioWorklet-3/libs/openFrameworksCompiled/lib/emscripten/libopenFrameworks.bcfile to this ticket perhaps?sbc100 commentedon Mar 11, 2024
Oh wait.. I can see that the file is actually a Wasm file. In that case perhaps just call is
.o(since its likely an object file).Do you now how that file was built?
Jonathhhan commentedon Mar 11, 2024
@sbc100 thank you very much.
That is the (old) config file: https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk
Yes, it works again, if I compile it as an
o.file. There is a another precompiled.bclib (pugixml) in Open Frameworks, if I ignore that in addition, it does work again (will open an issue for that in the Open Frameworks repo). I guess, pugixml needs to be compiled as an object file, too?Jonathhhan commentedon Mar 11, 2024
@sbc100 will removing the check for
.afiles make the .bc files work again, or do I still need to compile them as.o?sbc100 commentedon Mar 11, 2024
Removing the check should work. But its still best to give the file the correct extension as a general principle.
The that file is designed to be an
ararchive then its being built wrong somehow. If its supposed of be a single object file it should probably have the.oextension and should not have thelibprefix.Remove check for file type of `.a` files. NFC
Jonathhhan commentedon Mar 11, 2024
@sbc100 thanks.
Remove check for file type of `.a` files. NFC (#21513)
Merge upstream 3.1.56 (#64)