[Buildroot] [PATCH 2/2] package/jpeg-turbo: fix libm linking issue

Bernd Kuhls <[email protected]> Sun, 26 Jul 2026 19:54:17 +0200
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
Buildroot commit bb38f6f7208497cf5a4df922e833492001170111 bumped the
package to 3.2.0. This version first included upstream commit
https://github.com/libjpeg-turbo/libjpeg-turbo/commit/ed00e0f4b39291e954958b96a8d941ca4a9e03a2
which removed the dependency to libm causing build errors detected by
the autobuilders.

Disabling the build of tests by the previous patch of this series is not
enough because the build will fail on other tools like

[ 98%] Linking C executable djpeg-static
/home/bernd/buildroot/output/per-package/jpeg-turbo/host/bin/../lib/gcc/i686-buildroot-linux-gnu/15.3.0/../../../../i686-buildroot-linux-gnu/bin/ld:
 src/spng/CMakeFiles/spng-static.dir/spng.c.o: in function
 `spng_decode_image':
spng.c:(.text+0x4c62): undefined reference to `__fpclassifyf'

so we still need to link with libm to fix the problem.

Fixes:
https://autobuild.buildroot.net/results/981/98114d4ea7afe62bb4cef934a06bf289d863ad3f/

Bug was reported upstream:
https://github.com/libjpeg-turbo/libjpeg-turbo/issues/907

Signed-off-by: Bernd Kuhls <[email protected]>
---
Gitlab pipelines passed:
https://gitlab.com/bkuhls/buildroot/-/commits/ad732a23e5887a8894907fcf96d534d646f2a377

 package/jpeg-turbo/jpeg-turbo.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/jpeg-turbo/jpeg-turbo.mk b/package/jpeg-turbo/jpeg-turbo.mk
index 36a0260f40..82b3f03bdc 100644
--- a/package/jpeg-turbo/jpeg-turbo.mk
+++ b/package/jpeg-turbo/jpeg-turbo.mk
@@ -45,6 +45,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_JPEG_TURBO_TOOLS),y)
 JPEG_TURBO_CONF_OPTS += \
+	-DCMAKE_EXE_LINKER_FLAGS=-lm \
 	-DWITH_TOOLS=ON
 else
 JPEG_TURBO_CONF_OPTS += -DWITH_TOOLS=OFF
-- 
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot