Skip to content

Commit

Permalink
Upgrade FreeBSD ABi used on std to 12
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 11, 2023
1 parent a17ff20 commit e1c7696
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ fn main() {
);
}

// The ABI of libc used by libstd is backward compatible with FreeBSD 10.
// The ABI of libc used by std is backward compatible with FreeBSD 12.
// The ABI of libc from crates.io is backward compatible with FreeBSD 11.
//
// On CI, we detect the actual FreeBSD version and match its ABI exactly,
// running tests to ensure that the ABI is correct.
match which_freebsd() {
Some(10) if libc_ci || rustc_dep_of_std => set_cfg("freebsd10"),
Some(10) if libc_ci => set_cfg("freebsd10"),
Some(11) if libc_ci => set_cfg("freebsd11"),
Some(12) if libc_ci => set_cfg("freebsd12"),
Some(12) if libc_ci || rustc_dep_of_std => set_cfg("freebsd12"),
Some(13) if libc_ci => set_cfg("freebsd13"),
Some(14) if libc_ci => set_cfg("freebsd14"),
Some(_) | None => set_cfg("freebsd11"),
Expand Down
6 changes: 3 additions & 3 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ test_target() {
done
fi

# Test that libc builds without any default features (no libstd)
# Test that libc builds without any default features (no std)
if [ "${NO_STD}" != "1" ]; then
cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}"
else
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
-Z build-std=core,alloc -vv --no-default-features --target "${TARGET}"
fi
# Test that libc builds with default features (e.g. libstd)
# if the target supports libstd
# Test that libc builds with default features (e.g. std)
# if the target supports std
if [ "$NO_STD" != "1" ]; then
cargo "+${RUST}" "${BUILD_CMD}" -vv --target "${TARGET}"
else
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/aarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY install-musl.sh /
RUN sh /install-musl.sh aarch64

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
CC_aarch64_unknown_linux_musl=musl-gcc \
RUSTFLAGS='-Clink-args=-lgcc -L /musl-aarch64/lib' \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/mips64-unknown-linux-muslabi64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY install-musl.sh /
RUN sh /install-musl.sh mips64

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
ENV PATH=$PATH:/musl-mips64/bin:/rust/bin \
CC_mips64_unknown_linux_muslabi64=musl-gcc \
RUSTFLAGS='-Clink-args=-lgcc -L /musl-mips64/lib' \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/mips64el-unknown-linux-muslabi64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY install-musl.sh /
RUN sh /install-musl.sh mips64el

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
ENV PATH=$PATH:/musl-mips64el/bin:/rust/bin \
CC_mips64el_unknown_linux_muslabi64=musl-gcc \
RUSTFLAGS='-Clink-args=-lgcc -L /musl-mips64el/lib' \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/s390x-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY install-musl.sh /
RUN sh /install-musl.sh s390x

# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in std?
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /musl-s390x" \
CC_s390x_unknown_linux_gnu=musl-gcc \
Expand Down
2 changes: 1 addition & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ fn test_apple(target: &str) {
// close calls the close_nocancel system call
"close" => true,

// FIXME: libstd removed libresolv support: https://github.com/rust-lang/rust/pull/102766
// FIXME: std removed libresolv support: https://github.com/rust-lang/rust/pull/102766
"res_init" => true,

// FIXME: remove once the target in CI is updated
Expand Down
2 changes: 1 addition & 1 deletion src/unix/haiku/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ pub const LC_NUMERIC: ::c_int = 4;
pub const LC_TIME: ::c_int = 5;
pub const LC_MESSAGES: ::c_int = 6;

// FIXME: Haiku does not have MAP_FILE, but libstd/os.rs requires it
// FIXME: Haiku does not have MAP_FILE, but library/std/os.rs requires it
pub const MAP_FILE: ::c_int = 0x00;
pub const MAP_SHARED: ::c_int = 0x01;
pub const MAP_PRIVATE: ::c_int = 0x02;
Expand Down
2 changes: 1 addition & 1 deletion src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ cfg_if! {
if #[cfg(any(target_os = "l4re", target_os = "espidf"))] {
// required libraries for L4Re and the ESP-IDF framework are linked externally, ATM
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// cargo build, don't pull in anything extra as the std dep
// already pulls in all libs.
} else if #[cfg(all(target_os = "linux",
any(target_env = "gnu", target_env = "uclibc"),
Expand Down
2 changes: 1 addition & 1 deletion src/unix/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub type nfds_t = ::c_ulong;
pub type nlink_t = ::c_ulong;
pub type off_t = ::c_longlong;
pub type pthread_t = *mut ::c_void;
// Must be usize due to libstd/sys_common/thread_local.rs,
// Must be usize due to library/std/sys_common/thread_local.rs,
// should technically be *mut ::c_void
pub type pthread_key_t = usize;
pub type rlim_t = ::c_ulonglong;
Expand Down
4 changes: 2 additions & 2 deletions src/vxworks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ pub const EAI_SERVICE: ::c_int = 9;
pub const EAI_SOCKTYPE: ::c_int = 10;
pub const EAI_SYSTEM: ::c_int = 11;

// This is not defined in vxWorks, but we have to define it here
// to make the building pass for getrandom and libstd, FIXME
// FIXME: This is not defined in vxWorks, but we have to define it here
// to make the building pass for getrandom and std
pub const RTLD_DEFAULT: *mut ::c_void = 0i64 as *mut ::c_void;

//Clock Lib Stuff
Expand Down

0 comments on commit e1c7696

Please sign in to comment.