Commit 04649a1
build: unify static/dynamic linking across Linux and macOS
Replace the platform-specific linking logic (Linux: -static full
static binary; macOS: .a preferred with -l fallback) with a single
unified approach that works everywhere:
- Search for .a static archives in LIBRARY_DIRS and common paths
- If found, link the .a directly (static)
- If not found, fallback to -l (dynamic)
This removes the -static flag on Linux which required a static glibc
and broke builds in package managers like conda where only shared
system libraries are available.
Behavior is unchanged when static archives exist (e.g., user-compiled
libs). When only shared libs are available (conda, apt, etc.), the
build now succeeds instead of failing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent fcf9166 commit 04649a1
1 file changed
Lines changed: 10 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
| |||
0 commit comments