Skip to content

Commit 5431bdb

Browse files
authored
Merge pull request #3878 from tgross35/main-thyme
[main] Apply three pull requests to `main`
2 parents d2281e7 + 3935a88 commit 5431bdb

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

ci/build.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set -ex
1111
: "${OS?The OS environment variable must be set.}"
1212

1313
RUST=${TOOLCHAIN}
14+
VERBOSE=-v
1415

1516
echo "Testing Rust ${RUST} on ${OS}"
1617

@@ -41,50 +42,50 @@ test_target() {
4142

4243
# Test that libc builds without any default features (no std)
4344
if [ "${NO_STD}" != "1" ]; then
44-
cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}"
45+
cargo "+${RUST}" "${BUILD_CMD}" "$VERBOSE" --no-default-features --target "${TARGET}"
4546
else
4647
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
4748
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
48-
-Z build-std=core,alloc -vv --no-default-features --target "${TARGET}"
49+
-Z build-std=core,alloc "$VERBOSE" --no-default-features --target "${TARGET}"
4950
fi
5051
# Test that libc builds with default features (e.g. std)
5152
# if the target supports std
5253
if [ "$NO_STD" != "1" ]; then
53-
cargo "+${RUST}" "${BUILD_CMD}" -vv --target "${TARGET}"
54+
cargo "+${RUST}" "${BUILD_CMD}" "$VERBOSE" --target "${TARGET}"
5455
else
5556
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
56-
-Z build-std=core,alloc -vv --target "${TARGET}"
57+
-Z build-std=core,alloc "$VERBOSE" --target "${TARGET}"
5758
fi
5859

5960
# Test that libc builds with the `extra_traits` feature
6061
if [ "${NO_STD}" != "1" ]; then
61-
cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
62+
cargo "+${RUST}" "${BUILD_CMD}" "$VERBOSE" --no-default-features --target "${TARGET}" \
6263
--features extra_traits
6364
else
6465
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
65-
-Z build-std=core,alloc -vv --no-default-features \
66+
-Z build-std=core,alloc "$VERBOSE" --no-default-features \
6667
--target "${TARGET}" --features extra_traits
6768
fi
6869

6970
# Test the 'const-extern-fn' feature on nightly
7071
if [ "${RUST}" = "nightly" ]; then
7172
if [ "${NO_STD}" != "1" ]; then
72-
cargo "+${RUST}" "${BUILD_CMD}" -vv --no-default-features --target "${TARGET}" \
73+
cargo "+${RUST}" "${BUILD_CMD}" "$VERBOSE" --no-default-features --target "${TARGET}" \
7374
--features const-extern-fn
7475
else
7576
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
76-
-Z build-std=core,alloc -vv --no-default-features \
77+
-Z build-std=core,alloc "$VERBOSE" --no-default-features \
7778
--target "${TARGET}" --features const-extern-fn
7879
fi
7980
fi
8081

8182
# Also test that it builds with `extra_traits` and default features:
8283
if [ "$NO_STD" != "1" ]; then
83-
cargo "+${RUST}" "${BUILD_CMD}" -vv --target "${TARGET}" \
84+
cargo "+${RUST}" "${BUILD_CMD}" "$VERBOSE" --target "${TARGET}" \
8485
--features extra_traits
8586
else
8687
RUSTFLAGS="-A improper_ctypes_definitions" cargo "+${RUST}" "${BUILD_CMD}" \
87-
-Z build-std=core,alloc -vv --target "${TARGET}" \
88+
-Z build-std=core,alloc "$VERBOSE" --target "${TARGET}" \
8889
--features extra_traits
8990
fi
9091
}

libc-test/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "libc-test"
33
version = "0.2.151"
4+
edition = "2018"
45
authors = ["The Rust Project Developers"]
56
license = "MIT OR Apache-2.0"
67
build = "build.rs"

libc-test/build.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ fn do_semver() {
8282
let target_env = env::var("CARGO_CFG_TARGET_ENV").unwrap();
8383

8484
// `libc-test/semver` dir.
85-
let mut semver_root = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
86-
semver_root.push("semver");
85+
let mut semver_root = PathBuf::from("semver");
8786

8887
// NOTE: Windows has the same `family` as `os`, no point in including it
8988
// twice.
@@ -93,7 +92,10 @@ fn do_semver() {
9392
if family != os && os != "android" {
9493
process_semver_file(&mut output, &mut semver_root, &family);
9594
}
96-
process_semver_file(&mut output, &mut semver_root, &vendor);
95+
// We don't do semver for unknown targets.
96+
if vendor != "unknown" {
97+
process_semver_file(&mut output, &mut semver_root, &vendor);
98+
}
9799
process_semver_file(&mut output, &mut semver_root, &os);
98100
let os_arch = format!("{}-{}", os, arch);
99101
process_semver_file(&mut output, &mut semver_root, &os_arch);
@@ -141,6 +143,9 @@ fn process_semver_file<W: Write, P: AsRef<Path>>(output: &mut W, path: &mut Path
141143
}
142144

143145
fn main() {
146+
// Avoid unnecessary re-building.
147+
println!("cargo:rerun-if-changed=build.rs");
148+
144149
do_cc();
145150
do_ctest();
146151
do_semver();

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

+1
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ extern "C" {
431431
pub fn setrlimit(resource: ::__rlimit_resource_t, rlim: *const ::rlimit) -> ::c_int;
432432
pub fn getpriority(which: ::__priority_which_t, who: ::id_t) -> ::c_int;
433433
pub fn setpriority(which: ::__priority_which_t, who: ::id_t, prio: ::c_int) -> ::c_int;
434+
pub fn getauxval(type_: ::c_ulong) -> ::c_ulong;
434435
}
435436

436437
cfg_if! {

0 commit comments

Comments
 (0)