diff options
-rw-r--r-- | .travis.yml | 12 | ||||
-rw-r--r-- | ci/ios/deploy_and_run_on_ios_simulator.rs | 1 | ||||
-rw-r--r-- | libc-test/build.rs | 67 | ||||
-rw-r--r-- | src/unix/bsd/apple/mod.rs | 12 | ||||
-rw-r--r-- | src/unix/mod.rs | 1 |
5 files changed, 66 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml index da3124db08..164c258041 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,10 +41,10 @@ matrix: - env: TARGET=i686-unknown-linux-gnu - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 - osx_image: xcode8.3 + osx_image: xcode9.4 - os: osx env: TARGET=i686-apple-darwin - osx_image: xcode8.3 + osx_image: xcode9.4 - env: TARGET=arm-linux-androideabi - env: TARGET=aarch64-linux-android # FIXME(#826) should reenable @@ -59,14 +59,14 @@ matrix: # FIXME(#856) rust: 1.22.1 - os: osx - osx_image: xcode8.2 + osx_image: xcode9.4 env: TARGET=i386-apple-ios CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0 before_install: rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest - os: osx - osx_image: xcode8.2 + osx_image: xcode9.4 env: TARGET=x86_64-apple-ios CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0 @@ -91,7 +91,7 @@ matrix: rust: beta - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 - osx_image: xcode8.3 + osx_image: xcode9.4 rust: beta # nightly @@ -99,7 +99,7 @@ matrix: rust: nightly - os: osx env: TARGET=x86_64-apple-darwin NO_ADD=1 - osx_image: xcode8.3 + osx_image: xcode9.4 rust: nightly # not available on stable # without --release the build fails diff --git a/ci/ios/deploy_and_run_on_ios_simulator.rs b/ci/ios/deploy_and_run_on_ios_simulator.rs index b14615036d..95df52d76d 100644 --- a/ci/ios/deploy_and_run_on_ios_simulator.rs +++ b/ci/ios/deploy_and_run_on_ios_simulator.rs @@ -123,6 +123,7 @@ fn run_app_on_simulator() { .arg("com.rust.unittests") .output()); + println!("status: {}", output.status); println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout)); println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr)); diff --git a/libc-test/build.rs b/libc-test/build.rs index 6c2ac5496e..d46372b44b 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -15,6 +15,7 @@ fn main() { let linux = target.contains("unknown-linux"); let android = target.contains("android"); let apple = target.contains("apple"); + let ios = target.contains("apple-ios"); let emscripten = target.contains("asm"); let musl = target.contains("musl") || emscripten; let uclibc = target.contains("uclibc"); @@ -84,8 +85,10 @@ fn main() { cfg.header("sys/socket.h"); } cfg.header("net/if.h"); - cfg.header("net/route.h"); - cfg.header("net/if_arp.h"); + if !ios { + cfg.header("net/route.h"); + cfg.header("net/if_arp.h"); + } cfg.header("netdb.h"); cfg.header("netinet/in.h"); cfg.header("netinet/ip.h"); @@ -113,7 +116,7 @@ fn main() { cfg.header("pwd.h"); cfg.header("grp.h"); cfg.header("sys/utsname.h"); - if !solaris { + if !solaris && !ios { cfg.header("sys/ptrace.h"); } cfg.header("sys/mount.h"); @@ -175,19 +178,22 @@ fn main() { cfg.header("util.h"); cfg.header("xlocale.h"); cfg.header("sys/xattr.h"); - cfg.header("sys/sys_domain.h"); - cfg.header("net/if_utun.h"); - cfg.header("net/bpf.h"); - if target.starts_with("x86") { + if target.starts_with("x86") && !ios { cfg.header("crt_externs.h"); } - cfg.header("net/route.h"); - cfg.header("netinet/if_ether.h"); cfg.header("netinet/in.h"); - cfg.header("sys/proc_info.h"); - cfg.header("sys/kern_control.h"); cfg.header("sys/ipc.h"); cfg.header("sys/shm.h"); + + if !ios { + cfg.header("sys/sys_domain.h"); + cfg.header("net/if_utun.h"); + cfg.header("net/bpf.h"); + cfg.header("net/route.h"); + cfg.header("netinet/if_ether.h"); + cfg.header("sys/proc_info.h"); + cfg.header("sys/kern_control.h"); + } } if bsdlike { @@ -449,6 +455,17 @@ fn main() { // header conflicts when including them with all the other structs. "termios2" => true, + // Present on historical versions of iOS but missing in more recent + // SDKs + "bpf_hdr" | + "proc_taskinfo" | + "proc_taskallinfo" | + "proc_bsdinfo" | + "proc_threadinfo" | + "sockaddr_inarp" | + "sockaddr_ctl" | + "arphdr" if ios => true, + _ => false } }); @@ -594,6 +611,30 @@ fn main() { // shouldn't be used in code anyway... "AF_MAX" | "PF_MAX" => true, + // Present on historical versions of iOS, but now removed in more + // recent SDKs + "ARPOP_REQUEST" | + "ARPOP_REPLY" | + "ATF_COM" | + "ATF_PERM" | + "ATF_PUBL" | + "ATF_USETRAILERS" | + "AF_SYS_CONTROL" | + "SYSPROTO_EVENT" | + "PROC_PIDTASKALLINFO" | + "PROC_PIDTASKINFO" | + "PROC_PIDTHREADINFO" | + "UTUN_OPT_FLAGS" | + "UTUN_OPT_IFNAME" | + "BPF_ALIGNMENT" | + "SYSPROTO_CONTROL" if ios => true, + s if ios && s.starts_with("RTF_") => true, + s if ios && s.starts_with("RTM_") => true, + s if ios && s.starts_with("RTA_") => true, + s if ios && s.starts_with("RTAX_") => true, + s if ios && s.starts_with("RTV_") => true, + s if ios && s.starts_with("DLT_") => true, + _ => false, } }); @@ -736,6 +777,10 @@ fn main() { // FIXME: mincore is defined with caddr_t on Solaris. "mincore" if solaris => true, + // These were all included in historical versions of iOS but appear + // to be removed now + "system" | "ptrace" if ios => true, + _ => false, } }); diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 4849d7f0f5..cf48528b4a 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -765,16 +765,8 @@ pub const VM_FLAGS_SUPERPAGE_MASK: ::c_int = 0x70000; pub const VM_FLAGS_RETURN_DATA_ADDR: ::c_int = 0x100000; pub const VM_FLAGS_RETURN_4K_DATA_ADDR: ::c_int = 0x800000; pub const VM_FLAGS_ALIAS_MASK: ::c_int = 0xFF000000; -pub const VM_FLAGS_USER_ALLOCATE: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | - VM_FLAGS_PURGABLE | - VM_FLAGS_RANDOM_ADDR | - VM_FLAGS_NO_CACHE | - VM_FLAGS_OVERWRITE | - VM_FLAGS_SUPERPAGE_MASK | - VM_FLAGS_ALIAS_MASK; -pub const VM_FLAGS_USER_MAP: ::c_int = VM_FLAGS_USER_ALLOCATE | - VM_FLAGS_RETURN_4K_DATA_ADDR | - VM_FLAGS_RETURN_DATA_ADDR; +pub const VM_FLAGS_USER_ALLOCATE: ::c_int = 0xff07401b; +pub const VM_FLAGS_USER_MAP: ::c_int = 0xff97401b; pub const VM_FLAGS_USER_REMAP: ::c_int = VM_FLAGS_FIXED | VM_FLAGS_ANYWHERE | VM_FLAGS_RANDOM_ADDR | VM_FLAGS_OVERWRITE | diff --git a/src/unix/mod.rs b/src/unix/mod.rs index d0e054cc27..d180dd51eb 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -931,6 +931,7 @@ extern { pub fn openlog(ident: *const ::c_char, logopt: ::c_int, facility: ::c_int); pub fn closelog(); pub fn setlogmask(maskpri: ::c_int) -> ::c_int; + #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")] pub fn syslog(priority: ::c_int, message: *const ::c_char, ...); #[cfg_attr(all(target_os = "macos", target_arch = "x86"), link_name = "nice$UNIX2003")] |