Skip to content

Commit 221acee

Browse files
committed
---
yaml --- r: 155564 b: refs/heads/try2 c: ad83352 h: refs/heads/master v: v3
1 parent fa673ae commit 221acee

File tree

9 files changed

+75
-70
lines changed

9 files changed

+75
-70
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d5647a8ea3932c8a44dad13699e128d3d3fee255
8+
refs/heads/try2: ad833526186c9dffc6a7381a3fa02c35543461c9
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustrt/args.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ pub fn put(args: Vec<Vec<u8>>) { imp::put(args) }
3939
/// Make a clone of the global arguments.
4040
pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() }
4141

42-
#[cfg(target_os = "linux")]
43-
#[cfg(target_os = "android")]
44-
#[cfg(target_os = "freebsd")]
45-
#[cfg(target_os = "dragonfly")]
42+
#[cfg(any(target_os = "linux",
43+
target_os = "android",
44+
target_os = "freebsd",
45+
target_os = "dragonfly"))]
4646
mod imp {
4747
use core::prelude::*;
4848

@@ -146,9 +146,9 @@ mod imp {
146146
}
147147
}
148148

149-
#[cfg(target_os = "macos")]
150-
#[cfg(target_os = "ios")]
151-
#[cfg(target_os = "windows")]
149+
#[cfg(any(target_os = "macos",
150+
target_os = "ios",
151+
target_os = "windows"))]
152152
mod imp {
153153
use core::prelude::*;
154154
use collections::vec::Vec;

branches/try2/src/librustrt/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub unsafe fn cleanup() {
160160
pub mod shouldnt_be_public {
161161
#[cfg(not(test))]
162162
pub use super::local_ptr::native::maybe_tls_key;
163-
#[cfg(not(windows), not(target_os = "android"), not(target_os = "ios"))]
163+
#[cfg(all(not(windows), not(target_os = "android"), not(target_os = "ios")))]
164164
pub use super::local_ptr::compiled::RT_TLS_PTR;
165165
}
166166

branches/try2/src/librustrt/libunwind.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
use libc;
1818

19-
#[cfg(not(target_arch = "arm"))]
20-
#[cfg(target_os = "ios")]
19+
#[cfg(any(not(target_arch = "arm"), target_os = "ios"))]
2120
#[repr(C)]
2221
pub enum _Unwind_Action {
2322
_UA_SEARCH_PHASE = 1,
@@ -62,14 +61,13 @@ pub static unwinder_private_data_size: uint = 5;
6261
#[cfg(target_arch = "x86_64")]
6362
pub static unwinder_private_data_size: uint = 6;
6463

65-
#[cfg(target_arch = "arm", not(target_os = "ios"))]
64+
#[cfg(all(target_arch = "arm", not(target_os = "ios")))]
6665
pub static unwinder_private_data_size: uint = 20;
6766

68-
#[cfg(target_arch = "arm", target_os = "ios")]
67+
#[cfg(all(target_arch = "arm", target_os = "ios"))]
6968
pub static unwinder_private_data_size: uint = 5;
7069

71-
#[cfg(target_arch = "mips")]
72-
#[cfg(target_arch = "mipsel")]
70+
#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
7371
pub static unwinder_private_data_size: uint = 2;
7472

7573
#[repr(C)]
@@ -85,8 +83,7 @@ pub type _Unwind_Exception_Cleanup_Fn =
8583
extern "C" fn(unwind_code: _Unwind_Reason_Code,
8684
exception: *mut _Unwind_Exception);
8785

88-
#[cfg(target_os = "linux")]
89-
#[cfg(target_os = "freebsd")]
86+
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
9087
#[link(name = "gcc_s")]
9188
extern {}
9289

@@ -101,11 +98,11 @@ extern {}
10198
extern "C" {
10299
// iOS on armv7 uses SjLj exceptions and requires to link
103100
// against corresponding routine (..._SjLj_...)
104-
#[cfg(not(target_os = "ios", target_arch = "arm"))]
101+
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
105102
pub fn _Unwind_RaiseException(exception: *mut _Unwind_Exception)
106103
-> _Unwind_Reason_Code;
107104

108-
#[cfg(target_os = "ios", target_arch = "arm")]
105+
#[cfg(all(target_os = "ios", target_arch = "arm"))]
109106
fn _Unwind_SjLj_RaiseException(e: *mut _Unwind_Exception)
110107
-> _Unwind_Reason_Code;
111108

@@ -115,7 +112,7 @@ extern "C" {
115112
// ... and now we just providing access to SjLj counterspart
116113
// through a standard name to hide those details from others
117114
// (see also comment above regarding _Unwind_RaiseException)
118-
#[cfg(target_os = "ios", target_arch = "arm")]
115+
#[cfg(all(target_os = "ios", target_arch = "arm"))]
119116
#[inline(always)]
120117
pub unsafe fn _Unwind_RaiseException(exc: *mut _Unwind_Exception)
121118
-> _Unwind_Reason_Code {

branches/try2/src/librustrt/local_ptr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ use core::prelude::*;
2222
use core::mem;
2323
use alloc::boxed::Box;
2424

25-
#[cfg(windows)] // mingw-w32 doesn't like thread_local things
26-
#[cfg(target_os = "android")] // see #10686
27-
#[cfg(target_os = "ios")]
25+
#[cfg(any(windows, // mingw-w32 doesn't like thread_local things
26+
target_os = "android", // see #10686
27+
target_os = "ios"))]
2828
pub use self::native::{init, cleanup, put, take, try_take, unsafe_take, exists,
2929
unsafe_borrow, try_unsafe_borrow};
3030

31-
#[cfg(not(windows), not(target_os = "android"), not(target_os = "ios"))]
31+
#[cfg(not(any(windows, target_os = "android", target_os = "ios")))]
3232
pub use self::compiled::{init, cleanup, put, take, try_take, unsafe_take, exists,
3333
unsafe_borrow, try_unsafe_borrow};
3434

@@ -82,7 +82,7 @@ pub unsafe fn borrow<T>() -> Borrowed<T> {
8282
/// implemented using LLVM's thread_local attribute which isn't necessarily
8383
/// working on all platforms. This implementation is faster, however, so we use
8484
/// it wherever possible.
85-
#[cfg(not(windows), not(target_os = "android"), not(target_os = "ios"))]
85+
#[cfg(not(any(windows, target_os = "android", target_os = "ios")))]
8686
pub mod compiled {
8787
use core::prelude::*;
8888

branches/try2/src/librustrt/mutex.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ mod imp {
346346
type pthread_mutexattr_t = libc::c_void;
347347
type pthread_condattr_t = libc::c_void;
348348

349-
#[cfg(target_os = "freebsd")]
350-
#[cfg(target_os = "dragonfly")]
349+
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
351350
mod os {
352351
use libc;
353352

@@ -360,8 +359,7 @@ mod imp {
360359
0 as pthread_cond_t;
361360
}
362361

363-
#[cfg(target_os = "macos")]
364-
#[cfg(target_os = "ios")]
362+
#[cfg(any(target_os = "macos", target_os = "ios"))]
365363
mod os {
366364
use libc;
367365

branches/try2/src/librustrt/stack.rs

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ pub unsafe fn record_rust_managed_stack_bounds(stack_lo: uint, stack_hi: uint) {
156156
#[cfg(not(windows))] #[inline(always)]
157157
unsafe fn target_record_stack_bounds(_stack_lo: uint, _stack_hi: uint) {}
158158

159-
#[cfg(windows, target_arch = "x86")] #[inline(always)]
159+
#[cfg(all(windows, target_arch = "x86"))] #[inline(always)]
160160
unsafe fn target_record_stack_bounds(stack_lo: uint, stack_hi: uint) {
161161
// stack range is at TIB: %fs:0x04 (top) and %fs:0x08 (bottom)
162162
asm!("mov $0, %fs:0x04" :: "r"(stack_hi) :: "volatile");
163163
asm!("mov $0, %fs:0x08" :: "r"(stack_lo) :: "volatile");
164164
}
165-
#[cfg(windows, target_arch = "x86_64")] #[inline(always)]
165+
#[cfg(all(windows, target_arch = "x86_64"))] #[inline(always)]
166166
unsafe fn target_record_stack_bounds(stack_lo: uint, stack_hi: uint) {
167167
// stack range is at TIB: %gs:0x08 (top) and %gs:0x10 (bottom)
168168
asm!("mov $0, %gs:0x08" :: "r"(stack_hi) :: "volatile");
@@ -189,49 +189,53 @@ pub unsafe fn record_sp_limit(limit: uint) {
189189
return target_record_sp_limit(limit);
190190

191191
// x86-64
192-
#[cfg(target_arch = "x86_64", target_os = "macos")]
193-
#[cfg(target_arch = "x86_64", target_os = "ios")] #[inline(always)]
192+
#[cfg(all(target_arch = "x86_64",
193+
any(target_os = "macos", target_os = "ios")))]
194+
#[inline(always)]
194195
unsafe fn target_record_sp_limit(limit: uint) {
195196
asm!("movq $$0x60+90*8, %rsi
196197
movq $0, %gs:(%rsi)" :: "r"(limit) : "rsi" : "volatile")
197198
}
198-
#[cfg(target_arch = "x86_64", target_os = "linux")] #[inline(always)]
199+
#[cfg(all(target_arch = "x86_64", target_os = "linux"))] #[inline(always)]
199200
unsafe fn target_record_sp_limit(limit: uint) {
200201
asm!("movq $0, %fs:112" :: "r"(limit) :: "volatile")
201202
}
202-
#[cfg(target_arch = "x86_64", target_os = "windows")] #[inline(always)]
203+
#[cfg(all(target_arch = "x86_64", target_os = "windows"))] #[inline(always)]
203204
unsafe fn target_record_sp_limit(_: uint) {
204205
}
205-
#[cfg(target_arch = "x86_64", target_os = "freebsd")] #[inline(always)]
206+
#[cfg(all(target_arch = "x86_64", target_os = "freebsd"))] #[inline(always)]
206207
unsafe fn target_record_sp_limit(limit: uint) {
207208
asm!("movq $0, %fs:24" :: "r"(limit) :: "volatile")
208209
}
209-
#[cfg(target_arch = "x86_64", target_os = "dragonfly")] #[inline(always)]
210+
#[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)]
210211
unsafe fn target_record_sp_limit(limit: uint) {
211212
asm!("movq $0, %fs:32" :: "r"(limit) :: "volatile")
212213
}
213214

214215
// x86
215-
#[cfg(target_arch = "x86", target_os = "macos")]
216-
#[cfg(target_arch = "x86", target_os = "ios")] #[inline(always)]
216+
#[cfg(all(target_arch = "x86",
217+
any(target_os = "macos", target_os = "ios")))]
218+
#[inline(always)]
217219
unsafe fn target_record_sp_limit(limit: uint) {
218220
asm!("movl $$0x48+90*4, %eax
219221
movl $0, %gs:(%eax)" :: "r"(limit) : "eax" : "volatile")
220222
}
221-
#[cfg(target_arch = "x86", target_os = "linux")]
222-
#[cfg(target_arch = "x86", target_os = "freebsd")] #[inline(always)]
223+
#[cfg(all(target_arch = "x86",
224+
any(target_os = "linux", target_os = "freebsd")))]
225+
#[inline(always)]
223226
unsafe fn target_record_sp_limit(limit: uint) {
224227
asm!("movl $0, %gs:48" :: "r"(limit) :: "volatile")
225228
}
226-
#[cfg(target_arch = "x86", target_os = "windows")] #[inline(always)]
229+
#[cfg(all(target_arch = "x86", target_os = "windows"))] #[inline(always)]
227230
unsafe fn target_record_sp_limit(_: uint) {
228231
}
229232

230233
// mips, arm - Some brave soul can port these to inline asm, but it's over
231234
// my head personally
232-
#[cfg(target_arch = "mips")]
233-
#[cfg(target_arch = "mipsel")]
234-
#[cfg(target_arch = "arm", not(target_os = "ios"))] #[inline(always)]
235+
#[cfg(any(target_arch = "mips",
236+
target_arch = "mipsel",
237+
all(target_arch = "arm", not(target_os = "ios"))))]
238+
#[inline(always)]
235239
unsafe fn target_record_sp_limit(limit: uint) {
236240
use libc::c_void;
237241
return record_sp_limit(limit as *const c_void);
@@ -241,7 +245,7 @@ pub unsafe fn record_sp_limit(limit: uint) {
241245
}
242246

243247
// iOS segmented stack is disabled for now, see related notes
244-
#[cfg(target_arch = "arm", target_os = "ios")] #[inline(always)]
248+
#[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)]
245249
unsafe fn target_record_sp_limit(_: uint) {
246250
}
247251
}
@@ -259,31 +263,32 @@ pub unsafe fn get_sp_limit() -> uint {
259263
return target_get_sp_limit();
260264

261265
// x86-64
262-
#[cfg(target_arch = "x86_64", target_os = "macos")]
263-
#[cfg(target_arch = "x86_64", target_os = "ios")] #[inline(always)]
266+
#[cfg(all(target_arch = "x86_64",
267+
any(target_os = "macos", target_os = "ios")))]
268+
#[inline(always)]
264269
unsafe fn target_get_sp_limit() -> uint {
265270
let limit;
266271
asm!("movq $$0x60+90*8, %rsi
267272
movq %gs:(%rsi), $0" : "=r"(limit) :: "rsi" : "volatile");
268273
return limit;
269274
}
270-
#[cfg(target_arch = "x86_64", target_os = "linux")] #[inline(always)]
275+
#[cfg(all(target_arch = "x86_64", target_os = "linux"))] #[inline(always)]
271276
unsafe fn target_get_sp_limit() -> uint {
272277
let limit;
273278
asm!("movq %fs:112, $0" : "=r"(limit) ::: "volatile");
274279
return limit;
275280
}
276-
#[cfg(target_arch = "x86_64", target_os = "windows")] #[inline(always)]
281+
#[cfg(all(target_arch = "x86_64", target_os = "windows"))] #[inline(always)]
277282
unsafe fn target_get_sp_limit() -> uint {
278283
return 1024;
279284
}
280-
#[cfg(target_arch = "x86_64", target_os = "freebsd")] #[inline(always)]
285+
#[cfg(all(target_arch = "x86_64", target_os = "freebsd"))] #[inline(always)]
281286
unsafe fn target_get_sp_limit() -> uint {
282287
let limit;
283288
asm!("movq %fs:24, $0" : "=r"(limit) ::: "volatile");
284289
return limit;
285290
}
286-
#[cfg(target_arch = "x86_64", target_os = "dragonfly")] #[inline(always)]
291+
#[cfg(all(target_arch = "x86_64", target_os = "dragonfly"))] #[inline(always)]
287292
unsafe fn target_get_sp_limit() -> uint {
288293
let limit;
289294
asm!("movq %fs:32, $0" : "=r"(limit) ::: "volatile");
@@ -292,31 +297,34 @@ pub unsafe fn get_sp_limit() -> uint {
292297

293298

294299
// x86
295-
#[cfg(target_arch = "x86", target_os = "macos")]
296-
#[cfg(target_arch = "x86", target_os = "ios")] #[inline(always)]
300+
#[cfg(all(target_arch = "x86",
301+
any(target_os = "macos", target_os = "ios")))]
302+
#[inline(always)]
297303
unsafe fn target_get_sp_limit() -> uint {
298304
let limit;
299305
asm!("movl $$0x48+90*4, %eax
300306
movl %gs:(%eax), $0" : "=r"(limit) :: "eax" : "volatile");
301307
return limit;
302308
}
303-
#[cfg(target_arch = "x86", target_os = "linux")]
304-
#[cfg(target_arch = "x86", target_os = "freebsd")] #[inline(always)]
309+
#[cfg(all(target_arch = "x86",
310+
any(target_os = "linux", target_os = "freebsd")))]
311+
#[inline(always)]
305312
unsafe fn target_get_sp_limit() -> uint {
306313
let limit;
307314
asm!("movl %gs:48, $0" : "=r"(limit) ::: "volatile");
308315
return limit;
309316
}
310-
#[cfg(target_arch = "x86", target_os = "windows")] #[inline(always)]
317+
#[cfg(all(target_arch = "x86", target_os = "windows"))] #[inline(always)]
311318
unsafe fn target_get_sp_limit() -> uint {
312319
return 1024;
313320
}
314321

315322
// mips, arm - Some brave soul can port these to inline asm, but it's over
316323
// my head personally
317-
#[cfg(target_arch = "mips")]
318-
#[cfg(target_arch = "mipsel")]
319-
#[cfg(target_arch = "arm", not(target_os = "ios"))] #[inline(always)]
324+
#[cfg(any(target_arch = "mips",
325+
target_arch = "mipsel",
326+
all(target_arch = "arm", not(target_os = "ios"))))]
327+
#[inline(always)]
320328
unsafe fn target_get_sp_limit() -> uint {
321329
use libc::c_void;
322330
return get_sp_limit() as uint;
@@ -328,7 +336,7 @@ pub unsafe fn get_sp_limit() -> uint {
328336
// iOS doesn't support segmented stacks yet. This function might
329337
// be called by runtime though so it is unsafe to mark it as
330338
// unreachable, let's return a fixed constant.
331-
#[cfg(target_arch = "arm", target_os = "ios")] #[inline(always)]
339+
#[cfg(all(target_arch = "arm", target_os = "ios"))] #[inline(always)]
332340
unsafe fn target_get_sp_limit() -> uint {
333341
1024
334342
}

branches/try2/src/librustrt/thread_local_storage.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ pub unsafe fn destroy(key: Key) {
4141
#[allow(non_camel_case_types)] // foreign type
4242
type pthread_key_t = ::libc::c_ulong;
4343

44-
#[cfg(target_os="linux")]
45-
#[cfg(target_os="freebsd")]
46-
#[cfg(target_os="dragonfly")]
47-
#[cfg(target_os="android")]
48-
#[cfg(target_os = "ios")]
44+
#[cfg(any(target_os="linux",
45+
target_os="freebsd",
46+
target_os="dragonfly",
47+
target_os="android",
48+
target_os = "ios"))]
4949
#[allow(non_camel_case_types)] // foreign type
5050
type pthread_key_t = ::libc::c_uint;
5151

branches/try2/src/librustrt/unwind.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ fn rust_exception_class() -> uw::_Unwind_Exception_Class {
235235
//
236236
// See also: rt/rust_try.ll
237237

238-
#[cfg(not(target_arch = "arm"), not(windows, target_arch = "x86_64"), not(test))]
238+
#[cfg(all(not(target_arch = "arm"),
239+
not(all(windows, target_arch = "x86_64")),
240+
not(test)))]
239241
#[doc(hidden)]
240242
pub mod eabi {
241243
use libunwind as uw;
@@ -288,7 +290,7 @@ pub mod eabi {
288290
// iOS on armv7 is using SjLj exceptions and therefore requires to use
289291
// a specialized personality routine: __gcc_personality_sj0
290292

291-
#[cfg(target_os = "ios", target_arch = "arm", not(test))]
293+
#[cfg(all(target_os = "ios", target_arch = "arm", not(test)))]
292294
#[doc(hidden)]
293295
pub mod eabi {
294296
use libunwind as uw;
@@ -343,7 +345,7 @@ pub mod eabi {
343345

344346
// ARM EHABI uses a slightly different personality routine signature,
345347
// but otherwise works the same.
346-
#[cfg(target_arch = "arm", not(target_os = "ios"), not(test))]
348+
#[cfg(all(target_arch = "arm", not(target_os = "ios"), not(test)))]
347349
#[doc(hidden)]
348350
pub mod eabi {
349351
use libunwind as uw;
@@ -392,7 +394,7 @@ pub mod eabi {
392394
// GCC reuses the same personality routine as for the other architectures by wrapping it
393395
// with an "API translator" layer (_GCC_specific_handler).
394396

395-
#[cfg(windows, target_arch = "x86_64", not(test))]
397+
#[cfg(all(windows, target_arch = "x86_64", not(test)))]
396398
#[doc(hidden)]
397399
#[allow(non_camel_case_types, non_snake_case)]
398400
pub mod eabi {

0 commit comments

Comments
 (0)