Skip to content

Conversation

@G36maid
Copy link
Contributor

@G36maid G36maid commented Oct 28, 2025

Add automatic detection and configuration for LLVM/Clang toolchain alongside existing GCC support. The build system now detects which compiler is available and configures appropriate flags and tools.

  • Auto-detect LLVM/Clang via CC_IS_CLANG variable
  • Add Clang-specific flags (--target, warning suppressions)
  • Use LLVM binutils (ld.lld, llvm-objdump, etc.) when Clang detected
  • Refactor to use common ARCH_FLAGS for consistency
  • Maintain backward compatibility with GCC toolchain

Part of #12


Summary by cubic

Adds LLVM/Clang toolchain support with auto-detection for the RISC-V build. Automatically selects Clang or GCC and configures the correct flags and binutils, progressing Linear #12 (cross-toolchain builds).

  • New Features

    • Auto-detect LLVM/Clang via CC_IS_CLANG (user can override).
    • Switch to LLVM tools when Clang is used (clang, ld.lld, llvm-objdump/readelf/objcopy/size).
    • Add Clang flags: --target=riscv32-unknown-elf and -Wno-unused-command-line-argument.
  • Refactors

    • Introduce ARCH_FLAGS and apply to C/AS; unify LDFLAGS; keep GCC path intact.
    • Keep CROSS_COMPILE overridable (default riscv-none-elf-).

Add automatic detection and configuration for LLVM/Clang toolchain
alongside existing GCC support. The build system now detects which
compiler is available and configures appropriate flags and tools.

- Auto-detect LLVM/Clang via CC_IS_CLANG variable
- Add Clang-specific flags (--target, warning suppressions)
- Use LLVM binutils (ld.lld, llvm-objdump, etc.) when Clang detected
- Refactor to use common ARCH_FLAGS for consistency
- Maintain backward compatibility with GCC toolchain
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@jserv jserv merged commit 43dbe5b into sysprog21:main Oct 28, 2025
1 check passed
@jserv
Copy link
Contributor

jserv commented Oct 28, 2025

Thank @G36maid for contributing!

@G36maid G36maid deleted the feature/build-llvm branch October 28, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants