-
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
iOS stdlib / universal library regression #34617
Comments
I did a local build and reverting 59db95b did indeed fix the problem. |
After some more digging & experimentation I believe the current situation is as follows:
|
Gah this is almost guaranteed to be related to the PR that switched to CMake. It was also the reason we didn't have nightlies for so long! So as I think you've discovered we actively don't pass cflags to the ios builds of compiler-rt because compiler-rt is a little over-aggressive and applies a ton of its own flags to the build, which I thought included the ios ones but apparently don't! Unfortunately builds will fail if we pass Note that ios support in the cmake build system of compiler-rt seems experimental at best, so it sounds like to fix this we're gonna have to patch something rather than continue to jump through hoops for compiler-rt. |
Yeah, thats what I figured. I sadly don't have much experience with either the whole iOS compiling / linking intricacies or cmake / makefiles. I've been attempting to fiddle with the compiler-rt cmake files a little but so far no success. However the compiler-rt CMake / iOS (Simulator) build seems to be definitely broken, since a build for the simulator target
(notice how the MacOSX SDK is used, the correctone would be Targeting a "real" iOS architecture produces:
|
So I managed a patch for I have not yet done a complete build of rust with this patch (only The patch can be found at rust-lang/compiler-rt@rust-2016-06-16...TimNN:fixing-stuff. |
@TimNN that looks good to me! |
What is the process of integrating that patch into (the rust fork of) I plan on adding some documentation to the patch / commit and doing a full build of rust as a last test later today. Also, while this patch works for ios(sim), it probably breaks stuff for watchos / tvos (which hopefully doesn't matter that much since they are not supported (at least not officially) as far as I know). |
--- Workaround --- The REF_OS variable was introduced to workaround linking problems when compiler-rt is build for the iOS simulator. Without this workaround, trying to link compiler-rt into an executable for the iOS simulator would produce an error like ld: warning: URGENT: building for iOS simulator, but linking in object file built for OSX. Note: This will be an error in the future. The underlying reason is that the iOS simulator specific configuration is stored in variables named like DARWIN_iossim_SYSROOT and not DARWIN_macho_embedded_SYSROOT. Thus, with the current setup, compiler-rt would be compiled against the OS X SDK and not the iPhone Simulator SDK. As a workaround we manually override macho_embedded with iossim when accessing the DARWIN_*_SYSROOT and DARWIN_*_BUILTIN_MIN_VER_FLAG variables. This workaround probably break builds of compiler-rt for the watchOS and tvOS simulators (if they weren't broken already). See also rust-lang/rust#34617.
@alexcrichton I (force) pushed a new commit to the linked branch which adds a bit of documentation to the workaround. I also did full local build of rust and verified that the patch fixes the original problem. The patch commit is rust-lang/compiler-rt@2ab4911. |
--- Workaround --- The REF_OS variable was introduced to workaround linking problems when compiler-rt is build for the iOS simulator. Without this workaround, trying to link compiler-rt into an executable for the iOS simulator would produce an error like ld: warning: URGENT: building for iOS simulator, but linking in object file built for OSX. Note: This will be an error in the future. The underlying reason is that the iOS simulator specific configuration is stored in variables named like DARWIN_iossim_SYSROOT and not DARWIN_macho_embedded_SYSROOT. Thus, with the current setup, compiler-rt would be compiled against the OS X SDK and not the iPhone Simulator SDK. As a workaround we manually override macho_embedded with iossim when accessing the DARWIN_*_SYSROOT and DARWIN_*_BUILTIN_MIN_VER_FLAG variables. This workaround probably break builds of compiler-rt for the watchOS and tvOS simulators (if they weren't broken already). See also rust-lang/rust#34617.
Ah it's pretty easy, just sending a PR to the right branch of rust-lang/compiler-rt
Yeah that's fine, no worries there.
Awesome! I've gone ahead and cherry-picked that into our branch. Want to send a PR to rust-lang/rust updating the compiler-rt submodule? |
Sure, I'll send the PR to update the submodule. |
Update compiler-rt with iOS linking warnings workaround Closes #34617. r? @alexcrichton
--- Workaround --- The REF_OS variable was introduced to workaround linking problems when compiler-rt is build for the iOS simulator. Without this workaround, trying to link compiler-rt into an executable for the iOS simulator would produce an error like ld: warning: URGENT: building for iOS simulator, but linking in object file built for OSX. Note: This will be an error in the future. The underlying reason is that the iOS simulator specific configuration is stored in variables named like DARWIN_iossim_SYSROOT and not DARWIN_macho_embedded_SYSROOT. Thus, with the current setup, compiler-rt would be compiled against the OS X SDK and not the iPhone Simulator SDK. As a workaround we manually override macho_embedded with iossim when accessing the DARWIN_*_SYSROOT and DARWIN_*_BUILTIN_MIN_VER_FLAG variables. This workaround probably break builds of compiler-rt for the watchOS and tvOS simulators (if they weren't broken already). See also rust-lang/rust#34617.
Originally reported at TimNN/cargo-lipo#3.
The following issue occurs on
nightly-2016-07-02
but not onnightly-2016-06-24
, I suspect the regression was caused by #34055. Related: #29664.Creating a universal library for all iOS targets and linking it in XCode produces the following warnings when targeting a simulator, but not when targeting the real device:
As I understand the situation:
compiler-rt
-mios-simulator-version-min=7.0
to the appropriate toolscompiler-rt
, however I believe that the standard library is still build with that flag because there would be more warnings / errors otherwisenightly-2016-06-24
forcompiler-rt
makes Convert makefiles to build LLVM/compiler-rt with CMake #34055 look like the likeliest candidate to have caused this regression (sadly there are no nightlies available between the two, which makes narrowing it down further very inconvenient).The text was updated successfully, but these errors were encountered: