Commit Graph

1291 Commits

Author SHA1 Message Date
antoyo
7dad07a67c
Merge pull request #396 from GuillaumeGomez/rustify-clean-all
Rustify `clean_all.sh`
2023-12-20 10:09:16 -05:00
Guillaume Gomez
e26e074261 Rustify clean_all.sh 2023-12-20 15:47:50 +01:00
Guillaume Gomez
05ef68961b Remove unused build_sysroot.sh file 2023-12-20 14:47:42 +01:00
antoyo
e0c4d65e07
Merge pull request #384 from GuillaumeGomez/rustify-test
Rustify test.sh
2023-12-19 17:06:40 -05:00
Guillaume Gomez
8e870c75d9 Remove unused TestArgs::use_backend and display messages in case a test is not run 2023-12-19 22:25:48 +01:00
Guillaume Gomez
6e53832eda Simplify Runner type alias 2023-12-19 21:15:28 +01:00
antoyo
db494375ab
Merge pull request #382 from sadlerap/impl-generic-arithmetic-pass
simd: implement missing intrinsics from simd/generic-arithmetic-pass.rs
2023-12-19 13:00:35 -05:00
Guillaume Gomez
a46066ca23 Remove ignored commands from gcc12 CI 2023-12-19 16:55:22 +01:00
Guillaume Gomez
984e045848 Show output of --mini-tests and --std-tests commands 2023-12-19 16:54:02 +01:00
Guillaume Gomez
bb4fd2c638 Simplify code by removing unneeded pattern matching 2023-12-19 01:16:29 +01:00
Guillaume Gomez
f516c96811 Add comment about why -Cpanic=abort option is needed 2023-12-19 01:07:01 +01:00
Guillaume Gomez
a8b0e30a8b Error earlier if the rustc host cannot be found 2023-12-18 23:25:23 +01:00
Nicholas Nethercote
472ea06999 Add level arg to into_diagnostic.
And make all hand-written `IntoDiagnostic` impls generic, by using
`DiagnosticBuilder::new(dcx, level, ...)` instead of e.g.
`dcx.struct_err(...)`.

This means the `create_*` functions are the source of the error level.
This change will let us remove `struct_diagnostic`.

Note: `#[rustc_lint_diagnostics]` is added to `DiagnosticBuilder::new`,
it's necessary to pass diagnostics tests now that it's used in
`into_diagnostic` functions.
2023-12-19 09:19:25 +11:00
Nicholas Nethercote
5ea71c1150 Rename many DiagCtxt arguments. 2023-12-18 16:06:22 +11:00
Nicholas Nethercote
a5c63ae13b Rename CodegenContext::create_diag_handler as CodegenContext::create_dcx. 2023-12-18 16:06:21 +11:00
Nicholas Nethercote
590e0d9573 Rename Handler as DiagCtxt. 2023-12-18 16:06:19 +11:00
bors
335e3ec566 Auto merge of #118828 - mu001999:master, r=b-naber
Remove dead codes in rustc_codegen_gcc

Detected by #118257
2023-12-17 12:15:56 +00:00
Guillaume Gomez
9882d7c511 Apply suggestions 2023-12-16 17:56:03 +01:00
Guillaume Gomez
95dfe5ec90 Simplify split_args code, add a unit test for it and run it into CI 2023-12-16 17:39:58 +01:00
Guillaume Gomez
db9b932314 Fix sysroot build 2023-12-14 17:11:35 +01:00
Urgau
b1affb9321 Move rustc_codegen_ssa target features to rustc_target 2023-12-14 14:40:55 +01:00
Lukasz Anforowicz
e1f039f562 Add unstable -Zdefault-hidden-visibility cmdline flag for rustc.
The new flag has been described in the Major Change Proposal at
https://github.com/rust-lang/compiler-team/issues/656
2023-12-13 21:14:23 +00:00
Guillaume Gomez
867ea12488 Fix non-running rustc ui tests 2023-12-13 17:49:08 +01:00
Urgau
a72e20d773 Fix rustc codegen gcc tests 2023-12-11 18:48:49 +01:00
r0cky
92de9d4210 Remove dead codes 2023-12-11 23:24:32 +08:00
bors
c578f4302c Auto merge of #117873 - quininer:android-emutls, r=Amanieu
Add emulated TLS support

This is a reopen of https://github.com/rust-lang/rust/pull/96317 . many android devices still only use 128 pthread keys, so using emutls can be helpful.

Currently LLVM uses emutls by default for some targets (such as android, openbsd), but rust does not use it, because `has_thread_local` is false.

This commit has some changes to allow users to enable emutls:

1. add `-Zhas-thread-local` flag to specify that std uses `#[thread_local]` instead of pthread key.
2. when using emutls, decorate symbol names to find thread local symbol correctly.
3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated` to explicitly specify whether to generate emutls.

r? `@Amanieu`
2023-12-09 05:32:35 +00:00
bors
17f0dd5898 Auto merge of #118324 - RalfJung:ctfe-read-only-pointers, r=saethlin
compile-time evaluation: detect writes through immutable pointers

This has two motivations:
- it unblocks https://github.com/rust-lang/rust/pull/116745 (and therefore takes a big step towards `const_mut_refs` stabilization), because we can now detect if the memory that we find in `const` can be interned as "immutable"
- it would detect the UB that was uncovered in https://github.com/rust-lang/rust/pull/117905, which was caused by accidental stabilization of `copy` functions in `const` that can only be called with UB

When UB is detected, we emit a future-compat warn-by-default lint. This is not a breaking change, so completely in line with [the const-UB RFC](https://rust-lang.github.io/rfcs/3016-const-ub.html), meaning we don't need t-lang FCP here. I made the lint immediately show up for dependencies since it is nearly impossible to even trigger this lint without `const_mut_refs` -- the accidentally stabilized `copy` functions are the only way this can happen, so the crates that popped up in #117905 are the only causes of such UB (in the code that crater covers), and the three cases of UB that we know about have all been fixed in their respective crates already.

The way this is implemented is by making use of the fact that our interpreter is already generic over the notion of provenance. For CTFE we now use the new `CtfeProvenance` type which is conceptually an `AllocId` plus a boolean `immutable` flag (but packed for a more efficient representation). This means we can mark a pointer as immutable when it is created as a shared reference. The flag will be propagated to all pointers derived from this one. We can then check the immutable flag on each write to reject writes through immutable pointers.

I just hope perf works out.
2023-12-07 18:11:01 +00:00
Ralf Jung
cb32ffd8da ctfe interpreter: extend provenance so that it can track whether a pointer is immutable 2023-12-07 17:46:36 +01:00
Urgau
3cfff05ac7 Allow internal_features in rustc_codegen_gcc examples 2023-12-07 15:26:18 +01:00
Urgau
19e11760ab Update rustc_codegen_gcc libc 2023-12-07 14:59:37 +01:00
quininer
2baa073fb1 Add emulated TLS support
Currently LLVM uses emutls by default
for some targets (such as android, openbsd),
but rust does not use it, because `has_thread_local` is false.

This commit has some changes to allow users to enable emutls:

1. add `-Zhas-thread-local` flag to specify
    that std uses `#[thread_local]` instead of pthread key.
2. when using emutls, decorate symbol names
    to find thread local symbol correctly.
3. change `-Zforce-emulated-tls` to `-Ztls-model=emulated`
    to explicitly specify whether to generate emutls.
2023-12-07 00:21:32 +08:00
Guillaume Gomez
ebb7aa0b85 Apply suggestions 2023-12-04 17:33:18 +01:00
Guillaume Gomez
996635bad6 Fix chroot command 2023-12-04 15:29:23 +01:00
Guillaume Gomez
2ec8d46dd1 Correctly handle OVERWRITE_TARGET_TRIPLE env variable 2023-12-04 15:29:23 +01:00
Guillaume Gomez
53b2759bef Show command which failed 2023-12-04 15:29:23 +01:00
Guillaume Gomez
ff04316243 Remove --target option 2023-12-04 15:29:23 +01:00
Guillaume Gomez
970b2c7700 Fix build_sysroot by adding missing RUSTFLAGS environment variable 2023-12-04 15:29:23 +01:00
Guillaume Gomez
7d71b87691 Correctly set --cap-lints when running regex tests 2023-12-04 15:29:23 +01:00
Guillaume Gomez
ad1d5417e7 Set RUSTDOCFLAGS environment variable in run_cargo_command_with_callback function 2023-12-04 15:29:23 +01:00
Guillaume Gomez
7013eccc05 Add missing code comment 2023-12-04 15:29:23 +01:00
Guillaume Gomez
3c6bae7fa8 Use the correct folder when deleting rust UI tests 2023-12-04 15:29:23 +01:00
Guillaume Gomez
4bed89f79b Correctly pass toolchain to cargo command 2023-12-04 15:29:23 +01:00
Guillaume Gomez
d793f80bd4 Correctly pass cfg option 2023-12-04 15:29:23 +01:00
Guillaume Gomez
673661db8b Remove newline for llvm FileCheck binary path 2023-12-04 15:29:23 +01:00
Guillaume Gomez
23c97b545d Replace xargs command with pure Rust 2023-12-04 15:29:23 +01:00
Guillaume Gomez
87c284c9bc Only read rust test files 2023-12-04 15:29:23 +01:00
Guillaume Gomez
9d104a0cbf Clone rust repository before modifying it 2023-12-04 15:29:23 +01:00
Guillaume Gomez
c27fe3e036 Correctly handle channel in config 2023-12-04 15:29:23 +01:00
Guillaume Gomez
694a80d372 Add missing --build-sysroot option 2023-12-04 15:29:23 +01:00
Guillaume Gomez
8cc024c84d Fix invalid path in build_sysroot_inner 2023-12-04 15:29:23 +01:00