Skip to content

RFC: Add OsUnknown as a target operating system #12841

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

bharrisau
Copy link
Contributor

First step in being able to build libstd against newlib (or other compatible c-library) for embedded targets. This enables a target triple to be specified of the form *-unknown-*. Next step to getting libstd to build is adding weak linkages or #[cfg(target_os = "unknown")]. Newlib provides libc, libm and libstc++ (exceptions too) and can be ported to other platforms by implementing 17-18 basic functions to interact with the OS/hardware.

This pull request just adds the unknown os target to librustc. The only additional change is that it ignores #[crate-type = "dylib"] in crates (as unknown OS cannot support dynamic linking). If dylib is specified using the --crate-type flag then an appropriate error is produced.

Next steps would be getting libstd to build a rlib, getting a binary to link, and writing a test that makes sure libstd can be built.

First step in supporting bare-metal targets, allows for cfg annotations
and ignores dylib crate-type annotations.
@alexcrichton
Copy link
Member

We have recently adopted a new RFC process, and this is a large enough change that I think that it warrants an RFC.

You'll need to follow the process described in the email (there are a few example PRs already as well) before submitting changes to this repo.

fasterthanlime pushed a commit to fasterthanlime/rust that referenced this pull request Jul 22, 2022
fix: Fix `trait_impls_in_deps_query` being called directly instead of as a query

Fixes the inlay hint performance regression introdcuced by rust-lang/rust-analyzer#12549
bors added a commit to rust-lang-ci/rust that referenced this pull request May 30, 2024
fulfill expectations in `check_partial_eq_without_eq`

This is a followup to rust-lang#12804, fixing a similar issue for `derive_partial_eq_without_eq` by using `span_lint_hir_and_then` instead of `span_lint_and_sugg`.

Additionally tests for both `#[allow(clippy::derive_partial_eq_without_eq)]` and `#[expect(clippy::derive_partial_eq_without_eq)]` are added.

changelog:[`derive_partial_eq_without_eq`]: fulfill expectations
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants