libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.22k stars 1.82k forks source link

Compiling with emscripten version 3.1.52 does not work #16160

Open ethanaobrien opened 8 months ago

ethanaobrien commented 8 months ago

(see https://github.com/emscripten-core/emscripten/issues/21128)

As said in the title, Compiling with emscripten version 3.1.52 does not work because the emscripten compiler actually checks to see if input files are what they are now (https://github.com/emscripten-core/emscripten/pull/20922) (It appears the initial emscripten port was incorrect in that field)

Before I went and did anything I wanted input on what should be done. There are 2 options from my point of view

  1. State compiling with emscripten 3.1.52 and up is not supported. Though note this will quickly make the emscripten builds outdated and isnt optimal for the long term
  2. Enable static linking for all cores, and properly name the files .a as emscripten expects, as well as change the targets in the makefile and dist-cores script

In my project (EmulatorJS) I have chosen the second option, since I try to stay with up to date emscripten, but wanted input before I went and submited about 20 prs.

Thanks!

JoeOsborn commented 8 months ago

Ahhhh, I wish I had thought about this when I filed PRs to bring cores up to date with Emscripten 3.1.29’s build process. It might be easier to patch the makefile to rename the bc file to a .a suffix , though I suppose thats’s a bit of a hack.

Are you on the retroarch discord? I’m also doing a project using emscripten-compiled RA + cores. Happy to chat/share notes anytime.

ethanaobrien commented 8 months ago

It might be easier to patch the makefile to rename the bc file to a .a suffix , though I suppose thats’s a bit of a hack.

I attempted this originally, though static linking is not set consistently across cores. Some cores build a real .bc file while some just build a .a file

What I was thinking was opening a pr in each core that emscripten supports, and opening a pr here, listing all those prs are dependencies

Are you on the retroarch discord? I’m also doing a project using emscripten-compiled RA + cores. Happy to chat/share notes anytime.

I don't join discord servers too often, so I'm not in it, though it would be interesting to chat with you. There are a few things I'd like to make available on the web that you might know more than i do about.

JoeOsborn commented 8 months ago

Interesting, I thought all emscripten cores used static linking (if any don’t that might be a bug, since emscripten doesn’t really support dynamic linking that well). And a lot of the pipeline does seem to assume archive files are coming in. Which ones are you seeing produce actual bc files?

One thing I learned about RA’s CI pipeline is that if any cores don’t compile cleanly the whole platform doesn’t get released, so coordinating with @LibretroAdmin is really important for these ecosystem level changes.

ethanaobrien commented 8 months ago

Interesting, I thought all emscripten cores used static linking

Nope. About half don't actually - since it doesn't actually check the input file type I didn't even know this.

Which ones are you seeing produce actual bc files?

I don't have a full list with me, though you can check through the repos mentioned here and see which cores I've had to enable it on. I can say the only core I missed enabling static linking on was Gearcoleco and was quite surprised when I found out it was disabled.

if any cores don’t compile cleanly the whole platform doesn’t get released

Exactly why I opened this issue :)