Skip to content

Add target triple arm-apple-darwin for cross-compiling to iOS #10203

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 1, 2013
Merged

Add target triple arm-apple-darwin for cross-compiling to iOS #10203

merged 1 commit into from
Nov 1, 2013

Conversation

kud1ing
Copy link

@kud1ing kud1ing commented Oct 31, 2013

This is based on the work by @dobkeratops, updated and extended to work for Xcode 5.

This gets you going. I will add separate PRs for compilation/linking fixes.
See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios

@@ -193,6 +193,35 @@ CFG_LDPATH_i686-unknown-linux-gnu :=
CFG_RUN_i686-unknown-linux-gnu=$(2)
CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2))

# arm-apple-darwin configuration
CFG_IOS_VERSION=7.0
CFG_IOS_TOOLS=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be using something like xcode-select -p to get the path to the Developer folder? This also seems like it'd make a good variable in all the related CFG_IOS_FLAGS below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the tool paths we may want xcrun -find -sdk iphoneos clang etc. and xcrun --show-sdk-path -sdk iphoneos for the SDK path.
Can we use back ticks or something similar like in shells here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that make has $(shell cmd) to be able to run commands, although you'd need to be careful because we probably shouldn't be executing xcrun on things like linux system.s

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe guarding it in ifeq ($(shell uname -s),Darwin)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of forking more processes, I'd recommend looking at CFG_HOST and it's derived variables as well.

@brson
Copy link
Contributor

brson commented Oct 31, 2013

Exciting developments!

@alexcrichton
Copy link
Member

This looks like if you attempt to target arm-apple-darwin on a non-osx system, you'll get past ./configure and probably die horribly in make. Is that ok to happen? I'm not sure how comprehensive our support for android is (does it also die horribly on misconfigurations?). I think I'm ok with this, but targeting those platforms is hair enough as-is so it may be difficult.

Perhaps it would be nice to put a check in ./configure to print an error if you attempt to configure a target of arm-apple-darwin and the host is not something-apple-darwin?

@kud1ing
Copy link
Author

kud1ing commented Oct 31, 2013

@alexcrichton: rebased

@dobkeratops
Copy link

Great to see someone else trying this... would be curious to know if the issues i'd run into are any easier now

@kud1ing
Copy link
Author

kud1ing commented Nov 1, 2013

Having less C++ today helps a bit. Some issues remain, but other projects have faced them, too.
I think we can solve it. Thanks for having started this.

bors added a commit that referenced this pull request Nov 1, 2013
This is based on the work by @dobkeratops, updated and extended to work for Xcode 5.

This gets you going. I will add separate PRs for compilation/linking fixes.
See also https://github.com/mozilla/rust/wiki/Doc-building-for-ios
@bors bors closed this Nov 1, 2013
@bors bors merged commit 5864ad9 into rust-lang:master Nov 1, 2013
@kud1ing kud1ing deleted the ios branch November 1, 2013 18:36
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 23, 2023
Suppress the triggering of some lints in derived structures

Fixes rust-lang#10185
Fixes rust-lang#10417

For `integer_arithmetic`, `arithmetic_side_effects` and `shadow_reuse`.

* ~~Not sure how to test these use-cases so feel free to point any method or any related PR.~~

---

changelog: FP: [`integer_arithmetic`], [`arithmetic_side_effects`]: No longer lint inside proc macros
[rust-lang#10203](rust-lang/rust-clippy#10203)
<!-- changelog_checked -->
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants