Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade FreeBSD ABi used on std to 12 #3434

Merged
merged 1 commit into from Nov 11, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.rs
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
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
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/s390x-unknown-linux-musl/Dockerfile
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
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
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
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
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
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