fix(c): #696 - let user-set CC/AR/LD survive the build - #698
Merged
mpkorstanje merged 1 commit intoAug 31, 2026
Conversation
Member
|
@rfon6ngy looks good to you? |
|
@mpkorstanje yes, I confirm thanks |
mpkorstanje
approved these changes
Aug 31, 2026
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.
🤔 What's changed?
The
c/src/Makefileunconditionally reassignedCC,LDandARinside anifeq/elsechain. Anything that wasn't literallyclangori686-w64-mingw32-gccfell into theelsebranch, which force-setCC=gcc,LD=gcc,AR=arusing plain=assignment. Plain=assignments silently override environment-set variables (only command-line-set ones are protected in GNU Make), so settingCCvia the environment e.g.CC=musl-gcc make— was discarded and replaced withgccwithout any warning.This PR:
CCandARto?=so they're only set if the user hasn't already provided a value, otherwise falling back to make's own sensible built-in defaults (cc,ar) for the current platform.CC_FLAGS→CFLAGS,AR_FLAGS→ARFLAGS,LD_FLAGS→LDFLAGS,LD_LIBS→LDLIBS, and addsSOFLAGSfor the shared-library flag.clangbranch, since its flags were identical to the default.i686-w64-mingw32-gccspecial-case, since mingw genuinely needs different flags (no-fPIC), a dedicated archiver, and an.exeextension.⚡️ What's your motivation?
Fixes #696. The Makefile forced users into gcc/clang/mingw and silently discarded any other compiler set via the environment, even though make's own default
CC/ARvalues are usually already correct for the current OS.🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
I dropped the
clangbranch entirely since its flags matched the default, want to confirm there wasn't a reason (beyond flags) it was kept separate from the default case. Also open to feedback on whetherSOFLAGSis the right name, since it's not one of GNU Make's implicit variable names likeCFLAGS/ARFLAGS/LDFLAGS.📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.