Skip to content

libfastjson: add missing runtime dependency on libm#29161

Merged
hnyman merged 1 commit intoopenwrt:masterfrom
micpf:fix/libfastjson-add-libm-dependency
May 2, 2026
Merged

libfastjson: add missing runtime dependency on libm#29161
hnyman merged 1 commit intoopenwrt:masterfrom
micpf:fix/libfastjson-add-libm-dependency

Conversation

@micpf
Copy link
Copy Markdown
Contributor

@micpf micpf commented Apr 15, 2026

libfastjson uses modf() from libm but does not declare the dependency in its package definition. With CONFIG_PKG_RELRO_FULL (BIND_NOW), this can cause the dynamic linker to process libfastjson's relocations before libm's GOT is set up, triggering a crash in libm's IFUNC resolver on PowerPC.

Observed on PowerPC64 BE (e5500) with glibc 2.41, where rsyslogd crashes immediately on startup.

Fixes: #29160

@micpf micpf force-pushed the fix/libfastjson-add-libm-dependency branch from e581d8b to 69bb2bf Compare April 15, 2026 16:36
@brada4
Copy link
Copy Markdown
Contributor

brada4 commented Apr 15, 2026

Should be conditional for glibc. musl conains math and pth in one lib.

@predators46
Copy link
Copy Markdown
Contributor

@micpf

+USE_GLIBC:libm

@micpf micpf force-pushed the fix/libfastjson-add-libm-dependency branch 2 times, most recently from 5166790 to efa7857 Compare April 16, 2026 07:05
@micpf
Copy link
Copy Markdown
Contributor Author

micpf commented Apr 16, 2026

ok thanks for the info, I've fixed it.

libfastjson uses modf() from libm but does not declare the dependency.
With BIND_NOW (CONFIG_PKG_RELRO_FULL), this can cause the dynamic linker
to process libfastjson's relocations before libm's GOT is set up,
triggering a crash in libm's IFUNC resolver on PowerPC.

Fixes: openwrt#29160
Signed-off-by: micpf <micpf@westermo.com>
@BKPepe BKPepe force-pushed the fix/libfastjson-add-libm-dependency branch from efa7857 to a667192 Compare April 29, 2026 12:19
@hnyman hnyman merged commit d114f46 into openwrt:master May 2, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libfastjson: missing runtime dependency on libm

4 participants