lmdb: Don't let a command-line CFLAGS override drop `-fPIC` #63055
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 220 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #63055"
general
weight: 0.35
xal-0
This error showed up while updating the libjulia recipe in Yggdrasil (https://github.com/JuliaPackaging/Yggdrasil/pull/14705). I don't understand anything of this. What follows is Claude's analysis and fix of the issue. Hopefully, someone can make use of it.
---
LMDB's Makefile defines
CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS), so passing our flags viaXCFLAGSonly works as long as nothing overridesCFLAGS. ACFLAGS=assignment on the top-level make command line propagates into every sub-make throughMAKEOVERRIDESand takes precedence over LMDB's own definition, at which pointXCFLAGSis never expanded and both-fPICand-O2are silently dropped.Since
liblmdb.ais statically linked into libjulia-codegen, the non-PIC objects then break the link on targets whose toolchain does not default to PIE:Set
CFLAGSon the sub-make's own command line instead: an assignment there wins over the one inherited from the parent'sMAKEOVERRIDES. Because that replaces LMDB'sCFLAGSdefinition wholesale, the-pthread -O2in the new value is there to restore LMDB's ownTHREADS/OPTdefaults, which would otherwise be lost.Reproduces with
make CFLAGS="-I/some/include" julia-src-release; seen in Yggdrasil's cross-builds of libjulia for julia 1.14 on x86_64-linux-gnu, aarch64-linux-gnu, riscv64-linux-gnu and both FreeBSD targets, e.g. https://buildkite.com/julialang/yggdrasil/builds/32579This pull request was written with the assistance of generative AI.
🤖 Generated with Claude Code