forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Doc building for ios
kud1ing edited this page Nov 1, 2013
·
77 revisions
This currently does not work.
rustc foo.rs -o foo.stage2 -O --save-temps
llc -march=c foo.bc -o foo.c
TODO: something using rustc --emit-llvm -S --target=arm-linux-androideabi
-
add an
arm-apple-darwin
target triple to mk/platform.mk. This is fixed in https://github.com/mozilla/rust/pull/10203 -
Adjust src/rt/rust_builtin.cpp:
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <mach/mach_time.h>
#if defined(TARGET_OS_IPHONE)
extern char **environ;
#else
#include <crt_externs.h>
#endif
#endif
and
rust_env_pairs() {
#ifdef __APPLE__ && !defined(TARGET_OS_IPHONE)
char **environ = *_NSGetEnviron();
#endif
- Adjust src/rt/arch/arm/_context.S:
.align 2
TODO: this needs a guard which makes sures, this is affects only ARM and/or iOS
- Adjust src/rt/arch/arm/record_sp.S:
.align 2
TODO: this needs a guard which makes sures, this is affects only ARM and/or iOS
- Build Rust:
mkdir build; cd build
../configure --target-triples=arm-apple-darwin
make VERBOSE=1
Fails with
src/libuv/include/uv-errno.h:25:10: fatal error: 'errno.h' file not found
- Use Rust:
rustc --target=arm-apple-darwin foo.rs
- Compilation:
- Compile twice, with both
-arch armv7
and-arch armv7s
(A6 processor) ?
- Compile twice, with both
- Code: