about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec
AgeCommit message (Collapse)AuthorLines
2021-10-16HermitCore's kernel itself doesn't support TLSStefan Lankes-3/+1
HermitCore's kernel itself doesn't support TLS. Consequently, the entries in x86_64-unknown-none-hermitkernel should be removed. This commit should help to finalize #89062.
2021-10-14Fix issue where PIC was added to the wrong target.Mike Leany-2/+2
Should be for x86_64_unknown_none, but aarch64_unknown_none was inadvertently updated instead.
2021-10-13x86_64-unknown-none: Use position-independent code by defaultJosh Triplett-1/+1
This avoids requiring relocation code, which a bare-metal environment may not have or want.
2021-10-13Fix build errors.Mike Leany-1/+4
2021-10-13x86_64-unknown-none: Expand TargetOptions to specify more detailsJosh Triplett-0/+8
Specify the `cpu` and the `max_atomic_width` (64). Set `stack_probes` similarly to other targets to work around known issues, and copy the corresponding comment from those targets. Build position-independent code that doesn't require relocations. (Work on this target sponsored by Profian.)
2021-10-13x86_64-unknown-none: Disable more target featuresJosh Triplett-1/+3
Based on the list used for x86_64-unknown-none-linuxkernel. (Work on this target sponsored by Profian.)
2021-10-13x86_64-unknown-none: Drop the `abi` fieldJosh Triplett-1/+0
(Work on this target sponsored by Profian.)
2021-10-13x86_64-unknown-none: Fix module commentJosh Triplett-3/+1
(Work on this target sponsored by Profian.)
2021-10-13Rename x86_64-unknown-none-elf to x86_64-unknown-noneJosh Triplett-1/+1
Most Rust freestanding/bare-metal targets use just `-unknown-none` here, including aarch64-unknown-none, mipsel-unknown-none, and the BPF targets. The *only* target using `-unknown-none-elf` is RISC-V. The underlying toolchain doesn't care; LLVM accepts both `x86_64-unknown-none` and `x86_64-unknown-none-elf`. In addition, there's a long history of embedded x86 targets with varying definitions for the `elf` suffix; on some of those embedded targets, `elf` implied the inclusion of a C library based on newlib or similar. Using `x86_64-unknown-none` avoids any potential ambiguity there. (Work on this target sponsored by Profian.)
2021-10-13Use `CodeModel::Kernel` for `x86_64-unknown-none-elf`.Mike Leany-1/+2
2021-10-13Fix code formatting.Mike Leany-1/+2
2021-10-13Add new target: `x86_64-unknown-none-elf`Mike Leany-0/+31
2021-10-06add platform support details file for armv7-unknown-linux-uclibcJonah Petri-0/+1
2021-10-06Add new target armv7-unknown-linux-uclibceabihfYannick Koehler-0/+25
Co-authored-by: Jonah Petri <jonah@petri.us>
2021-10-01Rollup merge of #88820 - hlopko:add_pie_relocation_model, r=petrochenkovManish Goregaokar-0/+3
Add `pie` as another `relocation-model` value MCP: https://github.com/rust-lang/compiler-team/issues/461
2021-10-01Add `pie` as another `relocation-model` valueMarcel Hlopko-0/+3
2021-09-28Add SOLID targetsTomoaki Kawada-0/+74
SOLID[1] is an embedded development platform provided by Kyoto Microcomputer Co., Ltd. This commit introduces a basic Tier 3 support for SOLID. # New Targets The following targets are added: - `aarch64-kmc-solid_asp3` - `armv7a-kmc-solid_asp3-eabi` - `armv7a-kmc-solid_asp3-eabihf` SOLID's target software system can be divided into two parts: an RTOS kernel, which is responsible for threading and synchronization, and Core Services, which provides filesystems, networking, and other things. The RTOS kernel is a μITRON4.0[2][3]-derived kernel based on the open-source TOPPERS RTOS kernels[4]. For uniprocessor systems (more precisely, systems where only one processor core is allocated for SOLID), this will be the TOPPERS/ASP3 kernel. As μITRON is traditionally only specified at the source-code level, the ABI is unique to each implementation, which is why `asp3` is included in the target names. More targets could be added later, as we support other base kernels (there are at least three at the point of writing) and are interested in supporting other processor architectures in the future. # C Compiler Although SOLID provides its own supported C/C++ build toolchain, GNU Arm Embedded Toolchain seems to work for the purpose of building Rust. # Unresolved Questions A μITRON4 kernel can support `Thread::unpark` natively, but it's not used by this commit's implementation because the underlying kernel feature is also used to implement `Condvar`, and it's unclear whether `std` should guarantee that parking tokens are not clobbered by other synchronization primitives. # Unsupported or Unimplemented Features Most features are implemented. The following features are not implemented due to the lack of native support: - `fs::File::{file_attr, truncate, duplicate, set_permissions}` - `fs::{symlink, link, canonicalize}` - Process creation - Command-line arguments Backtrace generation is not really a good fit for embedded targets, so it's intentionally left unimplemented. Unwinding is functional, however. ## Dynamic Linking Dynamic linking is not supported. The target platform supports dynamic linking, but enabling this in Rust causes several problems. - The linker invocation used to build the shared object of `std` is too long for the platform-provided linker to handle. - A linker script with specific requirements is required for the compiled shared object to be actually loadable. As such, we decided to disable dynamic linking for now. Regardless, the users can try to create shared objects by manually invoking the linker. ## Executable Building an executable is not supported as the notion of "executable files" isn't well-defined for these targets. [1] https://solid.kmckk.com/SOLID/ [2] http://ertl.jp/ITRON/SPEC/mitron4-e.html [3] https://en.wikipedia.org/wiki/ITRON_project [4] https://toppers.jp/
2021-09-22Disable the leak sanitizer on Macos aarch64 for now.Hans Kratz-1/+3
It is currently broken, see #88132.
2021-09-17compiler/rustc_target: Add support for m68k-linux-gnuJohn Paul Adrian Glaubitz-0/+16
2021-09-13Auto merge of #88529 - Meziu:master, r=nagisabors-0/+45
ARMv6K Nintendo 3DS Tier 3 target added Addition of the target specifications to build .elf files for Nintendo 3DS (ARMv6K, Horizon). Requires devkitARM 3DS toolkit for system libraries and arm-none-eabi-gcc linker.
2021-09-10ARMV6K 3DS: Removed useless parameters in target specMeziu-3/+1
2021-09-03Auto merge of #88454 - devnexen:sunos_asan, r=wesleywiserbors-2/+4
sunos systems add sanitizer supported.
2021-09-02Auto merge of #88516 - matthiaskrgr:clippy_perf_end_august, ↵bors-1/+1
r=jyn514,GuillaumeGomez some low hanging clippy::perf fixes
2021-09-02Auto merge of #87114 - cjgillot:abilint, r=estebankbors-0/+3
Lint missing Abi in ast validation instead of lowering.
2021-08-31Lint Abi in ast validation.Camille GILLOT-0/+3
2021-08-31some low hanging clippy::perf fixesMatthias Krüger-1/+1
2021-08-31ARMv6K Nintendo 3DS Tier 3 target addedMeziu-0/+47
2021-08-30sunos systems add sanitizer supported.David Carlier-2/+4
2021-08-30Disallow the aapcs CC on Aarch64Simonas Kazlauskas-1/+2
This never really worked and makes LLVM assert.
2021-08-29Auto merge of #88250 - rusticstuff:macos-lld, r=nagisabors-1/+2
Make `-Z gcc-ld=lld` work for Apple targets `-Z gcc-ld=lld` was introduced in #85961. It does not work on Macos because lld needs be either named `ld64` or passed `-flavor darwin` as the first two arguments in order to select the Mach-O flavor. Rust invokes cc (=clang) on Macos for linking which calls `ld` as linker binary and not `ld64`, so just creating an `ld64` binary and modifying the search path with `-B` does not work. In order to solve this patch does: * Set the `lld_flavor` for all Apple-derived targets to `LldFlavor::Ld64`. As far as I can see this actually works towards fixing `-Xlinker=rust-lld` as all those targets use the Mach-O object format. * Copy/hardlink rust-lld to the gcc-ld subdirectory as ld64 next to ld. * If `-Z gcc-ld=lld` is used and the target lld flavor is Ld64 add `-fuse-ld=/path/to/ld64` to the linker invocation. Fixes #86945.
2021-08-24allow specifying an ios version for the llvm targetPatrick Amrein-3/+9
2021-08-23Mach-O (Macos/ios/...) LLD flavor is always LD64.Hans Kratz-1/+2
2021-08-22Rollup merge of #88077 - kit-981:feature/fix-minimum-os-version-in-header, ↵Guillaume Gomez-1/+13
r=petrochenkov Generate an iOS LLVM target with a specific version This commit adds the `LC_VERSION_MIN_IPHONEOS` load command to the Mach-O header generated for `aarch64-apple-ios` binaries. The operating system will look for this load command to determine the minimum supported operating system version and will not allow the binary to run if it's absent. This logic already exists for the simulator toolchain. I've been using `otool` from a [cctools](https://github.com/tpoechtrager/cctools-port) toolchain to parse the header and validate that this change adds the required load command. This change appears to be enough to build Rust binaries that can run on a jailbroken iPhone.
2021-08-21Auto merge of #87570 - nikic:llvm-13, r=nagisabors-9/+9
Upgrade to LLVM 13 Work in progress update to LLVM 13. Main changes: * InlineAsm diagnostics reported using SrcMgr diagnostic kind are now handled. Previously these used a separate diag handler. * Codegen tests are updated for additional attributes. * Some data layouts have changed. * Switch `#[used]` attribute from `llvm.used` to `llvm.compiler.used` to avoid SHF_GNU_RETAIN flag introduced in https://reviews.llvm.org/D97448, which appears to trigger a bug in older versions of gold. * Set `LLVM_INCLUDE_TESTS=OFF` to avoid Python 3.6 requirement. Upstream issues: * ~~https://bugs.llvm.org/show_bug.cgi?id=51210 (InlineAsm diagnostic reporting for module asm)~~ Fixed by https://github.com/llvm/llvm-project/commit/1558bb80c01b695ce12642527cbfccf16cf54ece. * ~~https://bugs.llvm.org/show_bug.cgi?id=51476 (Miscompile on AArch64 due to incorrect comparison elimination)~~ Fixed by https://github.com/llvm/llvm-project/commit/81b106584f2baf33e09be2362c35c1bf2f6bfe94. * https://bugs.llvm.org/show_bug.cgi?id=51207 (Can't set custom section flags anymore). Problematic change reverted in our fork, https://reviews.llvm.org/D107216 posted for upstream revert. * https://bugs.llvm.org/show_bug.cgi?id=51211 (Regression in codegen for #83623). This is an optimization regression that we may likely have to eat for this release. The fix for #83623 was based on an incorrect premise, and this needs to be properly addressed in the MergeICmps pass. The [compile-time impact](https://perf.rust-lang.org/compare.html?start=ef9549b6c0efb7525c9b012148689c8d070f9bc0&end=0983094463497eec22d550dad25576a894687002) is mixed, but quite positive as LLVM upgrades go. The LLVM 13 final release is scheduled for Sep 21st. The current nightly is scheduled for stable release on Oct 21st. r? `@ghost`
2021-08-16Update powerpc64 data layoutNikita Popov-5/+5
2021-08-16Update wasm data layoutNikita Popov-4/+4
2021-08-16Generate an iOS LLVM target with a specific versionkit-1/+13
Without the specific version, the mach-o header will be missing the minimum supported operating system version. This is mandatory for running Rust binaries on iOS devices.
2021-08-14freebsd arm64 add supported sanitizers.DC-2/+8
2021-08-12Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddybManish Goregaokar-0/+28
Add c_enum_min_bits target spec field, use for arm-none and thumb-none targets Fixes https://github.com/rust-lang/rust/issues/87917 <s>Haven't tested this yet, still playing around.</s> This seems to fix the issue.
2021-08-12Apply c_enum_min_bits = 8 to (arm|thumb)-none- platformsManish Goregaokar-0/+14
2021-08-12Add c_enum_min_bits to target specManish Goregaokar-0/+14
2021-08-10STD support for the ESP-IDF frameworkivmarkov-0/+38
2021-08-09Auto merge of #85357 - Andy-Python-Programmer:aarch64_uefi_target, ↵bors-0/+28
r=petrochenkov Add `aarch64-unknown-uefi` target This pull request adds the `aarch64-unknown-uefi` target.
2021-08-09Add the aarch64-unknown-uefi targetunknown-0/+28
* This commit adds the aarch64-unknown-uefi target and also adds it into the supported targets list under the tier-3 target table. * Uses the small code model by default Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
2021-08-01Auto merge of #87664 - devnexen:netbsd_sanitizers_support, r=nagisabors-1/+3
netbsd x86_64 arch enable supported sanitizers.
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-1/+1
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-31netbsd x86_64 arch enable supported sanitizers.David Carlier-1/+3
2021-07-25freebsd remove compiler workaround.David Carlier-2/+1
related issue #43575
2021-07-25clippy::useless_formatMatthias Krüger-1/+1
2021-07-22Add support for powerpc-unknown-freebsdPiotr Kubaj-0/+28