Allow overriding compiler used for runtime library builds#56
Open
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Open
Allow overriding compiler used for runtime library builds#56noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
noafroboy wants to merge 1 commit intoopen64-compiler:developfrom
Conversation
Add LIB_BUILD_COMPILER variable (defaults to SELF) so the compiler
used for runtime library builds can be overridden on the command line:
make lib LIB_BUILD_COMPILER=GNU
Previously, LIB_ARGS and LIB2_ARGS hardcoded BUILD_COMPILER=SELF,
which meant command-line overrides like 'make lib BUILD_COMPILER=GNU'
were silently ignored (the hardcoded value in the recipe took
precedence over the command-line value).
This is needed for cross-compilation scenarios where the freshly-built
opencc cannot run on the build host (e.g. building x86_64 Open64 on a
non-x86_64 machine via emulation).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
LIB_BUILD_COMPILERvariable (defaults toSELF) to control which compiler builds the runtime librariesMotivation
LIB_ARGSandLIB2_ARGShardcodeBUILD_COMPILER=SELF, which means runtime libraries are always built with the freshly-compiledopencc. Command-line overrides likemake lib BUILD_COMPILER=GNUare silently ignored because the hardcoded value in the recipe variable takes precedence.This makes cross-compilation scenarios impossible — if
openccwas built for a different architecture than the build host, it cannot be executed to compile the runtime libraries.The new
LIB_BUILD_COMPILER ?= SELFvariable preserves the existing default behavior while allowing overrides:Changes
Makefile.in: AddLIB_BUILD_COMPILER ?= SELF, replace hardcodedBUILD_COMPILER=SELFwithBUILD_COMPILER=$(LIB_BUILD_COMPILER)in bothLIB_ARGSandLIB2_ARGSTest plan
make lib(no override) — still uses opencc (defaultSELFbehavior)make lib LIB_BUILD_COMPILER=GNU— uses system GCC for runtime libsmake lib2 LIB_BUILD_COMPILER=GNU— uses system GCC for 32-bit runtime libs🤖 Generated with Claude Code