-
Notifications
You must be signed in to change notification settings - Fork 3.4k
-s USE_XXX should accept -lXXX #8650
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
Comments
The I recently re-worked the ports so at least they have the correct names (libfoo.a).. but the name of the actual library produced by the port is still currently and implementation default and passing I kind of agree with your though, it would be nice some day to be able to consume ports simply by passing |
Are you saying that it used to work to pass |
From a porter PoV, I That's what I think it makes sense for The issue is indeed all the more present with #8461 - as emcc used to warn in the past, and now fails. I can pass |
Yes, its seems that this has always been an issue just hidden by the fact that ERROR_ON_MISSING_LIBRARIES used default to false. I suggest you add ERROR_ON_MISSING_LIBRARIES=0 to get the old behaviour until we can come up with a more elegant solution. |
|
No I still don't think ERROR_ON_MISSING_LIBRARIES is the right solution here. @Beuc, why can't you remove |
In the long run it would be nice to make |
That's because, as I explained above, this is not a trivial project, but I'm interacting with moderately complex build systems, this concerns -lz but also -lSDL2* and -lfreetype, and it's more of a work-around to patch-up the various build systems than it is to make dummy .a libs. |
By the way, my idea of an elegant solution would be a simple include/ & lib/ hierarchy where ports would be installed (or symlinked/copied on demand). Something like https://mxe.cc/ does for cross-compiling to windows. It would silently add |
I think we are already moving in exactly that direction: #9353. Hopefully we will get there sooner rather than later. |
There are two problems emscripten faces that not all crosstools face:
|
Currently the ports do require write access to build and install the port, I wouldn't change that. Similarly MXC builds in $(checkout-path)/usr/bin. It doesn't matter to me if the ports are installed in a specific location, as a porter/cross-compiler I'm used to that. If we want to enable/disable them on demand the ports would probably reside not in Emscripten's global sysroot, but in a throw-away root (though it seems you may not want to keep that). Your second point makes rethink my workflow the other way around: currently my root issue is I'm stuck with the SDL2 port because the official SDL2 version sadly lags behind (I used to install the official SDL2 in my build root, until it became incompatible with the current emscripten). |
This seems to be causing me trouble with Rust. I want to use a Rust SDL2 wrapper crate (see https://puddleofcode.com/story/definitive-guide-to-rust-sdl2-and-emscriptem, I'm roughly copying that guide), but it causes Of course, that crate has not been designed with Emscripten in mind, so the solution may just be to modify that crate (I may well do so at some point!). But it is a shame that Emscripten can't “just work” here. |
As a workaround, you should be able to create an empty (or mostly-empty) |
@Brion Hey, I think that worked (— at least, it made it compile!), thanks so much for the suggestion! |
@hikari-no-yume I'd like to play around with this and see if I can improve this experience. Can you share your project or describe how to reproduce the issue? |
@tlively Unfortunately I am not able to share the code right now (much as I'd like to), but I was roughly following this guide: https://puddleofcode.com/story/definitive-guide-to-rust-sdl2-and-emscriptem Basically, use the Rust |
It looks like #9983 fixes this issue! |
Yup! Thanks. |
Oh, cool, thank you! But why does it fix it? |
Because it puts the directory where the ports get installed to on the library path and include path. |
Hi,
I get a lot of errors like in my builds with 1.38.32 such as:
This is quite puzzling.
It would make sense for emcc to accept
-lXXX
when using a built-in port-s USE_XXX
.The text was updated successfully, but these errors were encountered: