libfastjson uses modf() from libm (in json_object.c / json_print.c) and links against it at build time, but the package definition doesn't declare DEPENDS:=+libm. This means the dynamic linker doesn't guarantee libm is loaded and relocated before libfastjson.
This is normally harmless because rsyslog (the main consumer) also links libm directly. However, with CONFIG_PKG_RELRO_FULL (BIND_NOW), the missing dependency can cause a fatal crash on PowerPC: the dynamic linker may process libfastjson's relocations before libm's GOT is set up, triggering libm's IFUNC resolver (__modf_ifunc) with an uninitialized _rtld_global_ro pointer — resulting in a segfault at address 0x78.
Observed on PowerPC64 BE (e5500) with glibc 2.41, where rsyslogd crashes immediately on startup.
Suggested fix: add DEPENDS:=+libm to the package definition.
define Package/libfastjson
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A fast JSON library for C
URL:=https://github.com/rsyslog/libfastjson
+ DEPENDS:=+libm
endef
Note: glibc's PowerPC INIT_ARCH() macro also has a regression (lost NULL guard for _rtld_global_ro in commit 21841f0d562f), but the missing dependency is a standalone packaging bug.
libfastjson uses
modf()from libm (injson_object.c/json_print.c) and links against it at build time, but the package definition doesn't declareDEPENDS:=+libm. This means the dynamic linker doesn't guarantee libm is loaded and relocated before libfastjson.This is normally harmless because rsyslog (the main consumer) also links libm directly. However, with
CONFIG_PKG_RELRO_FULL(BIND_NOW), the missing dependency can cause a fatal crash on PowerPC: the dynamic linker may process libfastjson's relocations before libm's GOT is set up, triggering libm's IFUNC resolver (__modf_ifunc) with an uninitialized_rtld_global_ropointer — resulting in a segfault at address 0x78.Observed on PowerPC64 BE (e5500) with glibc 2.41, where rsyslogd crashes immediately on startup.
Suggested fix: add
DEPENDS:=+libmto the package definition.define Package/libfastjson SECTION:=libs CATEGORY:=Libraries TITLE:=A fast JSON library for C URL:=https://github.com/rsyslog/libfastjson + DEPENDS:=+libm endefNote: glibc's PowerPC
INIT_ARCH()macro also has a regression (lost NULL guard for_rtld_global_roin commit21841f0d562f), but the missing dependency is a standalone packaging bug.