about summary refs log tree commit diff
path: root/src/librustc_target
AgeCommit message (Collapse)AuthorLines
2020-05-18Add inline asm register definitions to librustc_targetAmanieu d'Antras-1/+1448
2020-05-16rustc_target: Stop using "string typing" for code modelsVadim Petrochenkov-12/+62
Introduce `enum CodeModel` instead.
2020-05-15Rollup merge of #72062 - overdrivenpotato:psp, r=jonas-schievinkDylan DPC-0/+86
Add built in PSP target This adds a new target, `mipsel-sony-psp`, corresponding to the Sony PSP. The linker script is necessary to handle special sections, which are required by the target. This has been tested with my [rust-psp] crate and I can confirm it works as intended. The linker script is taken from [here]. It has been slightly adapted to work with rust and LLD. The `stdarch` submodule was also updated in order for `libcore` to build successfully. [rust-psp]: https://github.com/overdrivenpotato/rust-psp [here]: https://github.com/pspdev/pspsdk/blob/master/src/base/linkfile.prx.in
2020-05-14Rewrite link script from scratchMarko Mijalkovic-276/+21
This absolves previous licensing issues.
2020-05-14linker: More systematic handling of CRT objectsVadim Petrochenkov-82/+290
2020-05-12Add target thumbv7a-uwp-windows-msvcbdbai-0/+31
2020-05-11Update the Fuchsia linker defaultsPetr Hosek-0/+7
This updates the linker defaults aligning them with Clang. Specifically, we use 4K pages on all platforms, we always use BIND_NOW, we prefer all loadable segments be separate and page aligned, and we support RELR relocations.
2020-05-10Renamed lld_link_script to link_script and support all GNU-like linkersMarko Mijalkovic-7/+9
2020-05-10Add lld_link_script to TargetOptionsMarko Mijalkovic-15/+8
2020-05-09FormattingMarko Mijalkovic-8/+4
2020-05-09Add mipsel-sony-psp targetMarko Mijalkovic-0/+350
2020-05-09Rollup merge of #71234 - maurer:init-array, r=cuviperRalf Jung-0/+8
rustllvm: Use .init_array rather than .ctors LLVM TargetMachines default to using the (now-legacy) .ctors representation of init functions. Mixing .ctors and .init_array representations can cause issues when linking with lld. This happens in practice for: * Our profiling runtime which is currently implicitly built with .init_array since it is built by clang, which sets this field. * External C/C++ code that may be linked into the same process. Fixes: #71233
2020-05-08Rollup merge of #72017 - ctaggart:wasm2, r=ecstatic-morseDylan DPC-0/+4
Work around ICEs during cross-compilation for target, ast, & attr This applies the fix for #72003 to work around #56935 to three more libraries. With these additional fixes, I'm able to use rustfmt_lib from wasm (https://github.com/rust-lang/rustfmt/issues/4132#issuecomment-616587989), which was my goal. To get it working locally and to test, I copied the `.cargo/registry/src` and applied the fix and replaced the reference in my project: ``` toml [replace] "rustc-ap-rustc_span:656.0.0" = { path = "../rustc-ap-rustc_span" } "rustc-ap-rustc_target:656.0.0" = { path = "../rustc-ap-rustc_target" } "rustc-ap-rustc_ast:656.0.0" = { path = "../rustc-ap-rustc_ast" } "rustc-ap-rustc_attr:656.0.0" = { path = "../rustc-ap-rustc_attr" } ```
2020-05-08Work around ICEs during cross-compilationCameron Taggart-0/+4
2020-05-07Provide configurable LLVM cmdline section via target specTom Karpiniec-0/+16
The App Store performs certain sanity checks on bitcode, including that an acceptable set of command line arguments was used when compiling a given module. For Rust code to be distributed on the app store with bitcode rustc must pretend to have the same command line arguments.
2020-05-07Force embed-bitcode on non-simulator iOS/tvOS targetsTom Karpiniec-0/+7
At this time Apple recommends Bitcode be included for iOS apps, and requires it for tvOS. It is unlikely that a developer would want to disable bitcode when building for these targets, yet by default it will not be generated. This presents a papercut for developers on those platforms. Introduces a new TargetOption boolean key for specific triples to indicate that bitcode should be generated, even if cargo attempts to optimise with -Cembed-bitcode=no.
2020-05-01Auto merge of #71623 - petrochenkov:localink, r=estebankbors-4/+0
Disable localization for all linkers We previously disabled non-English output from `link.exe` due to encoding issues (#35785). In https://github.com/rust-lang/rust/pull/70740 it was pointed out that it also prevents correct inspection of the linker output, which we have to do occasionally. So this PR disables localization for all linkers.
2020-04-29Use .init_array rather than .ctorsMatthew Maurer-0/+8
LLVM TargetMachines default to using the (now-legacy) .ctors representation of init functions. Mixing .ctors and .init_array representations can cause issues when linking with lld. This happens in practice for: * Our profiling runtime which is currently implicitly built with .init_array since it is built by clang, which sets this field. * External C/C++ code that may be linked into the same process. To support legacy systems which may use .ctors, targets may now specify that they use .ctors via the use_ctors attribute which defaults to false. For debugging and manual control, -Z use-ctors-section=yes/no will allow manual override. Fixes: #71233
2020-04-27Disable localization for all linkersVadim Petrochenkov-4/+0
2020-04-26rustc_target: Stop using "string typing" for TLS modelsVadim Petrochenkov-11/+61
Introduce `enum TlsModel` instead.
2020-04-26rustc_target: Stop using "string typing" for relocation modelsVadim Petrochenkov-42/+103
Introduce `enum RelocModel` instead.
2020-04-24Avoid unused Option::map resultsJosh Stone-18/+19
These are changes that would be needed if we add `#[must_use]` to `Option::map`, per #71484.
2020-04-16rustc_target::abi: add Primitive variant to FieldsShape.Ana-Maria Mihalache-9/+29
2020-04-16Rollup merge of #71145 - pfmooney:illumos-triple, r=nagisaDylan DPC-0/+75
Add illumos triple This fixes rust-lang/rust#55553 and adds support for `illumos` as a `target_os` on `x86_64`. In addition to the compile spec and libstd additions, several library dependencies have been bumped in order to permit working builds of cargo and rustup for the new target. Work originally started by @jasonbking, with subsequent additions by @pfmooney and @jclulow.
2020-04-14Add illumos triplePatrick Mooney-0/+75
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-04-13Address review commentsVadim Petrochenkov-4/+1
2020-04-13rustc_target: Introduce `msvc_base`Vadim Petrochenkov-48/+59
and inherit both `windows_msvc_base` and `uefi_msvc_base` from it.
2020-04-13rustc_target: Inherit `windows_uwp_gnu_base` from `windows_gnu_base`Vadim Petrochenkov-21/+13
2020-04-13rustc_target: Inherit `windows_uwp_msvc_base` from `windows_msvc_base`Vadim Petrochenkov-41/+9
2020-04-13rustc_target: Remove some useless importsVadim Petrochenkov-25/+0
2020-04-13rustc_target: `windows(_uwp)_base` -> `windows(_uwp)_gnu_base`Vadim Petrochenkov-9/+9
The old naming is from ancient times when there was no MSVC support. Also `uefi_base` -> `uefi_msvc_base`. It will inherit from `msvc_base` in a future commit, plus a GNU UEFI target is also potentially possible.
2020-04-13linker: Pass `/NODEFAULTLIB` in a more regular wayVadim Petrochenkov-3/+20
2020-04-13rustc_target: Move tests into a separate unconfigured fileVadim Petrochenkov-43/+48
as much as possible.
2020-04-13rustc_target: Make sure lld-link is treated as link.exe by defaultVadim Petrochenkov-62/+102
The differences if they are discovered will need to be explicitly documented
2020-04-13Auto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieubors-2/+2
[windows] Add testscase for self-contained executables and fix pthread linking Fixes https://github.com/rust-lang/rust/issues/71061
2020-04-12[windows-gnu] Link pthread staticallyMateusz Mikuła-2/+2
2020-04-09Fix staticlib name for *-pc-windows-gnu targetsMateusz Mikuła-2/+2
2020-04-06Rollup merge of #70704 - ↵Mazdak Farrokhzad-8/+2
danielframpton:aarch64-windows-panic-unwind-default, r=alexcrichton Make panic unwind the default for aarch64-*-windows-msvc targets With the llvm fixes from rust-lang/llvm-project#45 (included as a submodule change) we can enable unwinding by default for these targets. Fixes #65313 There are still a small number of test failures for which we can open individual issues. r? @alexcrichton
2020-04-04rustc_target: Rely on default value of `no_default_libraries` moreVadim Petrochenkov-4/+0
2020-04-03Make panic unwind the default for aarch64-*-windows-msvc targetsDaniel Frampton-8/+2
2020-04-03Replace max/min_value() with MAX/MIN assoc constsLinus Färnstrand-1/+1
2020-04-01Rollup merge of #70616 - anyska:fieldplacement-rename, r=oli-obkDylan DPC-27/+27
rustc_target::abi: rename FieldPlacement to FieldsShape. Originally suggested by @eddyb.
2020-04-01Rollup merge of #70547 - wesleywiser:extract_can_unwind, r=eddybMazdak Farrokhzad-0/+2
Add `can_unwind` field to `FnAbi` This is a pure refactoring with no behavior changes. Extracted out of #70467 r? @eddyb
2020-04-01Rollup merge of #70605 - Amanieu:pthread_msvcrt, r=varkorDylan DPC-0/+2
Add missing -lmsvcrt on mingw after -lpthread Fixes #70316
2020-03-31rustc_target::abi: rename FieldPlacement to FieldsShape.Ana-Maria Mihalache-27/+27
2020-03-31more clippy fixesMatthias Krüger-2/+2
use is_empty() instead of len comparison (clippy::len_zero) use if let instead of while let loop that never loops (clippy::never_loop) remove redundant returns (clippy::needless_return) remove redundant closures (clippy::redundant_closure) use if let instead of match and wildcard pattern (clippy::single_match) don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-31Add missing -lmsvcrt on mingw after -lpthreadAmanieu d'Antras-0/+2
Fixes #70316
2020-03-30Add `can_unwind` field to `FnAbi`Wesley Wiser-0/+2
This is a pure refactoring with no behavior changes.
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-13/+8
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1