-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Cross compilation to iOS simulator requires a special flag "out of the box" #29664
Comments
Sample errors: https://travis-ci.org/danburkert/memmap-rs/jobs/89613721
|
|
Interesting, I wasn't aware that rust binaries can't run on ios. What is the libc test doing, then? I guess the best I can do for memmap in light of this is to just make sure it compiles. |
Hm yeah so for the i386/x86_64 iOS targets I do believe that generating a binary is possible (it's what liblibc is doing). In that sense it seems preferable to not forbid it? I'm mostly curious as well if we can A) not require passing this flag |
I'd reframe it a bit: there is no easy way to run binaries on simulator and/or on non-jailbroken device. It's See below.
Yep, it's possible, but you can't use it anyway without a bit of manual interaction. As far as I understood from logs this error happens during linking "build" script. Let's consider it succeeds - So the proper "workaround" is to disable building build script (sorry for tautology) at all, for example like this (in
And maybe similar patches (for all ios targets) will be required for other win32 related crates which use build scripts. |
Could you clarify this? For the libc tests, we just run the binary that was generated (e.g. The relevant link error here is not for build script as those are always compiled for the host (although the logs here may have more errors) but rather for the binary itself (e.g. what's built from |
To be honest - it was a surprise for me, I believe it wasn't possible before or I didn't try hard enough earlier. I've created a test C app, tried to run - and failed. The primary reason was that it seems Xcode used to link against Still is that even after linking to simulator libraries, here is the output of runing
As a resume - yep, I was wrong, it is possible to run a binary if it doesn't link any UI-related frameworks. The question remains is if host system libraries (as I believe they'll be used without applying any magic) are functionally equal to simulator ones (quick check - binaries differ). They should, but there is still a room for an unexpected surprise.
Hmm, log clearly says that it is build script or I'm looking to a wrong log:
|
If this isn't really supposed to work or only works by accident then I'm fine closing this out, it sounds like at the very least this is super non-standard! Ah and by not for the build script I meant moreso that the travis logs linked here erroneously compiled the build script with the extra flags when in fact it should only have been passed to the final binary. |
triage: libc still passing this flag today |
Just to clarify, what's blocking this issue? What kind of decision needs to be made and by whom? Asking because a similar
This damages the out-of-box experience for cross-compilation users. Thanks. |
Triage: It could probably be re-added though, |
Currently, for example, the
libc
crate passes a special flag to the linker, specifically the-mios-simulator-version-min
flag. Note that our build system does the same thing.cc @vhbit, would it be reasonable for rustc to just pass this flag by default? I'm not sure what the version represents, but it'd be awesome to get this "just working" out of the box!
The text was updated successfully, but these errors were encountered: