Skip to content

Add PREGENERATED_TARG_INFO for cross-compilation#48

Open
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy:feature/cross-compile-targ-info
Open

Add PREGENERATED_TARG_INFO for cross-compilation#48
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy:feature/cross-compile-targ-info

Conversation

@noafroboy
Copy link

Summary

  • Add PREGENERATED_TARG_INFO variable to osprey/common/targ_info/Makefile.gbase that overrides COPYSOURCEDIR to use pre-generated header/source files instead of running the targ_info generators

Motivation

The targ_info build runs host-tool generators (isa_gen, targ_si_gen, etc.) that produce architecture-specific .h and .c files. 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 COPYSOURCEDIR mechanism (already used for MIPS64-on-IA32 cross-compilation) and exposes it as a user-settable variable:

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 output .h and .c files.

Test plan

  • Normal build (no flag) — behavior unchanged, generators run as before
  • Build with PREGENERATED_TARG_INFO=/path — copies files from directory, skips generators

🤖 Generated with Claude Code

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>
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