-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add X86 target support for NuttX #136181
Add X86 target support for NuttX #136181
Conversation
r? @chenyukang rustbot has assigned @chenyukang. Use |
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #136507) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question, but seems okay to me otherwise.
@rustbot author |
@rustbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with or without the platform support doc nit.
* Implement `i686-unknown-nuttx` and `x86_64-unknown-nuttx` target definitions * Integrate new targets into the platform support documentation * Update tests to include new target revisions This change introduces support for 32-bit and 64-bit x86 architectures on the NuttX operating system, enhancing the range of platforms Rust can target. The targets are defined as tier 3, indicating that they are supported but not automatically tested by the Rust project. The `i686-unknown-nuttx` target uses the `pentium4` CPU and 32-bit pointers, while the `x86_64-unknown-nuttx` target uses the `x86-64` CPU and 64-bit pointers. Both targets disable dynamic linking and use inline stack probes for improved performance and reliability in a bare-metal environment. Additionally, this commit updates the platform support documentation to list the new targets and includes them in the test suite to ensure that they build correctly. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Since you have questions about this, perhaps others have the same concerns. Therefore, it's best for us to include these remarks : ) |
Thanks! @bors r+ rollup |
@bors r- |
This PR will not pass CI. See #136146 |
- On i686 (targeting i486 in NuttX), the FPU is typically disabled | ||
- On x86_64, the FPU is enabled by default but can be disabled if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Rust, only one of these can be true per target. Pick.
use_ctors_section: true, | ||
..Default::default() | ||
}; | ||
base.cpu = "pentium4".into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an i486 CPU, this is a 32-bit x86 CPU with SSE2 registers.
@workingjubilee Thanks for your reminder. If it's now necessary to specify the ABI type and it cannot be modified using target-feature, then I'm considering temporarily closing this pull request and first use the custom target approach to support the x86 platform locally. This is because the x86 support in NuttX is still in its early stages, and these configurations have not yet stabilized. |
That is correct, the fact that the ABI could be modified was effectively a bug, unfortunately. You would need to rebuild the stdlib anyways to make it conform (although I am aware that it's probably always rebuilt in the current case). |
i686-unknown-nuttx
andx86_64-unknown-nuttx
target definitionsThis change introduces support for 32-bit and 64-bit x86 architectures on the NuttX operating system, enhancing the range of platforms Rust can target. The targets are defined as tier 3, indicating that they are supported but not automatically tested by the Rust project. The
i686-unknown-nuttx
target uses thepentium4
CPU and 32-bit pointers, while thex86_64-unknown-nuttx
target uses thex86-64
CPU and 64-bit pointers. Both targets disable dynamic linking and use inline stack probes for improved performance and reliability in a bare-metal environment.Additionally, this commit updates the platform support documentation to list the new targets and includes them in the test suite to ensure that they build correctly.