Add PREGENERATED_TARG_INFO for cross-compilation#48
Open
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Open
Add PREGENERATED_TARG_INFO for cross-compilation#48noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Conversation
The targ_info build generates architecture-specific headers and source files by running host-tool generators (isa_gen, targ_si_gen, etc.). When cross-compiling — for example, building an x86_64 compiler on ARM64 via Rosetta or QEMU — these generators may crash because they execute x86_64 code under emulation. Add a PREGENERATED_TARG_INFO variable that, when set to a directory path, causes the build to copy pre-generated files from that directory instead of running the generators. This reuses the existing COPYSOURCEDIR mechanism already in place for MIPS64 cross-compilation. Usage: make PREGENERATED_TARG_INFO=/path/to/generated/files The pre-generated files can be produced by running the targ_info build natively on the target architecture, then copying the generated .h and .c files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PREGENERATED_TARG_INFOvariable toosprey/common/targ_info/Makefile.gbasethat overridesCOPYSOURCEDIRto use pre-generated header/source files instead of running the targ_info generatorsMotivation
The targ_info build runs host-tool generators (
isa_gen,targ_si_gen, etc.) that produce architecture-specific.hand.cfiles. When cross-compiling — for example, building an x86_64 compiler on ARM64 via Rosetta or QEMU — these generators may crash under emulation.This reuses the existing
COPYSOURCEDIRmechanism (already used for MIPS64-on-IA32 cross-compilation) and exposes it as a user-settable variable:The pre-generated files can be produced by running the targ_info build natively on the target architecture, then copying the output
.hand.cfiles.Test plan
PREGENERATED_TARG_INFO=/path— copies files from directory, skips generators🤖 Generated with Claude Code