Skip to content

Commit 160fd3c

Browse files
committed
Auto merge of rust-lang#117354 - GuillaumeGomez:rollup-k9xtq0g, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - rust-lang#115968 (Don't use LFS64 symbols on musl) - rust-lang#117043 (add bootstrap flag `--skip-stage0-validation`) - rust-lang#117082 (Fix closure-inherit-target-feature test for SGX platform) - rust-lang#117312 (memcpy assumptions: link to source showing that GCC makes the same assumption) - rust-lang#117337 (rustdoc: Use `ThinVec` in `GenericParamDefKind`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents bbcc169 + 8b461d0 commit 160fd3c

File tree

14 files changed

+122
-43
lines changed

14 files changed

+122
-43
lines changed

library/core/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
//! assumptions about their semantics: For `memcpy`, `memmove`, `memset`, `memcmp`, and `bcmp`, if
2727
//! the `n` parameter is 0, the function is assumed to not be UB. Furthermore, for `memcpy`, if
2828
//! source and target pointer are equal, the function is assumed to not be UB.
29-
//! (Note that these are [standard assumptions](https://reviews.llvm.org/D86993) among compilers.)
29+
//! (Note that these are standard assumptions among compilers:
30+
//! [clang](https://reviews.llvm.org/D86993) and [GCC](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32667) do the same.)
3031
//! These functions are often provided by the system libc, but can also be provided by the
3132
//! [compiler-builtins crate](https://crates.io/crates/compiler_builtins).
3233
//! Note that the library does not guarantee that it will always make these assumptions, so Rust

library/std/src/os/linux/fs.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,14 @@ pub trait MetadataExt {
329329
impl MetadataExt for Metadata {
330330
#[allow(deprecated)]
331331
fn as_raw_stat(&self) -> &raw::stat {
332-
unsafe { &*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat) }
332+
#[cfg(target_env = "musl")]
333+
unsafe {
334+
&*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat)
335+
}
336+
#[cfg(not(target_env = "musl"))]
337+
unsafe {
338+
&*(self.as_inner().as_inner() as *const libc::stat64 as *const raw::stat)
339+
}
333340
}
334341
fn st_dev(&self) -> u64 {
335342
self.as_inner().as_inner().st_dev as u64

library/std/src/sys/unix/fd.rs

+20-4
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,17 @@ impl FileDesc {
126126
}
127127

128128
pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
129-
#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))]
129+
#[cfg(not(any(
130+
all(target_os = "linux", not(target_env = "musl")),
131+
target_os = "android",
132+
target_os = "hurd"
133+
)))]
130134
use libc::pread as pread64;
131-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))]
135+
#[cfg(any(
136+
all(target_os = "linux", not(target_env = "musl")),
137+
target_os = "android",
138+
target_os = "hurd"
139+
))]
132140
use libc::pread64;
133141

134142
unsafe {
@@ -285,9 +293,17 @@ impl FileDesc {
285293
}
286294

287295
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
288-
#[cfg(not(any(target_os = "linux", target_os = "android", target_os = "hurd")))]
296+
#[cfg(not(any(
297+
all(target_os = "linux", not(target_env = "musl")),
298+
target_os = "android",
299+
target_os = "hurd"
300+
)))]
289301
use libc::pwrite as pwrite64;
290-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "hurd"))]
302+
#[cfg(any(
303+
all(target_os = "linux", not(target_env = "musl")),
304+
target_os = "android",
305+
target_os = "hurd"
306+
))]
291307
use libc::pwrite64;
292308

293309
unsafe {

library/std/src/sys/unix/fs.rs

+14-9
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ use libc::{c_int, mode_t};
4040
))]
4141
use libc::c_char;
4242
#[cfg(any(
43-
target_os = "linux",
43+
all(target_os = "linux", not(target_env = "musl")),
4444
target_os = "emscripten",
4545
target_os = "android",
46-
target_os = "hurd",
46+
target_os = "hurd"
4747
))]
4848
use libc::dirfd;
49-
#[cfg(any(target_os = "linux", target_os = "emscripten", target_os = "hurd"))]
49+
#[cfg(any(
50+
all(target_os = "linux", not(target_env = "musl")),
51+
target_os = "emscripten",
52+
target_os = "hurd"
53+
))]
5054
use libc::fstatat64;
5155
#[cfg(any(
5256
target_os = "android",
@@ -57,9 +61,10 @@ use libc::fstatat64;
5761
target_os = "aix",
5862
target_os = "nto",
5963
target_os = "vita",
64+
all(target_os = "linux", target_env = "musl"),
6065
))]
6166
use libc::readdir as readdir64;
62-
#[cfg(any(target_os = "linux", target_os = "hurd"))]
67+
#[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))]
6368
use libc::readdir64;
6469
#[cfg(any(target_os = "emscripten", target_os = "l4re"))]
6570
use libc::readdir64_r;
@@ -84,7 +89,7 @@ use libc::{
8489
lstat as lstat64, off64_t, open as open64, stat as stat64,
8590
};
8691
#[cfg(not(any(
87-
target_os = "linux",
92+
all(target_os = "linux", not(target_env = "musl")),
8893
target_os = "emscripten",
8994
target_os = "l4re",
9095
target_os = "android",
@@ -95,7 +100,7 @@ use libc::{
95100
lstat as lstat64, off_t as off64_t, open as open64, stat as stat64,
96101
};
97102
#[cfg(any(
98-
target_os = "linux",
103+
all(target_os = "linux", not(target_env = "musl")),
99104
target_os = "emscripten",
100105
target_os = "l4re",
101106
target_os = "hurd"
@@ -853,10 +858,10 @@ impl DirEntry {
853858

854859
#[cfg(all(
855860
any(
856-
target_os = "linux",
861+
all(target_os = "linux", not(target_env = "musl")),
857862
target_os = "emscripten",
858863
target_os = "android",
859-
target_os = "hurd",
864+
target_os = "hurd"
860865
),
861866
not(miri)
862867
))]
@@ -882,7 +887,7 @@ impl DirEntry {
882887

883888
#[cfg(any(
884889
not(any(
885-
target_os = "linux",
890+
all(target_os = "linux", not(target_env = "musl")),
886891
target_os = "emscripten",
887892
target_os = "android",
888893
target_os = "hurd",

src/bootstrap/src/core/config/config.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1274,8 +1274,9 @@ impl Config {
12741274
}
12751275

12761276
config.initial_rustc = if let Some(rustc) = build.rustc {
1277-
// FIXME(#115065): re-enable this check
1278-
// config.check_build_rustc_version(&rustc);
1277+
if !flags.skip_stage0_validation {
1278+
config.check_build_rustc_version(&rustc);
1279+
}
12791280
PathBuf::from(rustc)
12801281
} else {
12811282
config.download_beta_toolchain();

src/bootstrap/src/core/config/flags.rs

+3
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ pub struct Flags {
155155
/// Enable BOLT link flags
156156
#[arg(global(true), long)]
157157
pub enable_bolt_settings: bool,
158+
/// Skip stage0 compiler validation
159+
#[arg(global(true), long)]
160+
pub skip_stage0_validation: bool,
158161
/// Additional reproducible artifacts that should be added to the reproducible artifacts archive.
159162
#[arg(global(true), long)]
160163
pub reproducible_artifact: Vec<String>,

src/etc/completions/x.py.fish

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ complete -c x.py -n "__fish_use_subcommand" -l dry-run -d 'dry run; don\'t build
2828
complete -c x.py -n "__fish_use_subcommand" -l json-output -d 'use message-format=json'
2929
complete -c x.py -n "__fish_use_subcommand" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
3030
complete -c x.py -n "__fish_use_subcommand" -l enable-bolt-settings -d 'Enable BOLT link flags'
31+
complete -c x.py -n "__fish_use_subcommand" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
3132
complete -c x.py -n "__fish_use_subcommand" -s h -l help -d 'Print help'
3233
complete -c x.py -n "__fish_use_subcommand" -f -a "build" -d 'Compile either the compiler or libraries'
3334
complete -c x.py -n "__fish_use_subcommand" -f -a "check" -d 'Compile either the compiler or libraries, using cargo check'
@@ -73,6 +74,7 @@ complete -c x.py -n "__fish_seen_subcommand_from build" -l dry-run -d 'dry run;
7374
complete -c x.py -n "__fish_seen_subcommand_from build" -l json-output -d 'use message-format=json'
7475
complete -c x.py -n "__fish_seen_subcommand_from build" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
7576
complete -c x.py -n "__fish_seen_subcommand_from build" -l enable-bolt-settings -d 'Enable BOLT link flags'
77+
complete -c x.py -n "__fish_seen_subcommand_from build" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
7678
complete -c x.py -n "__fish_seen_subcommand_from build" -s h -l help -d 'Print help (see more with \'--help\')'
7779
complete -c x.py -n "__fish_seen_subcommand_from check" -l config -d 'TOML configuration file for build' -r -F
7880
complete -c x.py -n "__fish_seen_subcommand_from check" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -105,6 +107,7 @@ complete -c x.py -n "__fish_seen_subcommand_from check" -l dry-run -d 'dry run;
105107
complete -c x.py -n "__fish_seen_subcommand_from check" -l json-output -d 'use message-format=json'
106108
complete -c x.py -n "__fish_seen_subcommand_from check" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
107109
complete -c x.py -n "__fish_seen_subcommand_from check" -l enable-bolt-settings -d 'Enable BOLT link flags'
110+
complete -c x.py -n "__fish_seen_subcommand_from check" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
108111
complete -c x.py -n "__fish_seen_subcommand_from check" -s h -l help -d 'Print help (see more with \'--help\')'
109112
complete -c x.py -n "__fish_seen_subcommand_from clippy" -s A -d 'clippy lints to allow' -r
110113
complete -c x.py -n "__fish_seen_subcommand_from clippy" -s D -d 'clippy lints to deny' -r
@@ -141,6 +144,7 @@ complete -c x.py -n "__fish_seen_subcommand_from clippy" -l dry-run -d 'dry run;
141144
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l json-output -d 'use message-format=json'
142145
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
143146
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l enable-bolt-settings -d 'Enable BOLT link flags'
147+
complete -c x.py -n "__fish_seen_subcommand_from clippy" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
144148
complete -c x.py -n "__fish_seen_subcommand_from clippy" -s h -l help -d 'Print help (see more with \'--help\')'
145149
complete -c x.py -n "__fish_seen_subcommand_from fix" -l config -d 'TOML configuration file for build' -r -F
146150
complete -c x.py -n "__fish_seen_subcommand_from fix" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -172,6 +176,7 @@ complete -c x.py -n "__fish_seen_subcommand_from fix" -l dry-run -d 'dry run; do
172176
complete -c x.py -n "__fish_seen_subcommand_from fix" -l json-output -d 'use message-format=json'
173177
complete -c x.py -n "__fish_seen_subcommand_from fix" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
174178
complete -c x.py -n "__fish_seen_subcommand_from fix" -l enable-bolt-settings -d 'Enable BOLT link flags'
179+
complete -c x.py -n "__fish_seen_subcommand_from fix" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
175180
complete -c x.py -n "__fish_seen_subcommand_from fix" -s h -l help -d 'Print help (see more with \'--help\')'
176181
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l config -d 'TOML configuration file for build' -r -F
177182
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -204,6 +209,7 @@ complete -c x.py -n "__fish_seen_subcommand_from fmt" -l dry-run -d 'dry run; do
204209
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l json-output -d 'use message-format=json'
205210
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
206211
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l enable-bolt-settings -d 'Enable BOLT link flags'
212+
complete -c x.py -n "__fish_seen_subcommand_from fmt" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
207213
complete -c x.py -n "__fish_seen_subcommand_from fmt" -s h -l help -d 'Print help (see more with \'--help\')'
208214
complete -c x.py -n "__fish_seen_subcommand_from doc" -l config -d 'TOML configuration file for build' -r -F
209215
complete -c x.py -n "__fish_seen_subcommand_from doc" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -237,6 +243,7 @@ complete -c x.py -n "__fish_seen_subcommand_from doc" -l dry-run -d 'dry run; do
237243
complete -c x.py -n "__fish_seen_subcommand_from doc" -l json-output -d 'use message-format=json'
238244
complete -c x.py -n "__fish_seen_subcommand_from doc" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
239245
complete -c x.py -n "__fish_seen_subcommand_from doc" -l enable-bolt-settings -d 'Enable BOLT link flags'
246+
complete -c x.py -n "__fish_seen_subcommand_from doc" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
240247
complete -c x.py -n "__fish_seen_subcommand_from doc" -s h -l help -d 'Print help (see more with \'--help\')'
241248
complete -c x.py -n "__fish_seen_subcommand_from test" -l skip -d 'skips tests matching SUBSTRING, if supported by test tool. May be passed multiple times' -r -F
242249
complete -c x.py -n "__fish_seen_subcommand_from test" -l test-args -d 'extra arguments to be passed for the test tool being used (e.g. libtest, compiletest or rustdoc)' -r
@@ -281,6 +288,7 @@ complete -c x.py -n "__fish_seen_subcommand_from test" -l dry-run -d 'dry run; d
281288
complete -c x.py -n "__fish_seen_subcommand_from test" -l json-output -d 'use message-format=json'
282289
complete -c x.py -n "__fish_seen_subcommand_from test" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
283290
complete -c x.py -n "__fish_seen_subcommand_from test" -l enable-bolt-settings -d 'Enable BOLT link flags'
291+
complete -c x.py -n "__fish_seen_subcommand_from test" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
284292
complete -c x.py -n "__fish_seen_subcommand_from test" -s h -l help -d 'Print help (see more with \'--help\')'
285293
complete -c x.py -n "__fish_seen_subcommand_from bench" -l test-args -r
286294
complete -c x.py -n "__fish_seen_subcommand_from bench" -l config -d 'TOML configuration file for build' -r -F
@@ -313,6 +321,7 @@ complete -c x.py -n "__fish_seen_subcommand_from bench" -l dry-run -d 'dry run;
313321
complete -c x.py -n "__fish_seen_subcommand_from bench" -l json-output -d 'use message-format=json'
314322
complete -c x.py -n "__fish_seen_subcommand_from bench" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
315323
complete -c x.py -n "__fish_seen_subcommand_from bench" -l enable-bolt-settings -d 'Enable BOLT link flags'
324+
complete -c x.py -n "__fish_seen_subcommand_from bench" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
316325
complete -c x.py -n "__fish_seen_subcommand_from bench" -s h -l help -d 'Print help'
317326
complete -c x.py -n "__fish_seen_subcommand_from clean" -l stage -d 'Clean a specific stage without touching other artifacts. By default, every stage is cleaned if this option is not used' -r
318327
complete -c x.py -n "__fish_seen_subcommand_from clean" -l config -d 'TOML configuration file for build' -r -F
@@ -345,6 +354,7 @@ complete -c x.py -n "__fish_seen_subcommand_from clean" -l dry-run -d 'dry run;
345354
complete -c x.py -n "__fish_seen_subcommand_from clean" -l json-output -d 'use message-format=json'
346355
complete -c x.py -n "__fish_seen_subcommand_from clean" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
347356
complete -c x.py -n "__fish_seen_subcommand_from clean" -l enable-bolt-settings -d 'Enable BOLT link flags'
357+
complete -c x.py -n "__fish_seen_subcommand_from clean" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
348358
complete -c x.py -n "__fish_seen_subcommand_from clean" -s h -l help -d 'Print help'
349359
complete -c x.py -n "__fish_seen_subcommand_from dist" -l config -d 'TOML configuration file for build' -r -F
350360
complete -c x.py -n "__fish_seen_subcommand_from dist" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -376,6 +386,7 @@ complete -c x.py -n "__fish_seen_subcommand_from dist" -l dry-run -d 'dry run; d
376386
complete -c x.py -n "__fish_seen_subcommand_from dist" -l json-output -d 'use message-format=json'
377387
complete -c x.py -n "__fish_seen_subcommand_from dist" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
378388
complete -c x.py -n "__fish_seen_subcommand_from dist" -l enable-bolt-settings -d 'Enable BOLT link flags'
389+
complete -c x.py -n "__fish_seen_subcommand_from dist" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
379390
complete -c x.py -n "__fish_seen_subcommand_from dist" -s h -l help -d 'Print help'
380391
complete -c x.py -n "__fish_seen_subcommand_from install" -l config -d 'TOML configuration file for build' -r -F
381392
complete -c x.py -n "__fish_seen_subcommand_from install" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -407,6 +418,7 @@ complete -c x.py -n "__fish_seen_subcommand_from install" -l dry-run -d 'dry run
407418
complete -c x.py -n "__fish_seen_subcommand_from install" -l json-output -d 'use message-format=json'
408419
complete -c x.py -n "__fish_seen_subcommand_from install" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
409420
complete -c x.py -n "__fish_seen_subcommand_from install" -l enable-bolt-settings -d 'Enable BOLT link flags'
421+
complete -c x.py -n "__fish_seen_subcommand_from install" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
410422
complete -c x.py -n "__fish_seen_subcommand_from install" -s h -l help -d 'Print help'
411423
complete -c x.py -n "__fish_seen_subcommand_from run" -l args -d 'arguments for the tool' -r
412424
complete -c x.py -n "__fish_seen_subcommand_from run" -l config -d 'TOML configuration file for build' -r -F
@@ -439,6 +451,7 @@ complete -c x.py -n "__fish_seen_subcommand_from run" -l dry-run -d 'dry run; do
439451
complete -c x.py -n "__fish_seen_subcommand_from run" -l json-output -d 'use message-format=json'
440452
complete -c x.py -n "__fish_seen_subcommand_from run" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
441453
complete -c x.py -n "__fish_seen_subcommand_from run" -l enable-bolt-settings -d 'Enable BOLT link flags'
454+
complete -c x.py -n "__fish_seen_subcommand_from run" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
442455
complete -c x.py -n "__fish_seen_subcommand_from run" -s h -l help -d 'Print help (see more with \'--help\')'
443456
complete -c x.py -n "__fish_seen_subcommand_from setup" -l config -d 'TOML configuration file for build' -r -F
444457
complete -c x.py -n "__fish_seen_subcommand_from setup" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -470,6 +483,7 @@ complete -c x.py -n "__fish_seen_subcommand_from setup" -l dry-run -d 'dry run;
470483
complete -c x.py -n "__fish_seen_subcommand_from setup" -l json-output -d 'use message-format=json'
471484
complete -c x.py -n "__fish_seen_subcommand_from setup" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
472485
complete -c x.py -n "__fish_seen_subcommand_from setup" -l enable-bolt-settings -d 'Enable BOLT link flags'
486+
complete -c x.py -n "__fish_seen_subcommand_from setup" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
473487
complete -c x.py -n "__fish_seen_subcommand_from setup" -s h -l help -d 'Print help (see more with \'--help\')'
474488
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l config -d 'TOML configuration file for build' -r -F
475489
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `config.toml`' -r -f -a "(__fish_complete_directories)"
@@ -502,4 +516,5 @@ complete -c x.py -n "__fish_seen_subcommand_from suggest" -l dry-run -d 'dry run
502516
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l json-output -d 'use message-format=json'
503517
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc'
504518
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l enable-bolt-settings -d 'Enable BOLT link flags'
519+
complete -c x.py -n "__fish_seen_subcommand_from suggest" -l skip-stage0-validation -d 'Skip stage0 compiler validation'
505520
complete -c x.py -n "__fish_seen_subcommand_from suggest" -s h -l help -d 'Print help (see more with \'--help\')'

0 commit comments

Comments
 (0)