Repository navigation
Commit fdcfb35
committed
fix: allow dlopen on statically-linked musl binaries
The isDynamicBinary() check prevents loadLibrary from attempting dlopen
on statically-linked Linux binaries. This is correct for glibc, where
dlopen from static binaries is undefined behavior and can crash, but
overly conservative for musl libc, which has a fully functional dlopen
implementation even in static binaries.
Add an isMusl() check so that static binaries on musl-based systems
(like Alpine Linux) can still load native libwebp via dlopen. On glibc
systems the existing guard is preserved.
This enables native libwebp loading in Alpine/Docker environments where
Go+CGO+musl produces static binaries by default.1 parent 3a7e672 commit fdcfb35
1 file changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
0 commit comments