Skip to content
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

arch/risc-v: Refactor LLVM CPU type handling in Toolchain.cmake #15475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

no1wudi
Copy link
Contributor

@no1wudi no1wudi commented Jan 9, 2025

Summary

  • Replace direct string comparisons with regex pattern matching for ARCHCPUEXTFLAGS
  • Change from using LLVM_CPUFLAGS list to setting LLVM_CPUTYPE directly
  • Simplify CPU type detection logic while maintaining same functionality
  • Use more consistent string variable naming convention

This change makes the CPU type detection more flexible and maintainable while keeping the same behavior for supported RISC-V configurations.

Impact

build system only

Testing

GitHub CI and apache/nuttx-apps#2487

- Replace direct string comparisons with regex pattern matching for ARCHCPUEXTFLAGS
- Change from using LLVM_CPUFLAGS list to setting LLVM_CPUTYPE directly
- Simplify CPU type detection logic while maintaining same functionality
- Use more consistent string variable naming convention

This change makes the CPU type detection more flexible and maintainable
while keeping the same behavior for supported RISC-V configurations.

Signed-off-by: Huang Qi <[email protected]>
@github-actions github-actions bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: S The size of the change in this PR is small labels Jan 9, 2025
@nuttxpr
Copy link

nuttxpr commented Jan 9, 2025

[Experimental Bot, please feedback here]

Yes, this PR appears to meet the NuttX requirements, although it could be more thorough. While it addresses the core elements, providing more details in the "Impact" and "Testing" sections would significantly improve clarity and confidence in the changes.

Specifically:

  • Impact: While it states "build system only," it lacks details. How does the build process change? Even if seemingly minor, articulating the change (e.g., "Removes the need for an explicit list of CPU flags, simplifying the configuration process.") provides valuable context.
  • Testing: Referencing a related PR in nuttx-apps is good, but including specific test results (even summarized) directly within the PR is essential. Simply stating "GitHub CI" is insufficient; mentioning successful builds for specific architectures/configurations strengthens the validation. The "Testing logs before change" and "Testing logs after change" sections are empty, which is against the stated requirements. Even if the behavior is identical, showing some output demonstrating this would be beneficial.

By adding these details, the PR would more robustly adhere to the guidelines, making review easier and increasing confidence in the proposed changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants