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

Support -lSDL2_mixer and others #12589

Closed
kripken opened this issue Oct 23, 2020 · 3 comments · Fixed by #12633
Closed

Support -lSDL2_mixer and others #12589

kripken opened this issue Oct 23, 2020 · 3 comments · Fixed by #12633

Comments

@kripken
Copy link
Member

kripken commented Oct 23, 2020

Background: emscripten-ports/SDL2_mixer#2

Things like -lSDL2 work because the internal library name matches the flag. But SDL2_mixer has a different internal name, with _ogg as a suffix, which prevents this.

The internal name is important as we build a different SDL2_mixer depending on the codecs. But it makes simple link flags not work.

It would be good to make such link flags just work, perhaps by mapping -l names to the internal ones. This would require some changes in emcc.py and related code's handling of link flag libraries, and maybe also the ports code itself like tools/ports/sdl2_mixer.py.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 23, 2020

One possiblity it so have many different version of libSDL2_mixer.a but have the directory name distinguish them.

So

  • ogg/libSDL2_mixer.a
  • ogg_mp3/libSDL2_mixer.a

Then SDL2_MIXER_OGG would add -L<path_to_system_libs>/ogg to the library path?

Basically would move variant from the library name to the library path.

@Beuc
Copy link
Contributor

Beuc commented Oct 24, 2020

I confirm this broke my pygame_sdl2 build.
wasm-ld: error: unable to find library -lSDL2_mixer

However I have troubles determining when that broke. My build worked in 2.0.2 but the related SDL2_mixer changes seem to predate.

@sbc100
Copy link
Collaborator

sbc100 commented Oct 24, 2020

I believe it was when SDL_mixer to split into multiple different libraries with different names. Maybe #11577? But yes that would have been way back in 1.39.20.

You say it worked for you in 2.0.2, can you check 2.0.3?

kripken added a commit that referenced this issue Oct 28, 2020
kripken added a commit that referenced this issue Oct 30, 2020
This did not just work because we build libSDL2_mixer_ogg etc., with a suffix
for the codecs we build in. This PR adds an explicit mapping to handle such
cases.

Also improve the test to check this, and add a lot more checks there, like that
we don't use SDL1 somehow (which can happen with files like this where the
SDL1 and SDL2 APIs agree, and so SDL2 does not need to be linked in to
get a running executable).

Fixes #12589
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

Successfully merging a pull request may close this issue.

3 participants