summary refs log tree commit diff
path: root/src/librustc_target
AgeCommit message (Collapse)AuthorLines
2019-12-15Rollup merge of #67255 - tuxillo:remove-i686-unknown-dragonfly, r=alexcrichtonMazdak Farrokhzad-24/+0
Remove i686-unknown-dragonfly target DragonFly BSD removed support for i386 a while ago. It only supports x86_64 right now.
2019-12-14Auto merge of #67084 - Pagten:feature/print-msg-from-elf-entrypoint, r=Amanieubors-1/+1
SGX: Change ELF entrypoint This fixes [rust-sgx issue #148](https://github.com/fortanix/rust-sgx/issues/148). A new entry point is created for the ELF file generated by `rustc`, separate from the enclave entry point. When the ELF file is executed as a Linux binary, the error message below is written to stderr. > Error: This file is an SGX enclave which cannot be executed as a standard Linux binary. > See the installation guide at https://edp.fortanix.com/docs/installation/guide/ on how to use 'cargo run' or follow the steps at https://edp.fortanix.com/docs/tasks/deployment/ for manual deployment. When the ELF file is converted to an SGXS using `elf2sgxs`, the old entry point is still set as the enclave entry point. In a future pull request in the rust-sgx repository, `elf2sgxs` will be modified to remove the code in the ELF entry point, since this code is not needed in the enclave.
2019-12-12Remove i686-unknown-dragonfly targetAntonio Huete Jimenez-24/+0
2019-12-11Rollup merge of #67015 - osa1:issue66971, r=wesleywiserMazdak Farrokhzad-0/+8
Fix constant propagation for scalar pairs We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes #66971 Fixes #66339 Fixes #67019
2019-12-06const-prop: Restrict scalar pair propagationÖmer Sinan Ağacan-0/+8
We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes #66971 Fixes #66339 Fixes #67019
2019-12-06Rename to `then_some` and `then`varkor-5/+5
2019-12-06Use `to_option` in various placesvarkor-37/+6
2019-12-05Processed review commentsPieter Agten-1/+0
2019-12-05Auto merge of #66520 - alexcrichton:disable-gdb-wasm, r=eddybbors-0/+3
Disable gdb pretty printer global section on wasm targets The wasm targets don't support gdb anyway so there's no need for this section there.
2019-12-04Disable gdb pretty printer global section on wasm targetsAlex Crichton-0/+3
The wasm targets don't support gdb anyway so there's no need for this section there.
2019-12-04Create a separate entry point for the ELF file, instead of using the SGX ↵Pieter Agten-1/+2
entry point
2019-12-04Auto merge of #65947 - eddyb:fn-abi, r=oli-obk,nagisabors-0/+5
rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr"). After this PR: * `InstanceDef::Virtual` is only used for "direct" virtual calls, and shims around those calls use `InstanceDef::ReifyShim` (i.e. for `<dyn Trait as Trait>::f as fn(_)`) * this could easily be done for intrinsics as well, to allow their reification, but I didn't do it * `FnAbi::of_instance` is **always** used for declaring/defining an `fn`, and for direct calls to an `fn` * this is great for e.g. https://github.com/rust-lang/rust/pull/65881 (`#[track_caller]`), which can introduce the "caller location" argument into "codegen signatures" by only changing `FnAbi::of_instance`, after this PR * `FnAbi::of_fn_ptr` is used primarily for indirect calls, i.e. to `fn` pointers * *not* virtual calls (which use `FnAbi::of_instance` with `InstanceDef::Virtual`) * there's also a couple uses where the `rustc_codegen_llvm` needs to declare (i.e. FFI-import) an LLVM function that has no Rust declaration available at all * at least one of them could probably be a "weak lang item" instead As there are many steps, this PR is best reviewed commit by commit - some of which arguably should be in their own PRs, I may have gotten carried away a bit. cc @nagisa @rkruppe @oli-obk @anp
2019-12-03rustc_target: add abi::call::Conv::Rust distinct from Conv::C.Eduard-Mihai Burtescu-0/+5
2019-12-03Change linker for x86_64-fortanix-unknown-sgx to rust-lldParth Sane-27/+31
For SGX, the relocation using the relocation table is done by the code in rust/src/libstd/sys/sgx/abi/reloc.rs and this code should not require relocation. Setting RelaxELFRelocations flag if allows this to happen, hence adding a Target Option for it.
2019-11-29Auto merge of #66645 - RalfJung:dereferenceable, r=pnkfelixbors-0/+2
remove the 'dereferenceable' attribute from Box Fixes https://github.com/rust-lang/rust/issues/66600 r? @eddyb @rkruppe
2019-11-27Rollup merge of #66798 - bwignall:typo, r=varkorTyler Mandry-1/+1
Fix spelling typos Should be non-semantic. Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-26Rollup merge of #66713 - hermitcore:hermit, r=alexcrichtonTyler Mandry-0/+54
introduce a target to build the kernel of the unikernel HermitCore We are developing the unikernel HermitCore, where the kernel is written in Rust and is already supported by the Rust Standard Library. To compile the kernel with the new build flag "-Z build-std", we introduce a new target, which avoids the usage of SSE & AVX within the kernel.
2019-11-26Rollup merge of #66711 - mattico:aarch-msvc-fp, r=nagisaTyler Mandry-0/+1
Add hardware floating point features to aarch64-pc-windows-msvc Fixes #66701
2019-11-26Rollup merge of #66661 - msizanoen1:riscv-gnu, r=alexcrichtonTyler Mandry-0/+26
Add riscv64gc-unknown-linux-gnu target This PR add the target, but doesn't build std on CI yet. I have a port for `libc` crate and std which I will upstream soon after this target is added. r? @alexcrichton
2019-11-25review feedback: comments and spacingRalf Jung-1/+2
2019-11-24disable redzoneStefan Lankes-0/+1
2019-11-24use nicer code style to pass tidy checkStefan Lankes-1/+3
2019-11-24introduce a target to build the kernel HermitCoreStefan Lankes-0/+51
- the target avoids the usage of SSE & AVX within the kernel
2019-11-24Add hardware floating point features to aarch64-pc-windows-msvcMatt Ickstadt-0/+1
2019-11-23Rename StableHashingContextLike to HashStableContext.Camille GILLOT-1/+1
2019-11-23Add riscv64gc-unknown-linux-gnu targetmsizanoen1-0/+26
2019-11-22remove the 'dereferenceable' attribute from BoxRalf Jung-0/+1
2019-11-22Add StableHashingContextLike to HashStable_Generic derive.Camille GILLOT-0/+5
2019-11-22Auto merge of #66460 - cjgillot:hashstable_generic, r=Zoxcbors-11/+24
Add a proc-macro to derive HashStable in librustc dependencies A second proc-macro is added to derive HashStable for crates librustc depends on. This proc-macro HashStable_Generic (to bikeshed) allows to decouple code and some librustc's boilerplate. Not everything is migrated, because `Span` and `TokenKind` require to be placed inside librustc. Types using them stay there too. Split out of #66279 r? @Zoxc
2019-11-19[RISCV] Disable Atomics on all Non-A RISC-V targetsSam Elliott-3/+2
2019-11-17Derive HashStable_Generic for ABI types.Camille GILLOT-52/+8
2019-11-17Derive HashStable for PanicStrategy.Camille GILLOT-1/+3
2019-11-17Derive HashStable in librustc_target.Camille GILLOT-8/+59
2019-11-17HashStable_Generic for librustc_target.Camille GILLOT-1/+5
2019-11-12Rollup merge of #66257 - mati865:long-section-names-no-more, r=alexcrichtonYuki Okushi-27/+0
Drop long-section-names linker workaround for windows-gnu If we can trust objdump Rust doesn't emit sections loaded at runtime longer than 8 characters on windows-gnu (but still does on linux-gnu), debug sections are not affected by that limit. I've ran tests and built few crates using exactly the same mingw-w64 version as Rusts CI just fine using **x86_64** toolchain. The motivation for this change is making LLD work (it doesn't support `--enable-long-section-names`) with this target without hacks. Bit of history: The behaviour of LD changed in Binutils 2.20 released on 2009-10-16 and `--enable-long-section-names` was added to return to the old non conformant behaviour. Looking at the comment I can only guess there was a bug fixed in newer versions. This workaround was added in https://github.com/rust-lang/rust/pull/13315 half a decade ago.
2019-11-10Undo an assert causing an ICE until we fix the problem properlyOliver Scherer-5/+1
2019-11-09Drop long-section-names linker workaround for windows-gnuMateusz Mikuła-27/+0
2019-11-09Rollup merge of #66050 - smaeul:patch/powerpc-abi-2, r=eddybMazdak Farrokhzad-32/+11
Fix C aggregate-passing ABI on powerpc The existing code (which looks like it was copied from MIPS) passes aggregates by value in registers. This is wrong. According to the SVR4 powerpc psABI, all aggregates are passed indirectly. See #64259 for more discussion, which addresses the ABI for the special case of ZSTs (empty structs).
2019-11-07rustc_target: inline abi::FloatTy into abi::Primitive.Eduard-Mihai Burtescu-18/+12
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-39/+1
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06Rollup merge of #66103 - smaeul:patch/thumb-musl, r=nagisaMazdak Farrokhzad-0/+38
Add target thumbv7neon-unknown-linux-musleabihf This is a copy of thumbv7neon-unknown-linux-gnueabihf with musl changes merged from armv7-unknown-linux-musleabihf. This appears to have been missed when adding the other ARMv7-A thumb targets.
2019-11-05Fix C aggregate-passing ABI on powerpcSamuel Holland-32/+11
The existing code (which looks like it was copied from MIPS) passes aggregates by value in registers. This is wrong. According to the SVR4 powerpc psABI, all aggregates are passed indirectly. See #64259 for more discussion, which addresses the ABI for the special case of ZSTs (empty structs).
2019-11-05Rollup merge of #65953 - keystone-enclave:llvm_abiname, r=alexcrichtonPietro Albini-1/+7
Allow specifying LLVM's MCTargetOptions::ABIName in target specification files This addresses #65024, as it allows RISC-V target specification files to set `"llvm-abiname": "lp64d"`. Other languages (read: C) usually expose this codegen parameter under a compiler argument like `-mabi=<XYZ>`.
2019-11-04Add target thumbv7neon-unknown-linux-musleabihfSamuel Holland-0/+38
This is a copy of thumbv7neon-unknown-linux-gnueabihf with musl changes merged from armv7-unknown-linux-musleabihf.
2019-11-03rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi.Eduard-Mihai Burtescu-185/+185
2019-10-29Allow specifying key "llvm-abiname" in target specificationGui Andrade-1/+7
This addresses #65024, as it allows RISC-V target specification files to set "llvm-abiname": "lp64d". In general, it is useful for the programmer to be able to set this codegen parameter, which other languages usually expose under a compiler argument like "-mabi=<XYZ>".
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-9/+2
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-0/+9
Add new EFIAPI ABI Fixes #54527 Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI. Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-1/+1
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).