8000 Rollup of 10 pull requests by Centril · Pull Request #58428 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 10 pull requests #58428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
da5a0cd
De-duplicate number formatting implementations for smaller code size
fitzgen Feb 7, 2019
ed2157a
De-duplicate write_prefix lambda in pad_integral
fitzgen Feb 7, 2019
e633f15
Un-monomorphize and inline formatting with padding
fitzgen Feb 7, 2019
05f0dee
Improve the error messages for missing stability attributes
varkor Feb 7, 2019
c104b5c
Also de-duplicate 32- and 64-bit number formatting on wasm32
fitzgen Feb 7, 2019
05df9ff
Add a wasm code size test for stringifying numbers
fitzgen Feb 7, 2019
8fea705
Use write_char for writing padding characters
fitzgen Feb 8, 2019
f00f0e6
Don't shadow the provided `stringify!` macro in a wasm code size test…
fitzgen Feb 8, 2019
03d4fd9
Use descriptive variant name
varkor Feb 8, 2019
bb1eed0
Correct descriptive item name for impl
varkor Feb 8, 2019
18089df
Fix ICE and invalid filenames in MIR printing code
matthewjasper Feb 10, 2019
d7afd3e
Add test for MIR printing changes
matthewjasper Feb 10, 2019
3737d4d
Do not apply future deprecation warning for #[deprecated]
varkor Feb 5, 2019
87cd09b
Don't display "Deprecated since" for non-rustc deprecated items
varkor Feb 5, 2019
2a8a25b
Display "Deprecation planned" in rustdoc for future rustc deprecations
varkor Feb 5, 2019
3dc660f
Update existing rustdoc test
varkor Feb 6, 2019
01df8fe
Add a rustdoc test for future rustc_deprecated attributes
varkor Feb 6, 2019
c875241
Add rustdoc index page test for future deprecation attributes
varkor Feb 6, 2019
b5fa870
Add a test for rustc_deprecated
varkor Feb 11, 2019
48b0c9d
Only suggest imports if not imported.
davidtwco Feb 11, 2019
ddb6c4f
Set the query in the ImplicitCtxt before trying to mark it green
Zoxc Feb 12, 2019
3a8448c
Fix rustc_driver swallowing errors when compilation is stopped
gnzlbg Feb 12, 2019
eac43cc
HirId-ify hir::BodyId
ljedrz Feb 4, 2019
15e4bd3
target/uefi: clarify documentation
dvdhrm Feb 13, 2019
fba102c
libpanic_unwind => 2018
Centril Feb 2, 2019
3657eaa
libpanic_unwind => 2018: fix ICEs.
Centril Feb 12, 2019
6a4f535
Rollup merge of #58110 - Centril:libpanic_unwind-2018, r=oli-obk
Centril Feb 13, 2019
d303710
Rollup merge of #58167 - ljedrz:HirIdify_body_id, r=Zoxc
Centril Feb 13, 2019
44352df
Rollup merge of #58202 - varkor:deprecated-future-external, r=Guillau…
Centril Feb 13, 2019
08d6585
Rollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-Simulacrum
Centril Feb 13, 2019
23b5be4
Rollup merge of #58276 - varkor:missing-stability-attr-top-level, r=d…
Centril Feb 13, 2019
9d46076
Rollup merge of #58354 - matthewjasper:mir-dump-fixes, r=wesleywiser
Centril Feb 13, 2019
99fd506
Rollup merge of #58381 - davidtwco:issue-42944, r=estebank
Centril Feb 13, 2019
4597c05
Rollup merge of #58386 - Zoxc:fix-54242, r=michaelwoerister
Centril Feb 13, 2019
e1c97f2
Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk
Centril Feb 13, 2019
f4dfad8
Rollup merge of #58420 - dvdhrm:target-uefi-comments, r=nagisa
Centril Feb 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/librustc_target/spec/uefi_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// UEFI uses COFF/PE32+ format for binaries. All binaries must be statically linked. No dynamic
// linker is supported. As native to COFF, binaries are position-dependent, but will be relocated
// by the loader if the pre-chosen memory location is already in use.
// UEFI forbids running code on anything but the boot-CPU. Not interrupts are allowed other than
// UEFI forbids running code on anything but the boot-CPU. No interrupts are allowed other than
// the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all
// code runs in the same environment, no process separation is supported.

Expand All @@ -21,7 +21,10 @@ pub fn opts() -> TargetOptions {
"/NOLOGO".to_string(),

// UEFI is fully compatible to non-executable data pages. Tell the compiler that
// non-code sections can be marked as non-executable, including stack pages.
// non-code sections can be marked as non-executable, including stack pages. In fact,
// firmware might enforce this, so we better let the linker know about this, so it
// will fail if the compiler ever tries placing code on the stack (e.g., trampoline
// constructs and alike).
"/NXCOMPAT".to_string(),

// There is no runtime for UEFI targets, prevent them from being linked. UEFI targets
Expand Down
22 changes: 12 additions & 10 deletions src/librustc_target/spec/x86_64_unknown_uefi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,25 @@ pub fn target() -> TargetResult {
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);

// We disable MMX and SSE for now. UEFI does not prevent these from being used, but there have
// been reports to GRUB that some firmware does not initialize the FP exception handlers
// properly. Therefore, using FP coprocessors will end you up at random memory locations when
// you throw FP exceptions.
// To be safe, we disable them for now and force soft-float. This can be revisited when we
// have more test coverage. Disabling FP served GRUB well so far, so it should be good for us
// as well.
// We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
// enable these CPU features explicitly before their first use, otherwise their instructions
// will trigger an exception. Rust does not inject any code that enables AVX/MMX/SSE
// instruction sets, so this must be done by the firmware. However, existing firmware is known
// to leave these uninitialized, thus triggering exceptions if we make use of them. Which is
// why we avoid them and instead use soft-floats. This is also what GRUB and friends did so
// far.
// If you initialize FP units yourself, you can override these flags with custom linker
// arguments, thus giving you access to full MMX/SSE acceleration.
base.features = "-mmx,-sse,+soft-float".to_string();

// UEFI systems run without a host OS, hence we cannot assume any code locality. We must tell
// LLVM to expect code to reference any address in the address-space. The "large" code-model
// places no locality-restrictions, so it fits well here.
base.code_model = Some("large".to_string());

// UEFI mostly mirrors the calling-conventions used on windows. In case of x86-64 this means
// small structs will be returned as int. This shouldn't matter much, since the restrictions
// placed by the UEFI specifications forbid any ABI to return structures.
// UEFI mirrors the calling-conventions used on windows. In case of x86-64 this means small
// structs will be returned as int. This shouldn't matter much, since the restrictions placed
// by the UEFI specifications forbid any ABI to return structures.
base.abi_return_struct_as_int = true;

Ok(Target {
Expand Down
0