Commit Graph

381 Commits

Author SHA1 Message Date
Ramon de C Valle
bfe3c24e9a Add fine-grained LLVM CFI support to the Rust compiler
This commit improves the LLVM Control Flow Integrity (CFI) support in
the Rust compiler by providing forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled
code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code
share the same virtual address space) will be provided in later work as
part of this project by identifying C char and integer type uses at the
time types are encoded (see Type metadata in the design document in the
tracking issue #89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e.,
-Clto).
2022-07-23 10:51:34 -07:00
Daniel Paoliello
fef3b3e27d Enable raw-dylib for binaries 2022-07-22 09:55:14 -07:00
bors
e5e7395cca Auto merge of #99420 - RalfJung:vtable, r=oli-obk
make vtable pointers entirely opaque

This implements the scheme discussed in https://github.com/rust-lang/unsafe-code-guidelines/issues/338: vtable pointers should be considered entirely opaque and not even readable by Rust code, similar to function pointers.

- We have a new kind of `GlobalAlloc` that symbolically refers to a vtable.
- Miri uses that kind of allocation when generating a vtable.
- The codegen backends, upon encountering such an allocation, call `vtable_allocation` to obtain an actually dataful allocation for this vtable.
- We need new intrinsics to obtain the size and align from a vtable (for some `ptr::metadata` APIs), since direct accesses are UB now.

I had to touch quite a bit of code that I am not very familiar with, so some of this might not make much sense...
r? `@oli-obk`
2022-07-22 01:33:49 +00:00
Ralf Jung
59d223d1ed slightly cleaner, if more verbose, vtable handling in codegen backends 2022-07-20 17:12:07 -04:00
Ralf Jung
3f24eb870d consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable) 2022-07-20 17:12:07 -04:00
Ralf Jung
8f290184d2 add a Vtable kind of symbolic allocations 2022-07-20 16:57:31 -04:00
Michael Woerister
4f118ce102 Remove unused StableMap and StableSet types from rustc_data_structures 2022-07-20 13:11:39 +02:00
Joshua Nelson
bca7b0279f Rename debugging_opts to unstable_opts
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
2022-07-13 17:47:06 -05:00
Dylan DPC
6bcab05690 Rollup merge of #99155 - Amanieu:unstable-target-features, r=davidtwco
Keep unstable target features for asm feature checking

Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-13 19:32:36 +05:30
Amanieu d'Antras
c98d66cabf Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.

Fixes #99071
2022-07-11 14:26:58 +01:00
antoyo
22e4f181cb
Merge pull request #201 from GuillaumeGomez/cache-rust
Add cache for rust repository
2022-07-10 10:42:04 -04:00
Guillaume Gomez
28b11119e7 Add cache for rust repository 2022-07-10 12:43:33 +02:00
Ralf Jung
33e8d4c2d4 fix cranelift and gcc backends 2022-07-09 07:27:29 -04:00
antoyo
7c9db86fa1
Merge pull request #200 from GuillaumeGomez/sort-find
Sort ui_tests to ensure they remain coherent across different jobs
2022-07-08 16:11:50 -04:00
Guillaume Gomez
96d103b9f9 Sort ui_tests to ensure they remain coherent across different jobs 2022-07-08 16:19:48 +02:00
bors
4587677300 Auto merge of #98638 - bjorn3:less_string_interning, r=tmiasko
Use less string interning

This removes string interning in a couple of places where doing so won't result in perf improvements. I also switched one place to use pre-interned symbols.
2022-07-08 10:03:27 +00:00
antoyo
fe427541e6
Merge pull request #196 from GuillaumeGomez/faster-ci
Split tests to have faster CI
2022-07-07 21:14:04 -04:00
Guillaume Gomez
50f359c8a1 Split tests to have faster CI 2022-07-07 23:15:58 +02:00
antoyo
0d687bd829
Merge pull request #190 from rust-lang/feature/more-simd
Feature/more simd
2022-07-07 00:10:17 -04:00
Antoni Boucher
5f4777e55d Add name in TODO 2022-07-06 23:12:28 -04:00
Antoni Boucher
b14b440f3a Format 2022-07-06 15:24:53 -04:00
Antoni Boucher
fea51f391e Fix warnings 2022-07-06 15:24:53 -04:00
Antoni Boucher
d19a5ea868 Fix all command 2022-07-06 15:24:53 -04:00
Antoni Boucher
16ca66d664 Fix build only 2022-07-06 15:24:53 -04:00
Antoni Boucher
85036a5afa Use gccjit from repo 2022-07-06 15:24:53 -04:00
Antoni Boucher
9db55d2f54 Fix vector comparison now returning a vector of integers 2022-07-06 15:24:53 -04:00
Antoni Boucher
6205f1a0c5 Reenable target flags 2022-07-06 15:24:53 -04:00
Antoni Boucher
1c4ca283df Support #[target(enable)] function attribute 2022-07-06 15:24:53 -04:00
Antoni Boucher
4094923789 Disable avx512 2022-07-06 15:24:53 -04:00
Antoni Boucher
910ec42566 Fixes to make stdarch tests compile 2022-07-06 15:24:53 -04:00
Antoni Boucher
1777cdd644 Add antoyo in TODOs 2022-07-06 15:24:53 -04:00
Antoni Boucher
a69770308c Add patch to allow testing stdarch 2022-07-06 15:24:53 -04:00
Alan Egerton
97b7dc2912 Update TypeVisitor paths 2022-07-06 06:41:53 +01:00
antoyo
14e09245c4
Merge pull request #195 from GuillaumeGomez/split-rustc-tests
Split rustc tests in two
2022-07-05 14:24:10 -04:00
Guillaume Gomez
0ba53c8211 Split rustc tests in two 2022-07-05 19:46:59 +02:00
Antoni Boucher
9edaf82a03 Add comment 2022-06-29 21:03:45 -04:00
antoyo
c5b9a7a5a3
Merge pull request #193 from GuillaumeGomez/ci-parallel
Parallelize CI
2022-06-29 17:36:30 -04:00
Guillaume Gomez
18350b70ab Parallelize CI tests 2022-06-29 17:47:02 +02:00
antoyo
78e4713963
Merge pull request #188 from GuillaumeGomez/simplify-ci
Simplify CI
2022-06-29 11:36:05 -04:00
Guillaume Gomez
4ef0d19bec Add --mini-tests option and run mini-tests in CI 2022-06-29 15:40:11 +02:00
Guillaume Gomez
9a42e6b474 Clean up environment variables 2022-06-29 15:38:13 +02:00
bjorn3
c0ec18bd0d Avoid unnecessary string interning for const_str 2022-06-28 18:38:36 +00:00
Guillaume Gomez
ed37ed7cb8 Simplify github actions conf 2022-06-26 22:33:28 +02:00
antoyo
be5caeb8c9
Merge pull request #189 from rust-lang/fix/disable-erroring-tests
Disable UI tests that fail on the rustc side
2022-06-24 21:10:16 -04:00
Antoni Boucher
161ccb36b1 Disable UI tests that fail on the rustc side 2022-06-24 19:27:53 -04:00
Guillaume Gomez
5e6a3be56c Merge duplicated rules 2022-06-24 21:47:37 +02:00
antoyo
d6aadc684b
Merge pull request #187 from GuillaumeGomez/invalid-conversion
Prevent invalid intrinsics conversion generation
2022-06-24 12:57:54 -04:00
antoyo
39d7a23170
Merge pull request #185 from rust-lang/feature/dummy-fast-math
Add dummy fast math implementation
2022-06-24 11:30:26 -04:00
Guillaume Gomez
f7a3dffc0b Add missing intrinsics conversions for ignored invalid LLVM intrinsics 2022-06-24 17:25:09 +02:00
antoyo
45e3a4aa57
Merge pull request #186 from GuillaumeGomez/update-intrinsics-tool
Update intrinsics tool
2022-06-23 09:56:31 -04:00