Skip to content

Commit 2ef910f

Browse files
committed
auto merge of #14715 : vhbit/rust/ios-pr2, r=alexcrichton
2 parents 6d8342f + 2ec323e commit 2ef910f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+803
-229
lines changed

Diff for: mk/platform.mk

+68-28
Original file line numberDiff line numberDiff line change
@@ -155,36 +155,76 @@ CFG_LDPATH_i686-unknown-linux-gnu :=
155155
CFG_RUN_i686-unknown-linux-gnu=$(2)
156156
CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2))
157157

158-
# arm-apple-darwin configuration
159-
ifeq ($(CFG_OSTYPE),apple-darwin)
158+
# arm-apple-ios configuration
159+
CFG_SDK_NAME_arm-apple-ios = iphoneos
160+
CFG_SDK_ARCHS_arm-apple-ios = armv7
161+
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
160162
CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
161-
CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I$(CFG_IOS_SDK)/usr/include -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
162-
CC_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang)
163-
CXX_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
164-
CPP_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
165-
AR_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos ar)
166-
CFG_LIB_NAME_arm-apple-darwin = lib$(1).dylib
167-
CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib
168-
CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM
169-
CFG_CFLAGS_arm-apple-darwin := $(CFG_IOS_FLAGS) $(CFLAGS)
170-
CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) $(CFLAGS)
171-
CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS) $(CXXFLAGS)
172-
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
173-
CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list,
174-
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin :=
175-
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-darwin :=
176-
CFG_DEF_SUFFIX_arm-apple-darwin := .darwin.def
177-
CFG_LLC_FLAGS_arm-apple-darwin :=
178-
CFG_INSTALL_NAME_arm-apple-darwin = -Wl,-install_name,@rpath/$(1)
179-
CFG_LIBUV_LINK_FLAGS_arm-apple-darwin =
180-
CFG_EXE_SUFFIX_arm-apple-darwin :=
181-
CFG_WINDOWSY_arm-apple-darwin :=
182-
CFG_UNIXY_arm-apple-darwin := 1
183-
CFG_PATH_MUNGE_arm-apple-darwin := true
184-
CFG_LDPATH_arm-apple-darwin :=
185-
CFG_RUN_arm-apple-darwin = $(2)
186-
CFG_RUN_TARG_arm-apple-darwin = $(call CFG_RUN_arm-apple-darwin,,$(2))
163+
CFG_IOS_FLAGS = -target armv7-apple-darwin -isysroot $(CFG_IOS_SDK) -mios-version-min=7.0
164+
CC_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang)
165+
CXX_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang++)
166+
CPP_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang++)
167+
AR_arm-apple-ios = $(shell xcrun -find -sdk iphoneos ar)
187168
endif
169+
CFG_LIB_NAME_arm-apple-ios = lib$(1).a
170+
CFG_LIB_GLOB_arm-apple-ios = lib$(1)-*.a
171+
CFG_STATIC_LIB_NAME_arm-apple-ios=lib$(1).a
172+
CFG_LIB_DSYM_GLOB_arm-apple-ios = lib$(1)-*.a.dSYM
173+
CFG_CFLAGS_arm-apple-ios := -arch armv7 -mfpu=vfp3 $(CFG_IOS_FLAGS)
174+
CFG_GCCISH_CFLAGS_arm-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) -mfpu=vfp3 -arch armv7
175+
CFG_GCCISH_CXXFLAGS_arm-apple-ios := -fno-rtti $(CFG_IOS_FLAGS) -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
176+
CFG_GCCISH_LINK_FLAGS_arm-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK) -Wl,-no_compact_unwind
177+
CFG_GCCISH_DEF_FLAG_arm-apple-ios := -Wl,-exported_symbols_list,
178+
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-ios :=
179+
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-ios :=
180+
CFG_DEF_SUFFIX_arm-apple-ios := .darwin.def
181+
CFG_LLC_FLAGS_arm-apple-ios := -mattr=+vfp3,+v7,+thumb2,+neon -march=arm
182+
CFG_INSTALL_NAME_arm-apple-ios = -Wl,-install_name,@rpath/$(1)
183+
CFG_LIBUV_LINK_FLAGS_arm-apple-ios =
184+
CFG_EXE_SUFFIX_arm-apple-ios :=
185+
CFG_WINDOWSY_arm-apple-ios :=
186+
CFG_UNIXY_arm-apple-ios := 1
187+
CFG_PATH_MUNGE_arm-apple-ios := true
188+
CFG_LDPATH_arm-apple-ios :=
189+
CFG_RUN_arm-apple-ios = $(2)
190+
CFG_RUN_TARG_arm-apple-ios = $(call CFG_RUN_arm-apple-ios,,$(2))
191+
RUSTC_FLAGS_arm-apple-ios := -C relocation_model=pic
192+
RUSTC_CROSS_FLAGS_arm-apple-ios :=-C relocation_model=pic
193+
194+
# i386-apple-ios configuration
195+
CFG_SDK_NAME_i386-apple-ios = iphonesimulator
196+
CFG_SDK_ARCHS_i386-apple-ios = i386
197+
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
198+
CFG_IOSSIM_SDK = $(shell xcrun --show-sdk-path -sdk iphonesimulator 2>/dev/null)
199+
CFG_IOSSIM_FLAGS = -target i386-apple-ios -isysroot $(CFG_IOSSIM_SDK) -mios-simulator-version-min=7.0
200+
CC_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang)
201+
CXX_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang++)
202+
CPP_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang++)
203+
AR_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator ar)
204+
endif
205+
CFG_LIB_NAME_i386-apple-ios = lib$(1).a
206+
CFG_LIB_GLOB_i386-apple-ios = lib$(1)-*.dylib
207+
CFG_STATIC_LIB_NAME_i386-apple-ios=lib$(1).a
208+
CFG_LIB_DSYM_GLOB_i386-apple-ios = lib$(1)-*.dylib.dSYM
209+
CFG_CFLAGS_i386-apple-ios = $(CFG_IOSSIM_FLAGS)
210+
CFG_GCCISH_CFLAGS_i386-apple-ios = -Wall -Werror -g -fPIC -m32 $(CFG_IOSSIM_FLAGS)
211+
CFG_GCCISH_CXXFLAGS_i386-apple-ios = -fno-rtti $(CFG_IOSSIM_FLAGS) -I$(CFG_IOSSIM_SDK)/usr/include/c++/4.2.1
212+
CFG_GCCISH_LINK_FLAGS_i386-apple-ios = -lpthread -Wl,-no_compact_unwind -m32 -Wl,-syslibroot $(CFG_IOSSIM_SDK)
213+
CFG_GCCISH_DEF_FLAG_i386-apple-ios = -Wl,-exported_symbols_list,
214+
CFG_GCCISH_PRE_LIB_FLAGS_i386-apple-ios =
215+
CFG_GCCISH_POST_LIB_FLAGS_i386-apple-ios =
216+
CFG_DEF_SUFFIX_i386-apple-ios = .darwin.def
217+
CFG_LLC_FLAGS_i386-apple-ios =
218+
CFG_INSTALL_NAME_i386-apple-ios = -Wl,-install_name,@rpath/$(1)
219+
CFG_LIBUV_LINK_FLAGS_i386-apple-ios =
220+
CFG_EXE_SUFFIX_i386-apple-ios =
221+
CFG_WINDOWSY_i386-apple-ios =
222+
CFG_UNIXY_i386-apple-ios = 1
223+
CFG_PATH_MUNGE_i386-apple-ios = true
224+
CFG_LDPATH_i386-apple-ios =
225+
CFG_RUN_i386-apple-ios = $(2)
226+
CFG_RUN_TARG_i386-apple-ios = $(call CFG_RUN_i386-apple-ios,,$(2))
227+
CFG_JEMALLOC_CFLAGS_i386-apple-ios = -target i386-apple-ios -Wl,-syslibroot $(CFG_IOSSIM_SDK) -Wl,-no_compact_unwind
188228

189229
# x86_64-apple-darwin configuration
190230
CC_x86_64-apple-darwin=$(CC)

Diff for: mk/rt.mk

+42-6
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ ifeq ($$(CFG_WINDOWSY_$(1)), 1)
166166
JEMALLOC_ARGS_$(1) := --enable-lazy-lock
167167
else ifeq ($(OSTYPE_$(1)), apple-darwin)
168168
LIBUV_OSTYPE_$(1) := mac
169+
else ifeq ($(OSTYPE_$(1)), apple-ios)
170+
LIBUV_OSTYPE_$(1) := ios
171+
JEMALLOC_ARGS_$(1) := --disable-tls
169172
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
170173
LIBUV_OSTYPE_$(1) := freebsd
171174
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
@@ -181,6 +184,8 @@ LIBUV_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv
181184
LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(LIBUV_NAME_$(1))
182185

183186
LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
187+
LIBUV_BUILD_DIR_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv
188+
LIBUV_XCODEPROJ_$(1) := $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj
184189

185190
LIBUV_STAMP_$(1) = $$(LIBUV_DIR_$(1))/libuv-auto-clean-stamp
186191

@@ -212,6 +217,30 @@ $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
212217
CXX="$$(CXX_$(1))" \
213218
AR="$$(AR_$(1))" \
214219
V=$$(VERBOSE)
220+
else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
221+
$$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
222+
cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
223+
(cd $$(LIBUV_BUILD_DIR_$(1)) && \
224+
$$(CFG_PYTHON) ./gyp_uv.py -f xcode \
225+
-D ninja \
226+
-R libuv)
227+
touch $$@
228+
229+
LIBUV_XCODE_OUT_LIB_$(1) := $$(LIBUV_BUILD_DIR_$(1))/build/Release-$$(CFG_SDK_NAME_$(1))/libuv.a
230+
231+
$$(LIBUV_LIB_$(1)): $$(LIBUV_XCODE_OUT_LIB_$(1)) $$(MKFILE_DEPS)
232+
$$(Q)cp $$< $$@
233+
$$(LIBUV_XCODE_OUT_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_XCODEPROJ_$(1)) \
234+
$$(MKFILE_DEPS)
235+
$$(Q)xcodebuild -project $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj \
236+
CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
237+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
238+
$$(LIBUV_ARGS_$(1)) \
239+
V=$$(VERBOSE) \
240+
-configuration Release \
241+
-sdk "$$(CFG_SDK_NAME_$(1))" \
242+
ARCHS="$$(CFG_SDK_ARCHS_$(1))"
243+
$$(Q)touch $$@
215244
else
216245
LIBUV_LOCAL_$(1) := $$(LIBUV_DIR_$(1))/Release/libuv.a
217246
$$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
@@ -226,7 +255,6 @@ $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
226255
NO_LOAD="$$(LIBUV_NO_LOAD)" \
227256
V=$$(VERBOSE)
228257
$$(Q)touch $$@
229-
230258
endif
231259

232260
ifeq ($(1),$$(CFG_BUILD))
@@ -269,13 +297,13 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
269297
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
270298
@$$(call E, make: jemalloc)
271299
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
272-
$$(JEMALLOC_ARGS_$(1)) --enable-cc-silence --with-jemalloc-prefix=je_ \
273-
--disable-experimental --build=$(CFG_BUILD) --host=$(1) \
300+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ \
301+
--build=$(CFG_BUILD) --host=$(1) \
274302
CC="$$(CC_$(1))" \
275303
AR="$$(AR_$(1))" \
276304
RANLIB="$$(AR_$(1)) s" \
277305
CPPFLAGS="-I $(S)src/rt/" \
278-
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) -g1"
306+
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) $$(CFG_JEMALLOC_CFLAGS_$(1)) -g1"
279307
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
280308

281309
ifeq ($(1),$$(CFG_BUILD))
@@ -335,15 +363,22 @@ BACKTRACE_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),backtrace)
335363
BACKTRACE_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(BACKTRACE_NAME_$(1))
336364
BACKTRACE_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libbacktrace
337365

338-
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
339-
340366
# We don't use this on platforms that aren't linux-based, so just make the file
341367
# available, the compilation of libstd won't actually build it.
368+
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
369+
# See comment above
342370
$$(BACKTRACE_LIB_$(1)):
343371
touch $$@
344372

345373
else
374+
ifeq ($$(findstring ios,$$(OSTYPE_$(1))),ios)
375+
# See comment above
376+
$$(BACKTRACE_LIB_$(1)):
377+
touch $$@
378+
else
379+
346380
ifeq ($$(CFG_WINDOWSY_$(1)),1)
381+
# See comment above
347382
$$(BACKTRACE_LIB_$(1)):
348383
touch $$@
349384
else
@@ -388,6 +423,7 @@ $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
388423
$$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
389424

390425
endif # endif for windowsy
426+
endif # endif for ios
391427
endif # endif for darwin
392428

393429
endef

Diff for: src/compiler-rt

Submodule compiler-rt updated 821 files

Diff for: src/jemalloc

Submodule jemalloc updated 68 files

Diff for: src/liblibc/lib.rs

+13
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,13 @@ pub use consts::os::extra::{MAP_STACK};
278278
pub use consts::os::bsd44::{TCP_KEEPIDLE};
279279

280280
#[cfg(target_os = "macos")]
281+
#[cfg(target_os = "ios")]
281282
pub use consts::os::bsd44::{TCP_KEEPALIVE};
282283
#[cfg(target_os = "macos")]
284+
#[cfg(target_os = "ios")]
283285
pub use consts::os::extra::{F_FULLFSYNC};
284286
#[cfg(target_os = "macos")]
287+
#[cfg(target_os = "ios")]
285288
pub use types::os::arch::extra::{mach_timebase_info};
286289

287290

@@ -1286,6 +1289,7 @@ pub mod types {
12861289
}
12871290

12881291
#[cfg(target_os = "macos")]
1292+
#[cfg(target_os = "ios")]
12891293
pub mod os {
12901294
pub mod common {
12911295
pub mod posix01 {
@@ -3106,6 +3110,7 @@ pub mod consts {
31063110
}
31073111

31083112
#[cfg(target_os = "macos")]
3113+
#[cfg(target_os = "ios")]
31093114
pub mod os {
31103115
pub mod c95 {
31113116
use types::os::arch::c95::{c_int, c_uint};
@@ -3769,6 +3774,7 @@ pub mod funcs {
37693774
#[cfg(target_os = "linux")]
37703775
#[cfg(target_os = "android")]
37713776
#[cfg(target_os = "macos")]
3777+
#[cfg(target_os = "ios")]
37723778
#[cfg(target_os = "freebsd")]
37733779
pub mod posix88 {
37743780
pub mod stat_ {
@@ -3783,6 +3789,7 @@ pub mod funcs {
37833789
#[cfg(target_os = "linux")]
37843790
#[cfg(target_os = "freebsd")]
37853791
#[cfg(target_os = "android")]
3792+
#[cfg(target_os = "ios")]
37863793
pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
37873794

37883795
#[cfg(target_os = "macos")]
@@ -3795,6 +3802,7 @@ pub mod funcs {
37953802
#[cfg(target_os = "linux")]
37963803
#[cfg(target_os = "freebsd")]
37973804
#[cfg(target_os = "android")]
3805+
#[cfg(target_os = "ios")]
37983806
pub fn stat(path: *c_char, buf: *mut stat) -> c_int;
37993807

38003808
#[cfg(target_os = "macos")]
@@ -3967,6 +3975,7 @@ pub mod funcs {
39673975
#[cfg(target_os = "linux")]
39683976
#[cfg(target_os = "android")]
39693977
#[cfg(target_os = "macos")]
3978+
#[cfg(target_os = "ios")]
39703979
#[cfg(target_os = "freebsd")]
39713980
pub mod posix01 {
39723981
pub mod stat_ {
@@ -3977,6 +3986,7 @@ pub mod funcs {
39773986
#[cfg(target_os = "linux")]
39783987
#[cfg(target_os = "freebsd")]
39793988
#[cfg(target_os = "android")]
3989+
#[cfg(target_os = "ios")]
39803990
pub fn lstat(path: *c_char, buf: *mut stat) -> c_int;
39813991

39823992
#[cfg(target_os = "macos")]
@@ -4076,6 +4086,7 @@ pub mod funcs {
40764086
#[cfg(target_os = "linux")]
40774087
#[cfg(target_os = "android")]
40784088
#[cfg(target_os = "macos")]
4089+
#[cfg(target_os = "ios")]
40794090
#[cfg(target_os = "freebsd")]
40804091
pub mod posix08 {
40814092
pub mod unistd {
@@ -4156,6 +4167,7 @@ pub mod funcs {
41564167
}
41574168

41584169
#[cfg(target_os = "macos")]
4170+
#[cfg(target_os = "ios")]
41594171
#[cfg(target_os = "freebsd")]
41604172
pub mod bsd44 {
41614173
use types::common::c95::{c_void};
@@ -4209,6 +4221,7 @@ pub mod funcs {
42094221
}
42104222

42114223
#[cfg(target_os = "macos")]
4224+
#[cfg(target_os = "ios")]
42124225
pub mod extra {
42134226
use types::os::arch::c95::{c_char, c_int};
42144227

Diff for: src/libnative/io/c_unix.rs

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub use self::signal::{SA_NODEFER, SA_NOCLDWAIT, SA_SIGINFO, SIGCHLD};
2020
use libc;
2121

2222
#[cfg(target_os = "macos")]
23+
#[cfg(target_os = "ios")]
2324
#[cfg(target_os = "freebsd")]
2425
pub static FIONBIO: libc::c_ulong = 0x8004667e;
2526
#[cfg(target_os = "linux", not(target_arch = "mips"))]
@@ -29,6 +30,7 @@ pub static FIONBIO: libc::c_ulong = 0x5421;
2930
pub static FIONBIO: libc::c_ulong = 0x667e;
3031

3132
#[cfg(target_os = "macos")]
33+
#[cfg(target_os = "ios")]
3234
#[cfg(target_os = "freebsd")]
3335
pub static FIOCLEX: libc::c_ulong = 0x20006601;
3436
#[cfg(target_os = "linux", not(target_arch = "mips"))]
@@ -38,6 +40,7 @@ pub static FIOCLEX: libc::c_ulong = 0x5451;
3840
pub static FIOCLEX: libc::c_ulong = 0x6601;
3941

4042
#[cfg(target_os = "macos")]
43+
#[cfg(target_os = "ios")]
4144
#[cfg(target_os = "freebsd")]
4245
pub static MSG_DONTWAIT: libc::c_int = 0x80;
4346
#[cfg(target_os = "linux")]
@@ -75,6 +78,7 @@ extern {
7578
}
7679

7780
#[cfg(target_os = "macos")]
81+
#[cfg(target_os = "ios")]
7882
mod select {
7983
pub static FD_SETSIZE: uint = 1024;
8084

@@ -187,6 +191,7 @@ mod signal {
187191
}
188192

189193
#[cfg(target_os = "macos")]
194+
#[cfg(target_os = "ios")]
190195
#[cfg(target_os = "freebsd")]
191196
mod signal {
192197
use libc;
@@ -201,6 +206,7 @@ mod signal {
201206
pub static SIGCHLD: libc::c_int = 20;
202207

203208
#[cfg(target_os = "macos")]
209+
#[cfg(target_os = "ios")]
204210
pub type sigset_t = u32;
205211
#[cfg(target_os = "freebsd")]
206212
pub struct sigset_t {
@@ -219,6 +225,7 @@ mod signal {
219225
}
220226

221227
#[cfg(target_os = "macos")]
228+
#[cfg(target_os = "ios")]
222229
pub struct sigaction {
223230
pub sa_handler: extern fn(libc::c_int),
224231
sa_tramp: *mut libc::c_void,

Diff for: src/libnative/io/file_unix.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,15 @@ impl rtio::RtioFileStream for FileDesc {
133133
return super::mkerr_libc(os_datasync(self.fd()));
134134

135135
#[cfg(target_os = "macos")]
136+
#[cfg(target_os = "ios")]
136137
fn os_datasync(fd: c_int) -> c_int {
137138
unsafe { libc::fcntl(fd, libc::F_FULLFSYNC) }
138139
}
139140
#[cfg(target_os = "linux")]
140141
fn os_datasync(fd: c_int) -> c_int {
141142
retry(|| unsafe { libc::fdatasync(fd) })
142143
}
143-
#[cfg(not(target_os = "macos"), not(target_os = "linux"))]
144+
#[cfg(not(target_os = "macos"), not(target_os = "ios"), not(target_os = "linux"))]
144145
fn os_datasync(fd: c_int) -> c_int {
145146
retry(|| unsafe { libc::fsync(fd) })
146147
}

Diff for: src/libnative/io/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub mod file;
5050
pub mod file;
5151

5252
#[cfg(target_os = "macos")]
53+
#[cfg(target_os = "ios")]
5354
#[cfg(target_os = "freebsd")]
5455
#[cfg(target_os = "android")]
5556
#[cfg(target_os = "linux")]

0 commit comments

Comments
 (0)