Skip to content

build: default CROSS=riscv64-elf + document toolchain variants in README - #1

Merged
TumRedSun merged 1 commit into
mainfrom
feature/build-fixes
Aug 21, 2026
Merged

build: default CROSS=riscv64-elf + document toolchain variants in README#1
TumRedSun merged 1 commit into
mainfrom
feature/build-fixes

Conversation

@TumRedSun

@TumRedSun TumRedSun commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Makefile default changed from riscv64-unknown-elf to riscv64-elf (mainstream bare-metal toolchain). README.md and README.ru.md updated to reflect new default and document when to override.

Summary by Sourcery

Adopt riscv64-elf as the default bare-metal toolchain and document alternatives for building OnyxBoot.

Enhancements:

  • Use riscv64-elf as the default bare-metal cross-compiler prefix while documenting supported toolchain variants and override guidance.

Build:

  • Update Makefile build commands to use the new default cross-compiler configuration.

Documentation:

  • Update English and Russian quick-start and toolchain documentation to reflect the new default and explain when to select riscv64-unknown-elf.

Makefile:
- Default CROSS changed from 'riscv64-unknown-elf' to 'riscv64-elf' — this
  matches the mainstream bare-metal toolchain (xpack-riscv-none-elf-gcc,
  RISC-V collaborations/riscv-gnu-toolchain) that most users have.
- Added comment block explaining the three variants:
  * riscv64-elf-  (preferred, default)
  * riscv64-unknown-elf-  (Debian's gcc-riscv64-unknown-elf package)
  * riscv64-linux-gnu-  (Arch's riscv64-linux-gnu-gcc — does NOT work for
    bare-metal OnyxBoot linking)

README.md + README.ru.md:
- Quick start: 'make CROSS=riscv64-elf' → just 'make' (default is now correct)
- Add note explaining why the default is riscv64-elf and when to override
@sourcery-ai

sourcery-ai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Reviewer's Guide

Switches the default RISC-V cross-compiler prefix to riscv64-elf and updates documentation to describe the new default and when/how to override it, including clarifying supported toolchain variants.

File-Level Changes

Change Details Files
Change default cross-compiler prefix to riscv64-elf and document supported/unsupported toolchain variants.
  • Replace default CROSS from riscv64-unknown-elf to riscv64-elf in the Makefile.
  • Add detailed comments in the Makefile explaining preferred bare-metal toolchain variants and warning against using Linux-targeted toolchains.
  • Update README quick-start to use plain make with a comment indicating the default CROSS value.
  • Clarify in README tool table that riscv64-elf-g++ is preferred while still allowing riscv64-unknown-elf-g++.
  • Add a section in README explaining the Makefile default, mapping it to mainstream bare-metal toolchains, and showing how to override for Debian's gcc-riscv64-unknown-elf.
  • Mirror all README changes in README.ru.md with equivalent Russian phrasing, including default description and override instructions.
Makefile
README.md
README.ru.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@TumRedSun
TumRedSun merged commit f50e113 into main Aug 21, 2026
1 of 3 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The Makefile recipe lines for bootloader.elf, bootloader.bin, clean, test, and test-all are now indented with spaces instead of tabs, which will break make; these should remain tab-indented shell commands.
  • Consider mirroring the new Makefile note about riscv64-linux-gnu- being unsuitable for bare-metal in the README toolchain section so users who don’t inspect the Makefile still see that guidance.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Makefile recipe lines for `bootloader.elf`, `bootloader.bin`, `clean`, `test`, and `test-all` are now indented with spaces instead of tabs, which will break `make`; these should remain tab-indented shell commands.
- Consider mirroring the new Makefile note about `riscv64-linux-gnu-` being unsuitable for bare-metal in the README toolchain section so users who don’t inspect the Makefile still see that guidance.

## Individual Comments

### Comment 1
<location path="Makefile" line_range="30-39" />
<code_context>

 bootloader.elf: $(SRCS)
-	$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
+        $(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

 bootloader.bin: bootloader.elf
-	$(OBJCOPY) -O binary $< $@
+        $(OBJCOPY) -O binary $< $@

 clean:
-	rm -f bootloader.elf bootloader.bin
+        rm -f bootloader.elf bootloader.bin

 test:
-	./test/run_qemu.sh
+        ./test/run_qemu.sh

 test-all:
-	./test/test_all.sh
+        ./test/test_all.sh

 .PHONY: all clean test test-all
</code_context>
<issue_to_address>
**issue (bug_risk):** Use real tab characters for Make recipes instead of spaces to avoid `make` errors.

The recipe lines for `bootloader.elf`, `bootloader.bin`, `clean`, `test`, and `test-all` are now indented with spaces instead of a literal tab, which will trigger `missing separator` errors in many `make` implementations and break the build. Please change these indentations back to actual tab characters to keep the Makefile functional.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread Makefile
Comment on lines +30 to +39
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@

bootloader.bin: bootloader.elf
$(OBJCOPY) -O binary $< $@
$(OBJCOPY) -O binary $< $@

clean:
rm -f bootloader.elf bootloader.bin
rm -f bootloader.elf bootloader.bin

test:
./test/run_qemu.sh
./test/run_qemu.sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Use real tab characters for Make recipes instead of spaces to avoid make errors.

The recipe lines for bootloader.elf, bootloader.bin, clean, test, and test-all are now indented with spaces instead of a literal tab, which will trigger missing separator errors in many make implementations and break the build. Please change these indentations back to actual tab characters to keep the Makefile functional.

@TumRedSun
TumRedSun deleted the feature/build-fixes branch August 21, 2026 02:28
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.

1 participant