Commit Graph

2361 Commits

Author SHA1 Message Date
Ralf Jung
5e52b61040 CTFE core engine allocation & memory API improvemenets
- make Allocation API offset-based (no more Pointer)
- make Memory API higher-level (combine checking for access and getting access into one operation)
2021-05-18 19:33:55 +02:00
bors
3c53005949 Auto merge of #85178 - cjgillot:local-crate, r=oli-obk
Remove CrateNum parameter for queries that only work on local crate

The pervasive `CrateNum` parameter is a remnant of the multi-crate rustc idea.

Using `()` as query key in those cases avoids having to worry about the validity of the query key.
2021-05-17 01:42:03 +00:00
bjorn3
a9d033d0e5 Return 0 from cpuid for all subleaves of leaf 7
This is necessary to support the cpufeatures crate

Fixes #1173
2021-05-16 10:46:37 +02:00
bjorn3
328f06718a Update Cranelift 2021-05-16 10:45:18 +02:00
bors
a5da29cf8f Auto merge of #83640 - bjorn3:shared_metadata_reader, r=nagisa
Use the object crate for metadata reading

This allows sharing the metadata reader between cg_llvm, cg_clif and other codegen backends.

This is not currently useful for rlib reading with cg_spirv ([rust-gpu](https://github.com/EmbarkStudios/rust-gpu/)) as it uses tar rather than ar as .rlib format, but it is useful for dylib reading required for loading proc macros. (cc `@eddyb)`

The object crate is already trusted as dependency of libstd through backtrace. As far as I know it supports reading all object file formats used by targets for which we support rust dylibs with crate metadata, but I am not certain. If this happens to not be the case, I could keep using LLVM for reading dylib metadata.

Marked as WIP for a perf run and as it is based on #83637.
2021-05-14 12:58:58 +00:00
Amanieu d'Antras
d342a3490b Add support for const operands and options to global_asm!
On x86, the default syntax is also switched to Intel to match asm!
2021-05-13 22:31:57 +01:00
Camille GILLOT
915d766307 Use () for codegen queries. 2021-05-12 13:58:46 +02:00
Camille GILLOT
3a869ca88c Use () for entry_fn. 2021-05-12 13:58:42 +02:00
Camille GILLOT
f22ab98d4c Use () in dependency_formats. 2021-05-12 13:58:41 +02:00
bors
40a62a998f Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister
Fix `--remap-path-prefix` not correctly remapping `rust-src` component paths and unify handling of path mapping with virtualized paths

This PR fixes #73167 ("Binaries end up containing path to the rust-src component despite `--remap-path-prefix`") by preventing real local filesystem paths from reaching compilation output if the path is supposed to be remapped.

`RealFileName::Named` introduced in #72767 is now renamed as `LocalPath`, because this variant wraps a (most likely) valid local filesystem path.

`RealFileName::Devirtualized` is renamed as `Remapped` to be used for remapped path from a real path via `--remap-path-prefix` argument, as well as real path inferred from a virtualized (during compiler bootstrapping) `/rustc/...` path. The `local_path` field is now an `Option<PathBuf>`, as it will be set to `None` before serialisation, so it never reaches any build output. Attempting to serialise a non-`None` `local_path` will cause an assertion faliure.

When a path is remapped, a `RealFileName::Remapped` variant is created. The original path is preserved in `local_path` field and the remapped path is saved in `virtual_name` field. Previously, the `local_path` is directly modified which goes against its purpose of "suitable for reading from the file system on the local host".

`rustc_span::SourceFile`'s fields `unmapped_path` (introduced by #44940) and `name_was_remapped` (introduced by #41508 when `--remap-path-prefix` feature originally added) are removed, as these two pieces of information can be inferred from the `name` field: if it's anything other than a `FileName::Real(_)`, or if it is a `FileName::Real(RealFileName::LocalPath(_))`, then clearly `name_was_remapped` would've been false and `unmapped_path` would've been `None`. If it is a `FileName::Real(RealFileName::Remapped{local_path, virtual_name})`, then `name_was_remapped` would've been true and `unmapped_path` would've been `Some(local_path)`.

cc `@eddyb` who implemented `/rustc/...` path devirtualisation
2021-05-12 11:05:56 +00:00
bors
809722dc13 Auto merge of #83610 - bjorn3:driver_cleanup, r=cjgillot
rustc_driver cleanup

Best reviewed one commit at a time.
2021-05-12 08:38:03 +00:00
bjorn3
a606fdec73 Fix syntax in patch section of Cargo.toml 2021-05-11 14:26:32 +02:00
bjorn3
24c459c2e5 Use declare_anonymous_data for anonymous_str 2021-05-11 14:25:56 +02:00
bjorn3
7c40338ba1 Implement imported_main feature
Fixes #1164
2021-05-11 14:22:23 +02:00
bjorn3
4663ed7bd9 Rustup to rustc 1.54.0-nightly (79e50bf77 2021-05-10) 2021-05-11 13:22:38 +02:00
bjorn3
459a51906d Update Cranelift 2021-05-10 13:13:52 +02:00
bjorn3
801eb1914f Remove unnecessary compiler builtins patch 2021-05-09 13:26:54 +02:00
bjorn3
8d969691d4 Re-enable fixed libcore tests
They were fixed in 6d6c574289
2021-05-09 13:24:23 +02:00
bjorn3
bcc68c298a Rustup to rustc 1.54.0-nightly (881c1ac40 2021-05-08) 2021-05-09 13:17:02 +02:00
bjorn3
961d8b69fa Sync from rust d6d028369b 2021-05-09 10:01:38 +02:00
bjorn3
62f64af430 Use the object crate for metadata reading 2021-05-07 18:48:58 +02:00
bjorn3
8794d07081 Avoid trailing / in git path for Wasmtime
Git seems to not be able to handle it in some cases. Thanks to @vramana
for reporting this on Zulip.
2021-05-07 12:58:54 +02:00
Luqman Aden
91dc6967fe Implement RFC 2951: Native link modifiers
This commit implements both the native linking modifiers infrastructure
as well as an initial attempt at the individual modifiers from the RFC.
It also introduces a feature flag for the general syntax along with
individual feature flags for each modifier.
2021-05-05 16:04:25 -07:00
Andy Wang
e162eeb1f0 Use local and remapped paths where appropriate 2021-05-05 15:31:28 +01:00
Andy Wang
5de83e7bd1 Revamp RealFileName public methods 2021-05-05 15:31:03 +01:00
Andy Wang
ac5272b3c7 Use RealFileName for Session::working_dir as it may also be remapped 2021-05-05 15:10:57 +01:00
bjorn3
fea01cfaaa Update Cranelift
This removes all the byteorder and thiserror dependencies. This results
in no proc macros being necessary anymore.
2021-05-04 18:54:22 +02:00
bjorn3
8b69357987 Rustfmt 2021-05-04 16:41:48 +02:00
bjorn3
20600f1df9 Force deprecation warning that was promoted to an error back to a warning 2021-05-04 14:16:59 +02:00
bjorn3
6266e9d907 Update rust bootstrap patches 2021-05-04 14:13:07 +02:00
bjorn3
7a61ec3007 Add missing change 2021-05-04 14:01:22 +02:00
bjorn3
e7f9301239 Rustup to rustc 1.54.0-nightly (716394d65 2021-05-03) 2021-05-04 13:55:04 +02:00
bjorn3
3b975ee92d Sync from rust 7a0f1781d0 2021-05-04 13:38:28 +02:00
bjorn3
55dbf17bb5 Pass target_cpu to LinkerInfo::new instead of link_binary
This is one step towards separating the linking code from codegen backends
2021-05-02 18:00:20 +02:00
bjorn3
6d30315d05
Merge pull request #1169 from eggyal/macho-link-section
Set correct segment from #[link_section] for MachO
2021-04-30 19:02:09 +02:00
Erin Power
0a1b87c9ce Merge commit '15c8d31392b9fbab3b3368b67acc4bbe5983115a' into cranelift-rebase 2021-04-30 18:46:59 +02:00
XAMPPRocky
15c8d31392
No-op register_jit on Windows (#1170)
* No-op register_jit on Windows

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-04-30 18:44:20 +02:00
Erin Power
df68e5ac73 [cg_clif] Fix run_jit from sync 2021-04-30 15:37:19 +02:00
Erin Power
ee570b1302 Sync rustc_codegen_cranelift 'ddd4ce25535cf71203ba3700896131ce55fde795' 2021-04-30 14:49:58 +02:00
Alan Egerton
95e6481d02
Set correct segment from #[link_section] for MachO 2021-04-30 11:02:34 +01:00
bjorn3
ddd4ce2553 Remove unused parameter 2021-04-30 10:52:37 +02:00
bjorn3
88901ca9d4 Ignore new failing rustc test 2021-04-29 14:16:16 +02:00
Charles Lew
fa559fb2df Implement RFC 1260 with feature_name imported_main. 2021-04-29 08:35:08 +08:00
bjorn3
beb4e312c8 Rustup to rustc 1.53.0-nightly (727d10156 2021-04-27) 2021-04-28 19:41:10 +02:00
bjorn3
31b2963da9
Merge pull request #1163 from mominul/target_cpu
Support -Ctarget-cpu
2021-04-23 17:13:25 +02:00
Muhammad Mominul Huque
c4f50fb06f
Update the error messsage
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-04-23 20:40:27 +06:00
Muhammad Mominul Huque
8eb96b8517 Handle native target-cpu variant
and raise fatal error if the specified target cpu is not supported
2021-04-23 19:55:52 +06:00
Muhammad Mominul Huque
e16ccba394 Support -Ctarget-cpu 2021-04-23 17:04:45 +06:00
bjorn3
cdc0aa188e Rustup to rustc 1.53.0-nightly (6df26f897 2021-04-20) 2021-04-21 15:32:04 +02:00
bjorn3
05f9602567 Sync from rust 6df26f897c 2021-04-21 11:29:57 +02:00