Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/verify-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def __post_init__(self):
Target("armv7-wrs-vxworks-eabihf", dist=False),
Target("armv7r-none-eabihf", dist=False),
Target("armv7s-apple-ios", dist=False),
Target("hexagon-unknown-linux-musl", dist=False),
# FIXME(hexagon): hits "error: symbol 'fma' is already defined" error
# Target("hexagon-unknown-linux-musl", dist=False),
Target("i386-apple-ios", dist=False),
Target("i686-apple-darwin", dist=False),
Target("i686-unknown-haiku", dist=False),
Expand Down
21 changes: 20 additions & 1 deletion src/new/glibc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,24 @@
//!
//! * Headers: <https://sourceware.org/git/?p=glibc.git> (official)
//! * Headers: <https://github.com/bminor/glibc> (mirror)
//!
//! This module structure is modeled after glibc's source tree. Its build system selects headers
//! from different locations based on the platform, which we mimic here with reexports.

/// Source directory: `posix/`
///
/// <https://github.com/bminor/glibc/tree/master/posix>
mod posix {
pub(crate) mod unistd;
}

/// Source directory: `sysdeps/`
///
/// <https://github.com/bminor/glibc/tree/master/sysdeps>
mod sysdeps {
pub(crate) mod unix;
}

pub(crate) mod unistd;
pub(crate) use posix::*;
#[cfg(target_os = "linux")]
pub(crate) use sysdeps::unix::linux::*;
2 changes: 2 additions & 0 deletions src/new/glibc/unistd.rs → src/new/glibc/posix/unistd.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Header: `unistd.h`
//!
//! <https://github.com/bminor/glibc/blob/master/posix/unistd.h>

pub use crate::new::common::posix::unistd::{
STDERR_FILENO,
Expand Down
10 changes: 10 additions & 0 deletions src/new/glibc/sysdeps/unix/linux/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Source directory: `sysdeps/unix/sysv/linux` (the `sysv` is flattened).
//!
//! <https://github.com/bminor/glibc/tree/master/sysdeps/unix/sysv/linux>

/// Directory: `net/`
///
/// Source directory: `sysdeps/unix/sysv/linux/net`
pub(crate) mod net {
pub(crate) mod route;
}
30 changes: 30 additions & 0 deletions src/new/glibc/sysdeps/unix/linux/net/route.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! Header: `net/route.h`
//!
//! Source header: `sysdeps/unix/sysv/linux/net/route.h`
//! <https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/net/route.h>

use crate::prelude::*;

s! {
pub struct rtentry {
pub rt_pad1: c_ulong,
pub rt_dst: crate::sockaddr,
pub rt_gateway: crate::sockaddr,
pub rt_genmask: crate::sockaddr,
pub rt_flags: c_ushort,
pub rt_pad2: c_short,
pub rt_pad3: c_ulong,
pub rt_tos: c_uchar,
pub rt_class: c_uchar,
// FIXME(1.0): private padding fields
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [c_short; 3usize],
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: c_short,
pub rt_metric: c_short,
pub rt_dev: *mut c_char,
pub rt_mtu: c_ulong,
pub rt_window: c_ulong,
pub rt_irtt: c_ushort,
}
}
6 changes: 6 additions & 0 deletions src/new/glibc/sysdeps/unix/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Source directory: `sysdeps/unix/`
//!
//! <https://github.com/bminor/glibc/tree/master/sysdeps/unix>

#[cfg(target_os = "linux")]
pub(crate) mod linux;
2 changes: 2 additions & 0 deletions src/new/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ cfg_if! {
pub use linux::can::raw::*;
pub use linux::can::*;
pub use linux::keyctl::*;
#[cfg(target_env = "gnu")]
pub use net::route::*;
} else if #[cfg(target_vendor = "apple")] {
pub use signal::*;
}
Expand Down
21 changes: 0 additions & 21 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,6 @@ s! {
pub nm_gid: u32,
}

pub struct rtentry {
pub rt_pad1: c_ulong,
pub rt_dst: crate::sockaddr,
pub rt_gateway: crate::sockaddr,
pub rt_genmask: crate::sockaddr,
pub rt_flags: c_ushort,
pub rt_pad2: c_short,
pub rt_pad3: c_ulong,
pub rt_tos: c_uchar,
pub rt_class: c_uchar,
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [c_short; 3usize],
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: c_short,
pub rt_metric: c_short,
pub rt_dev: *mut c_char,
pub rt_mtu: c_ulong,
pub rt_window: c_ulong,
pub rt_irtt: c_ushort,
}

pub struct ntptimeval {
pub time: crate::timeval,
pub maxerror: c_long,
Expand Down