Skip to content

libfastjson: add missing runtime dependency on libm#29161

Open
micpf wants to merge 1 commit intoopenwrt:masterfrom
micpf:fix/libfastjson-add-libm-dependency
Open

libfastjson: add missing runtime dependency on libm#29161
micpf wants to merge 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 from 69bb2bf to 5166790 Compare April 16, 2026 07:04
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>
@micpf micpf force-pushed the fix/libfastjson-add-libm-dependency branch 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.

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

3 participants