Skip to content

Keep make from compiling the swapped objects again in rk mix and rk mixed - #263

Merged
tamnd merged 1 commit into
mainfrom
k2-mix-relink
Nov 20, 2026
Merged

tamnd merged 1 commit into
mainfrom
k2-mix-relink

Conversation

@tamnd

@tamnd tamnd commented Nov 20, 2026

Copy link
Copy Markdown
Owner

rk mix and rk mixed have not been linking rucc objects at all. The copy of the reference keeps objtool's .cmd files, and those name every target by its absolute path, which is still the reference's path. make takes that as a changed command and builds objtool again. Every kernel object depends on objtool, so make then compiled every object again with gcc, over the rucc objects that had just been written in. On a 7.4-rc2 tinyconfig on server3 the mix make log had 766 CC lines, and the mix's mm/memory.o was gcc's (63768 bytes, rucc's is 71024).

So every mix bench on #244 so far measured a gcc kernel against a gcc kernel, which is why they all came out near 1.00. Any rk mixed trial was also run on gcc objects only.

The fix:

  • copy_tree now moves the reference's path to the copy's in the .cmd and .d files under tools/. The kernel's own .cmd files are left alone, since they have to keep the reference's shim path.
  • After the link, both commands check that each swapped object is still the rucc one. A few objects are built from what the link makes (the vDSO image, the realmode blob, the decompressor's misc.o, piggy.o and header.o), and make rightly builds those again. They are named on stderr and dropped from the list. If make built every swapped object again, the command fails rather than bench or boot a gcc kernel.

On the same tinyconfig the make log now has 2 CC lines, 810 rucc objects stay in, mm/memory.o is rucc's, and the mix vmlinux differs from gcc's. Clippy and the mixed tests pass, and there is a new test for the copy and the check.

Part of #244.

@tamnd
tamnd merged commit 70505af into main Nov 20, 2026
0 of 2 checks passed
@tamnd
tamnd deleted the k2-mix-relink branch November 20, 2026 07: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