Skip to content

Commit caee856

Browse files
committed
Auto merge of #1077 - jhwgh1968:mips-uclibc, r=alexcrichton
Fix mips-unknown-linux-uclibc target The mips(el)-unknown-linux-uclibc target has apparently been broken in one way or another for over a year. This PR is the patch it took to successfully build a beta toolchain that could support it. I am pretty sure these fixes are the right answer, after considerable digging in both the libc crate source (_pub-use pub-use everywhere, and not a hint to link_) and the uClibc source (_it's not POSIX, but they've shipped it since 2007, so close enough_). For those who don't know, the *-uClibc targets are the only way (AFAIK) to create Rust binaries which run on Linux kernels prior to 2.6. It is a use case that is getting quite rare these days, but is still present in embedded ecosystems where chip vendors never migrated their hardware support to newer kernel versions. Here's hoping these Rust toolchain targets find a maintainer someday. cc rust-lang/rust#43503
2 parents 63eb3b7 + 361e454 commit caee856

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/unix/uclibc/mips/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ pub const SO_BPF_EXTENSIONS: ::c_int = 48;
226226
pub const FIOCLEX: ::c_ulong = 0x6601;
227227
pub const FIONBIO: ::c_ulong = 0x667e;
228228

229-
pub const SA_ONSTACK: ::c_int = 0x08000000;
230-
pub const SA_SIGINFO: ::c_int = 0x00000008;
229+
pub const SA_ONSTACK: ::c_uint = 0x08000000;
230+
pub const SA_SIGINFO: ::c_uint = 0x00000008;
231231
pub const SA_NOCLDWAIT: ::c_int = 0x00010000;
232232

233233
pub const SIGCHLD: ::c_int = 18;

src/unix/uclibc/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,8 @@ extern {
16341634
pub fn uselocale(loc: ::locale_t) -> ::locale_t;
16351635
pub fn creat64(path: *const c_char, mode: mode_t) -> ::c_int;
16361636
pub fn fstat64(fildes: ::c_int, buf: *mut stat64) -> ::c_int;
1637+
pub fn fstatat64(fildes: ::c_int, path: *const ::c_char,
1638+
buf: *mut stat64, flag: ::c_int) -> ::c_int;
16371639
pub fn ftruncate64(fd: ::c_int, length: off64_t) -> ::c_int;
16381640
pub fn getrlimit64(resource: ::c_int, rlim: *mut rlimit64) -> ::c_int;
16391641
pub fn lseek64(fd: ::c_int, offset: off64_t, whence: ::c_int) -> off64_t;
@@ -1853,6 +1855,8 @@ extern {
18531855

18541856
pub fn seekdir(dirp: *mut ::DIR, loc: ::c_long);
18551857

1858+
pub fn dirfd(dirp: *mut ::DIR) -> ::c_int;
1859+
18561860
pub fn telldir(dirp: *mut ::DIR) -> ::c_long;
18571861
pub fn madvise(addr: *mut ::c_void, len: ::size_t, advice: ::c_int)
18581862
-> ::c_int;

0 commit comments

Comments
 (0)