about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/base
AgeCommit message (Collapse)AuthorLines
2025-10-03Auto merge of #143613 - Enselic:panic-abort-uwtables, r=petrochenkovbors-4/+3
Fix backtraces with `-C panic=abort` on linux; emit unwind tables by default The linux backtrace unwinder relies on unwind tables to work properly, and generating and printing a backtrace is done by for example the default panic hook. Begin emitting unwind tables by default again with `-C panic=abort` (see history below) so that backtraces work. Closes https://github.com/rust-lang/rust/issues/81902 which is **regression-from-stable-to-stable** Closes https://github.com/rust-lang/rust/issues/94815 ### History Backtraces with `-C panic=abort` used to work in Rust 1.22 but broke in Rust 1.23, because in 1.23 we stopped emitting unwind tables with `-C panic=abort` (see https://github.com/rust-lang/rust/pull/45031 and https://github.com/rust-lang/rust/issues/81902#issuecomment-3046487084). In 1.45 a workaround in the form of `-C force-unwind-tables=yes` was added (see https://github.com/rust-lang/rust/pull/69984). `-C panic=abort` was added in [Rust 1.10](https://blog.rust-lang.org/2016/07/07/Rust-1.10/#what-s-in-1-10-stable) and the motivation was binary size and compile time. But given how confusing that behavior has turned out to be, it is better to make binary size optimization opt-in with `-C force-unwind-tables=no` rather than default since the current default breaks backtraces. Besides, if binary size is a primary concern, there are many other tricks that can be used that has a higher impact. # Release Note Entry Draft: ## Compatibility Notes * [Fix backtraces with `-C panic=abort` on Linux by generating unwind tables by default](https://github.com/rust-lang/rust/pull/143613). Build with `-C force-unwind-tables=no` to keep omitting unwind tables. try-job: aarch64-apple try-job: armhf-gnu try-job: aarch64-msvc-1
2025-10-02Fix backtraces with `-C panic=abort` on linux; emit unwind tables by defaultMartin Nordholts-4/+3
The linux backtrace unwinder relies on unwind tables to work properly, and generating and printing a backtrace is done by for example the default panic hook. Begin emitting unwind tables by default again with `-C panic=abort` (see history below) so that backtraces work. History ======= Backtraces with `-C panic=abort` used to work in Rust 1.22 but broke in Rust 1.23, because in 1.23 we stopped emitting unwind tables with `-C panic=abort` (see 24cc38e3b00). In 1.45 (see cda994633ee) a workaround in the form of `-C force-unwind-tables=yes` was added. `-C panic=abort` was added in [Rust 1.10](https://blog.rust-lang.org/2016/07/07/Rust-1.10/#what-s-in-1-10-stable) and the motivation was binary size and compile time. But given how confusing that behavior has turned out to be, it is better to make binary size optimization opt-in with `-C force-unwind-tables=no` rather than default since the current default breaks backtraces. Besides, if binary size is a primary concern, there are many other tricks that can be used that has a higher impact.
2025-09-30Rollup merge of #146518 - madsmtm:ld-reproducible-doc, r=SparrowLiiMatthias Krüger-3/+13
Improve the documentation around `ZERO_AR_DATE` In particular, document why we don't use the new `-reproducible` flag. I went through [the source for Apple's old linker](https://github.com/apple-oss-distributions/ld64), and compared the versions with [the mapping to Xcode versions on Wikipedia](https://en.wikipedia.org/wiki/Xcode) to find the relevant Xcode versions for these features. r? compiler
2025-09-26Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkovMatthias Krüger-3/+0
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced. Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1. The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`. Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-22Rollup merge of #146848 - moturus:motor-os_tier-3, r=davidtwcoGuillaume Gomez-0/+35
Add x86_64-unknown-motor (Motor OS) tier 3 target Add the initial no-std Motor OS compiler target. Motor OS has been developed for several years in the open: https://github.com/moturus/motor-os. It has a more or less full implementation of Rust std library, as well as tokio/mio ports. > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) Ack. [U. Lasiotus](https://github.com/lasiotus) will maintain the target. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. > If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. Ack. The new target is named `x86_64-unknown-motor`, as it represents Motor OS on x86_64. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. > The target must not introduce license incompatibilities. > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Ack. Motor OS is dual-licensed under MIT and/or Apache-2.0. > Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. Ack. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. Motor OS has a functional implementation of the standard library: https://github.com/moturus/rust/tree/motor-os_stdlib, which will be the subject of a later PR. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. Building instructions for Motor OS: https://github.com/moturus/motor-os/blob/main/docs/build.md. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. Ack. > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. Ack. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.) Motor OS uses the standard x86_64 rustc/llvm toolchain. > If a tier 3 target stops meeting these requirements, or the target maintainers no longer have interest or time, or the target shows no signs of activity and has not built for some time, or removing the target would improve the quality of the Rust codebase, we may post a PR to remove it; any such PR will be CCed to the target maintainers (and potentially other people who have previously worked on the target), to check potential interest in improving the situation. Ack.
2025-09-21Add x86_64-unknown-motor (Motor OS) tier 3 targetU. Lasiotus-0/+35
Add the initial no-std Motor OS compiler target. Motor OS has been developed for several years in the open: https://github.com/moturus/motor-os. It has a more or less full implementation of Rust std library, as well as tokio/mio ports. Build instructions can be found here: https://github.com/moturus/motor-os/blob/main/docs/build.md. Signed-off-by: U. Lasiotus <lasiotus@motor-os.org>
2025-09-19Enable `limit_rdylib_exports` on wasm targetsAlex Crichton-5/+0
This commit updates the target specification of wasm targets to set the `limit_rdylib_exports` value to `true` like it is on other native platforms. This was originally not implemented long ago as `wasm-ld` didn't have options for symbol exports, but since then it's grown a `--export` flag and such to control this. A custom case is needed in the linker implementation to handle wasm targets as `wasm-ld` doesn't support linker scripts used on other targets, but other than that the implementation is straightforward. The goal of this commit is enable building dynamic libraries on `wasm32-wasip2` which don't export every single symbol in the Rust standard library. Currently, without otherwise control over symbol visibility, all symbols end up being exported which generates excessively large binaries because `--gc-sections` ends up doing nothing as it's all exported anyway.
2025-09-19Stop linking rs{begin,end} on x86_64-*-windows-gnuMateusz Mikuła-3/+0
Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced. Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1. The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`.
2025-09-13Improve the documentation around ZERO_AR_DATEMads Marquart-3/+13
2025-08-29compiler: Add `{x86_64,aarch64,riscv64gc}-unknown-managarm-mlibc` targetsno92-0/+18
Co-authored-by: Dennis Bonke <dennis@managarm.org>
2025-08-11Pass Apple SDK root to compiler driver via SDKROOT env varMads Marquart-22/+2
This is more in-line with what Apple's tooling expects, and allows us to better support custom compiler drivers (such as certain Homebrew and Nixpkgs compilers) that prefer their own `-isysroot` flag. Effectively, we now invoke the compiler driver as-if it was invoked as `xcrun -sdk $sdk_name $tool`.
2025-08-08Add target_env = "macabi" and target_env = "sim"Mads Marquart-20/+29
2025-06-13Add missing avr64* seriesTom Vijlbrief-0/+21
2025-06-13Add modern AVR mcus like avr128db28 and attiny3224Tom Vijlbrief-0/+46
2025-06-11compiler: Update all targets to the new c_int_width typeJubilee Young-1/+1
2025-06-06compiler: set Apple frame pointers by architectureJubilee Young-1/+7
Apple targets can now overriding this configuration and instead use the default based on their architecture, which means aarch64 targets now have less frame pointers in leaf functions.
2025-05-30Add tls_model for cygwin and enable has_thread_localBerrysoft-1/+4
2025-05-15Revert "Fix linking statics on Arm64EC #140176"Jieyou Xu-13/+1
Unfortunately, multiple people are reporting linker warnings related to `__rust_no_alloc_shim_is_unstable` after this change. The solution isn't quite clear yet, let's revert to green for now, and try a reland with a determined solution for `__rust_no_alloc_shim_is_unstable`. This reverts commit c8b7f32434c0306db5c1b974ee43443746098a92, reversing changes made to 667247db71ea18c4130dd018d060e7f09d589490.
2025-05-07[Arm64EC] Only decorate functions with `#`Daniel Paoliello-1/+13
2025-04-19Rollup merge of #139868 - thaliaarchi:move-env-consts-pal, r=joboetChris Denton-16/+14
Move `pal::env` to `std::sys::env_consts` Combine the `std::env::consts` platform implementations as a single file. Use the Unix file as the base, since it has 28 entries, and fold the 8 singleton platforms into it. The Unix file was roughly grouped into Linux, Apple, BSD, and everything else, roughly in alphabetical order. Alphabetically order them to make it easier to maintain and discard the Unix-specific groups to generalize it to all platforms. I'd prefer to have no fallback implementation, as I consider it a bug; however TEEOS, Trusty, and Xous have no definitions here. Since they otherwise have `pal` abstractions, that indicates that there are several platforms without `pal` abstractions which are also missing here. To support unsupported, create a little macro to handle the fallback case and not introduce ordering between the `cfg`s like `cfg_if!`. I've named the module `std::sys::env_consts`, because they are used in `std::env::consts` and I intend to use the name `std::sys::env` for the combination of `Args` and `Vars`. cc `@joboet` `@ChrisDenton` Tracked in #117276.
2025-04-18Use struct update syntax for some TargetOptionsThalia Archibald-16/+14
2025-04-10Add minimal x86_64-lynx-lynxos178 support.Tim Newsome-0/+32
It's possible to build no_std programs with this compiler. > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.) Tim Newsome (@tnewsome-lynx) will be the designated developer for x86_64-lynx-lynxos178 support. > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target. I believe the target is named appropriately. > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it. The target name is not confusing. > If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo. Done. > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users. > The target must not introduce license incompatibilities. > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0). All this new code is licensed under the Apache-2.0 license. > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements. Done. > Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3. I think we're in the clear here. We do link against some static libraries that are proprietary (like libm and libc), but those are not used to generate code. E.g. the VxWorks target requires `wr-c++` to be installed, which is not publically available. > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users. Our intention is to allow anyone with access to LynxOS CDK to use Rust for it. > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions. > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements. No problem. > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions. With this first PR, only core is supported. I am working on support for the std library and intend to submit that once all the tests are passing. > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary. This is documented in `src/doc/rustc/src/platform-support/lynxos_178.md`. > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages. > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications. Understood. > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target. > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target. As far as I know this change does not affect any other targets. > Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.) Many targets produce assembly for x86_64 so that also works for LynxOS-178.
2025-04-04refactor: Move env parsing of deployment target to rustc_sessionMads Marquart-0/+12
2025-04-04refactor: Move Apple OSVersion (back) to rustc_targetMads Marquart-2/+106
Also convert OSVersion into a proper struct for better type-safety.
2025-03-25Rename `is_like_osx` to `is_like_darwin`Mads Marquart-1/+1
2025-03-14Rollup merge of #136892 - erickt:fuchsia-target, r=jieyouxuJacob Pratt-1/+5
Sync Fuchsia target spec with clang Fuchsia driver This updates the Fuchsia target spec with the [Clang Fuchsia driver], which picks up a few changes: * Adds `-z start-stop-visibility=hidden` and `-z rel` to the pre link arguments. * Adds `--execute-only` and `--fix-cortex-a53-843419` for `aarch64-unknown-fuchsia`. * Enables the equivalent cpu features for `x86-64-v2` for `x86_64-unknown-fuchsia`, which is our minimum supported x86_64 platform according to [RFC-0073]. try-job: x86_64-fuchsia [Clang Fuchsia driver]: https://github.com/llvm/llvm-project/blob/8374d421861cd3d47e21ae7889ba0b4c498e8d85/clang/lib/Driver/ToolChains/Fuchsia.cpp [RFC-0073]: https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0073_x86_64_platform_requirement
2025-03-10Target definition for `wasm32-wali-linux-musl` to support the Wasm LinuxArjun Ramesh-0/+160
Interface This commit does not patch libc, stdarch, or cc
2025-02-23Rollup merge of #136637 - Pyr0de:binary-format, r=NoratriebTrevor Gross-10/+23
Add binary_format to rustc target specs Added binary format field to `TargetOptions` Fixes #135724 r? `@Noratrieb`
2025-02-20Sync Fuchsia target spec with clang Fuchsia driverErick Tryzelaar-1/+5
This updates the Fuchsia target spec with the [Clang Fuchsia driver], which picks up a few changes: * Adds `-z start-stop-visibility=hidden` and `-z rel` to the pre link arguments. * Adds `--execute-only` and `--fix-cortex-a53-843419` for `aarch64-unknown-fuchsia`. * Enables the cpu features equivalent to x86-64-v2 for `x86_64-unknown-fuchsia`, which is our minimum supported x86_64. platform according to [RFC-0073]. * Enables the cpu features `+crc,+aes,+sha2,+neon` on aarch64. * Increases the max atomic width on 86_64 to 128. * Enables stack probes and xray on aarch64 and riscv64. [Clang Fuchsia driver]: https://github.com/llvm/llvm-project/blob/8374d421861cd3d47e21ae7889ba0b4c498e8d85/clang/lib/Driver/ToolChains/Fuchsia.cpp [RFC-0073]: https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0073_x86_64_platform_requirement
2025-02-19Create a generic AVR target: avr-nonePatryk Wychowaniec-41/+1
This commit removes the `avr-unknown-gnu-atmega328` target and replaces it with a more generic `avr-none` variant that must be specialized with the `-C target-cpu` flag (e.g. `-C target-cpu=atmega328p`).
2025-02-17Adds binary_format to rustc target specsPyrode-10/+23
2025-02-14add x86-sse2 (32bit) ABI that requires SSE2 target featureRalf Jung-3/+7
2025-02-10Reformat files王宇逸-8/+9
2025-02-10Apply suggestions王宇逸-7/+1
2025-02-10Add cygwin target.王宇逸-0/+52
Co-authored-by: Ookiineko <chiisaineko@protonmail.com> Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com> Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-02-08Rustfmtbjorn3-84/+101
2025-02-06compiler: make rustc_target have less weird reexportsJubilee Young-3/+6
rustc_target has had a lot of weird reexports for various reasons, but now we're at a point where we can actually start reducing their number. We remove weird shadowing-dependent behavior and import directly from rustc_abi instead of doing weird renaming imports. This is only incremental progress and does not entirely fix the crate.
2025-01-24Move common code to mod nto_qnxFlorian Bartels-1/+96
Signed-off-by: Florian Bartels <Florian.Bartels@elektrobit.com>
2025-01-20Set `DebuginfoKind::Dwarf` for `*-windows-gnu` and `*-windows-gnullvm`Wesley Wiser-2/+2
These targets have always generated DWARF debuginfo and not CodeView/PDB debuginfo like the MSVC Windows targets. Correct their target definitions to reflect this. The newly added tests for the various combinations of `*-windows-gnu*` targets and `-Csplit-debuginfo` show that this does not change any stable behavior.
2024-12-30explicitly set float ABI for all ARM targetsRalf Jung-2/+3
2024-12-14Rollup merge of #133386 - wesleywiser:update_musl_base_crt_default, r=jieyouxuMatthias Krüger-3/+0
Update linux_musl base to dynamically link the crt by default However, don't change the behavior of any existing targets at this time. For targets that used the old default, explicitly set `crt_static_default = true`. This makes it easier for new targets to use the correct defaults while leaving the changing of individual targets to future PRs. Related to https://github.com/rust-lang/compiler-team/issues/422
2024-12-12Rollup merge of #122003 - mati865:gnullvm-build-libunwind, r=petrochenkovMatthias Krüger-0/+2
link libunwind dynamically and allow controlling it via `crt-static` on gnullvm targets Alternative to https://github.com/rust-lang/rust/pull/121794 ``` $ cargo b -r Finished `release` profile [optimized] target(s) in 0.38s $ ntldd target/release/hello.exe | rg unwind libunwind.dll => H:\msys64\clang64\bin\libunwind.dll (0x0000020c35df0000) $ RUSTFLAGS="-C target-feature=+crt-static" cargo b -r Finished `release` profile [optimized] target(s) in 0.23s $ ntldd target/release/hello.exe | rg unwind ```
2024-12-03change aix default codemodel=largeHenry Jiang-1/+1
2024-11-23Update linux_musl base to dynamically link the crt by defaultWesley Wiser-3/+0
However, don't change the behavior of any existing targets at this time. For targets that used the old default, explicitly set `crt_static_default = true`. This makes it easier for new targets to use the correct defaults while leaving the changing of individual targets to future PRs. Related to https://github.com/rust-lang/compiler-team/issues/422
2024-11-01Move Mach-O platform information to rustc_codegen_ssa::back::appleMads Marquart-18/+1
To align with the general decision to have this sort of information there instead. Also use the visionOS values added in newer `object` release.
2024-11-01Move versioned LLVM target creation to rustc_codegen_ssaMads Marquart-123/+9
The OS version depends on the deployment target environment variables, the access of which we want to move to later in the compilation pipeline that has access to more information, for example `env_depinfo`.
2024-10-04Rollup merge of #131171 - madsmtm:target-info-avr-env, r=petrochenkovJubilee-0/+2
Fix `target_env` in `avr-unknown-gnu-atmega328` The target name itself contains GNU, we should probably reflect that as `target_env = "gnu"` as well? Or from my reading of https://github.com/rust-lang/rust/pull/74941#issuecomment-712219034, perhaps not, but then that should probably be documented somewhere? There's no listed target maintainer, but the target was introduced in https://github.com/rust-lang/rust/pull/74941, so I'll ping the author of that: `@dylanmckay` Relatedly, I wonder _why_ the recommendation is to [create separate target triples for each AVR](https://github.com/Rahix/avr-hal/tree/main/avr-specs), when `-Ctarget-cpu=...` would suffice, perhaps you could also elaborate on that? Was it just because `-Ctarget-cpu=...` didn't exist back then? If so, now that it does, should we now change the target back to e.g. `avr-unknown-none-gnu`, and require the user to set `-Ctarget-cpu=...` instead?
2024-10-03control libunwind linkage mode via `crt-static` on gnullvm targetsMateusz Mikuła-0/+2
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
2024-10-02Fix target_env in avr-unknown-gnu-atmega328Mads Marquart-0/+2
The target name itself contains GNU, we should set that in the environment as well.
2024-09-29Do not specify an SDK version in object filesMads Marquart-17/+0
This is unnecessary, since it ends up being overwritten when linking anyhow, and it feels wrong to embed some arbitrary SDK version in here.