Skip to content

Commit 0f2d4f9

Browse files
committed
Auto merge of #1067 - cramertj:fuchsia-fixes, r=alexcrichton
Fix and cleanup Fuchsia Remove false support for power and mips. Fix aarch64 definitions of nlink_t and blksize_t. r? @alexcrichton cc @sulanov
2 parents 7a9f031 + 2f59370 commit 0f2d4f9

File tree

3 files changed

+24
-146
lines changed

3 files changed

+24
-146
lines changed

src/fuchsia/aarch64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pub type c_char = u8;
22
pub type __u64 = ::c_ulonglong;
33
pub type wchar_t = u32;
4-
pub type nlink_t = u32;
5-
pub type blksize_t = ::c_int;
4+
pub type nlink_t = ::c_ulong;
5+
pub type blksize_t = ::c_long;
66

77
s! {
88
pub struct stat {

src/fuchsia/mod.rs

Lines changed: 22 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,13 @@ s! {
9797
pub tv_usec: suseconds_t,
9898
}
9999

100-
// linux x32 compatibility
101-
// See https://sourceware.org/bugzilla/show_bug.cgi?id=16437
102100
pub struct timespec {
103101
pub tv_sec: time_t,
104-
#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
105-
pub tv_nsec: i64,
106-
#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
107102
pub tv_nsec: ::c_long,
108103
}
109104

105+
// FIXME: the rlimit and rusage related functions and types don't exist
106+
// within zircon. Are there reasons for keeping them around?
110107
pub struct rlimit {
111108
pub rlim_cur: rlim_t,
112109
pub rlim_max: rlim_t,
@@ -166,11 +163,14 @@ s! {
166163
pub s_addr: in_addr_t,
167164
}
168165

169-
#[cfg_attr(feature = "align", repr(align(4)))]
170166
pub struct in6_addr {
171-
pub s6_addr: [u8; 16],
172-
#[cfg(not(feature = "align"))]
173-
__align: [u32; 0],
167+
pub __in6_union: in6_union,
168+
}
169+
170+
pub union in6_union {
171+
pub __s6_addr: [u8; 16],
172+
pub __s6_addr16: [u16; 8],
173+
pub __s6_addr32: [u32; 4],
174174
}
175175

176176
pub struct ip_mreq {
@@ -180,9 +180,6 @@ s! {
180180

181181
pub struct ipv6_mreq {
182182
pub ipv6mr_multiaddr: in6_addr,
183-
#[cfg(target_os = "android")]
184-
pub ipv6mr_interface: ::c_int,
185-
#[cfg(not(target_os = "android"))]
186183
pub ipv6mr_interface: ::c_uint,
187184
}
188185

@@ -400,13 +397,9 @@ s! {
400397

401398
pub struct sched_param {
402399
pub sched_priority: ::c_int,
403-
#[cfg(target_env = "musl")]
404400
pub sched_ss_low_priority: ::c_int,
405-
#[cfg(target_env = "musl")]
406401
pub sched_ss_repl_period: ::timespec,
407-
#[cfg(target_env = "musl")]
408402
pub sched_ss_init_budget: ::timespec,
409-
#[cfg(target_env = "musl")]
410403
pub sched_ss_max_repl: ::c_int,
411404
}
412405

@@ -417,11 +410,6 @@ s! {
417410
pub dli_saddr: *mut ::c_void,
418411
}
419412

420-
#[cfg_attr(any(all(target_arch = "x86",
421-
not(target_env = "musl"),
422-
not(target_os = "android")),
423-
target_arch = "x86_64"),
424-
repr(packed))]
425413
pub struct epoll_event {
426414
pub events: ::uint32_t,
427415
pub u64: ::uint64_t,
@@ -467,13 +455,9 @@ s! {
467455
pub sigev_value: ::sigval,
468456
pub sigev_signo: ::c_int,
469457
pub sigev_notify: ::c_int,
470-
// Actually a union. We only expose sigev_notify_thread_id because it's
471-
// the most useful member
472-
pub sigev_notify_thread_id: ::c_int,
473-
#[cfg(target_pointer_width = "64")]
474-
__unused1: [::c_int; 11],
475-
#[cfg(target_pointer_width = "32")]
476-
__unused1: [::c_int; 12]
458+
pub sigev_notify_function: fn(::sigval),
459+
pub sigev_notify_attributes: *mut pthread_attr_t,
460+
pub __pad: [::c_char; 56 - 3 * 8 /* 8 == sizeof(long) */],
477461
}
478462

479463
pub struct dirent {
@@ -522,30 +506,22 @@ s! {
522506

523507
#[cfg_attr(all(feature = "align",
524508
target_pointer_width = "32",
525-
any(target_arch = "mips",
526-
target_arch = "arm",
527-
target_arch = "powerpc",
509+
any(target_arch = "arm",
528510
target_arch = "x86_64")),
529511
repr(align(4)))]
530512
#[cfg_attr(all(feature = "align",
531513
any(target_pointer_width = "64",
532-
not(any(target_arch = "mips",
533-
target_arch = "arm",
534-
target_arch = "powerpc",
514+
not(any(target_arch = "arm",
535515
target_arch = "x86_64")))),
536516
repr(align(8)))]
537517
pub struct pthread_mutex_t {
538518
#[cfg(all(not(feature = "align"),
539-
any(target_arch = "mips",
540-
target_arch = "arm",
541-
target_arch = "powerpc",
519+
any(target_arch = "arm",
542520
all(target_arch = "x86_64",
543521
target_pointer_width = "32"))))]
544522
__align: [::c_long; 0],
545523
#[cfg(not(any(feature = "align",
546-
target_arch = "mips",
547524
target_arch = "arm",
548-
target_arch = "powerpc",
549525
all(target_arch = "x86_64",
550526
target_pointer_width = "32"))))]
551527
__align: [::c_longlong; 0],
@@ -554,30 +530,22 @@ s! {
554530

555531
#[cfg_attr(all(feature = "align",
556532
target_pointer_width = "32",
557-
any(target_arch = "mips",
558-
target_arch = "arm",
559-
target_arch = "powerpc",
533+
any(target_arch = "arm",
560534
target_arch = "x86_64")),
561535
repr(align(4)))]
562536
#[cfg_attr(all(feature = "align",
563537
any(target_pointer_width = "64",
564-
not(any(target_arch = "mips",
565-
target_arch = "arm",
566-
target_arch = "powerpc",
538+
not(any(target_arch = "arm",
567539
target_arch = "x86_64")))),
568540
repr(align(8)))]
569541
pub struct pthread_rwlock_t {
570542
#[cfg(all(not(feature = "align"),
571-
any(target_arch = "mips",
572-
target_arch = "arm",
573-
target_arch = "powerpc",
543+
any(target_arch = "arm",
574544
all(target_arch = "x86_64",
575545
target_pointer_width = "32"))))]
576546
__align: [::c_long; 0],
577547
#[cfg(not(any(feature = "align",
578-
target_arch = "mips",
579548
target_arch = "arm",
580-
target_arch = "powerpc",
581549
all(target_arch = "x86_64",
582550
target_pointer_width = "32"))))]
583551
__align: [::c_longlong; 0],
@@ -586,29 +554,21 @@ s! {
586554

587555
#[cfg_attr(all(feature = "align",
588556
any(target_pointer_width = "32",
589-
target_arch = "x86_64", target_arch = "powerpc64",
590-
target_arch = "mips64", target_arch = "s390x",
591-
target_arch = "sparc64",
557+
target_arch = "x86_64",
592558
all(target_arch = "aarch64", target_env = "musl"))),
593559
repr(align(4)))]
594560
#[cfg_attr(all(feature = "align",
595561
not(any(target_pointer_width = "32",
596-
target_arch = "x86_64", target_arch = "powerpc64",
597-
target_arch = "mips64", target_arch = "s390x",
598-
target_arch = "sparc64",
562+
target_arch = "x86_64",
599563
all(target_arch = "aarch64", target_env = "musl")))),
600564
repr(align(8)))]
601565
pub struct pthread_mutexattr_t {
602566
#[cfg(all(not(features = "align"),
603-
any(target_arch = "x86_64", target_arch = "powerpc64",
604-
target_arch = "mips64", target_arch = "s390x",
605-
target_arch = "sparc64",
567+
any(target_arch = "x86_64",
606568
all(target_arch = "aarch64", target_env = "musl"))))]
607569
__align: [::c_int; 0],
608570
#[cfg(all(not(features = "align"),
609-
not(any(target_arch = "x86_64", target_arch = "powerpc64",
610-
target_arch = "mips64", target_arch = "s390x",
611-
target_arch = "sparc64",
571+
not(any(target_arch = "x86_64",
612572
all(target_arch = "aarch64", target_env = "musl")))))]
613573
__align: [::c_long; 0],
614574
size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T],
@@ -3987,9 +3947,6 @@ cfg_if! {
39873947
if #[cfg(target_arch = "aarch64")] {
39883948
mod aarch64;
39893949
pub use self::aarch64::*;
3990-
} else if #[cfg(any(target_arch = "powerpc64"))] {
3991-
mod powerpc64;
3992-
pub use self::powerpc64::*;
39933950
} else if #[cfg(any(target_arch = "x86_64"))] {
39943951
mod x86_64;
39953952
pub use self::x86_64::*;

src/fuchsia/powerpc64.rs

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)