Skip to content

Commit 57b1d92

Browse files
committed
Auto merge of #2566 - skrap:master, r=Amanieu
memfd_create is a glibc API, which is not present on uclibc I think the title says it all! The `armv7-unknown-linux-uclibceabihf` tier-3 target does not build without this change, and I suspect all other uclibc builds are broken as well. It's a good reminder to try to add some CI validation of the uclibc build, which I will try to do in a followup PR. To test this, get and unpack https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--bleeding-edge-2020.08-1.tar.bz2 Note instances of `PATH_HERE` below which you'll have to customize for your system. config.toml: ``` [target.armv7-unknown-linux-uclibceabihf] linker = "/PATH_HERE/buildroot-armv7/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gcc" runner = "qemu-arm -L /PATH_HERE/armv7-eabihf--uclibc--bleeding-edge-2020.08-1/arm-buildroot-linux-uclibcgnueabihf/sysroot/" ``` Then run: ``` cd libc-test CC_armv7_unknown_linux_uclibceabihf=/PATH_HERE/armv7-eabihf--uclibc--bleeding-edge-2020.08-1/bin/arm-buildroot-linux-uclibcgnueabihf-gcc cargo +nightly test -Zbuild-std --target armv7-unknown-linux-uclibceabihf ``` (if there's a way to include that `CC_armv7_etc` cross CC in the config.toml, I'm all ears!)
2 parents dd76900 + 6e0c3be commit 57b1d92

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

ci/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ for TARGET in $TARGETS; do
216216
fi
217217
done
218218

219+
# Targets which are not available via rustup and must be built with -Zbuild-std
219220
RUST_LINUX_NO_CORE_TARGETS="\
220221
aarch64-pc-windows-msvc \
221222
aarch64-unknown-freebsd \
@@ -225,6 +226,7 @@ aarch64-unknown-openbsd \
225226
aarch64-wrs-vxworks \
226227
armebv7r-none-eabi \
227228
armebv7r-none-eabihf \
229+
armv7-unknown-linux-uclibceabihf \
228230
armv7-wrs-vxworks-eabihf \
229231
armv7r-none-eabi \
230232
armv7r-none-eabihf \

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,8 @@ extern "C" {
13331333
pub fn pthread_setname_np(thread: ::pthread_t, name: *const ::c_char) -> ::c_int;
13341334

13351335
pub fn sethostid(hostid: ::c_long) -> ::c_int;
1336+
1337+
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
13361338
}
13371339

13381340
extern "C" {

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3923,8 +3923,6 @@ extern "C" {
39233923
needlelen: ::size_t,
39243924
) -> *mut ::c_void;
39253925
pub fn sched_getcpu() -> ::c_int;
3926-
3927-
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
39283926
}
39293927

39303928
cfg_if! {

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ extern "C" {
770770
pub fn clock_adjtime(clk_id: ::clockid_t, buf: *mut ::timex) -> ::c_int;
771771

772772
pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
773+
774+
pub fn memfd_create(name: *const ::c_char, flags: ::c_uint) -> ::c_int;
773775
}
774776

775777
cfg_if! {

0 commit comments

Comments
 (0)