← Back to Pull requests

lmdb: Don't let a command-line CFLAGS override drop `-fPIC` #63055

Closed
unknown closed this pull request without merging on Sep 16, 2026 18:21 UTC
View on GitHub
unknown unknown commented on Sep 07, 2026 16:00 UTC
Author

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 via XCFLAGS only works as long as nothing overrides CFLAGS. A CFLAGS= assignment on the top-level make command line propagates into every sub-make through MAKEOVERRIDES and takes precedence over LMDB's own definition, at which point XCFLAGS is never expanded and both -fPIC and -O2 are silently dropped.

Since liblmdb.a is statically linked into libjulia-codegen, the non-PIC objects then break the link on targets whose toolchain does not default to PIE:

ld: usr/lib/liblmdb.a(mdb.o): relocation R_X86_64_32 against `.rodata'
    can not be used when making a shared object; recompile with -fPIC
ld: final link failed: nonrepresentable section on output

Set CFLAGS on the sub-make's own command line instead: an assignment there wins over the one inherited from the parent's MAKEOVERRIDES. Because that replaces LMDB's CFLAGS definition wholesale, the -pthread -O2 in the new value is there to restore LMDB's own THREADS/OPT defaults, 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/32579

This pull request was written with the assistance of generative AI.

🤖 Generated with Claude Code

Diff: 220 lines (+165 / -55) across 2 files Reviewer: xal-0 Review duration: 13100m
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
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 41.8% (MEDIUM) · Higher = larger blast radius
41.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.5% · Safe to merge
16.5%