Re: [Buildroot] [PATCH] package/jpeg-turbo: fix aarch64 build using an upstream patch

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <aoghe-d8Lvcj_qlr@windsurf>
Hello Alessandro,

On Sun, Jul 26, 2026 at 11:57:26PM +0200, Alessandro Rubini wrote:
> This patch is 3.2.0-8-g0da22762 in the original jpeg-turbo package,
> where the committer claims they can't reproduce the problem. Buildroot
> is currently using version 3.2.0 of the package.
> 
> The build issue I esperience with an aarch64 build (cm4 custom baseboard)
> is the following:
> 
>    spng.c:(.text+0x4d8c): undefined reference to `__fpclassifyf'
> 
> The patch actually fixes it.
> 
> Signed-off-by: Alessandro Rubini <[email protected]>

Thanks for your patch. I was initially not able to reproduce the
issue, but after digging into the autobuilder failures for this
problem, I found out that the key to encounter the problem is
BR2_OPTIMIZE_S=y (i.e use gcc -Os instead of our default of -O2). Do
you confirm you are using BR2_OPTIMIZE_S=y in your configuration?

Overall, I can reproduce the issue with:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_OPTIMIZE_S=y
BR2_PACKAGE_JPEG=y

but not with:

BR2_aarch64=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y
BR2_PACKAGE_JPEG=y

Do we understand why the issue happens with -Os but not -O2 ?

> diff --git a/package/jpeg-turbo/0001-libspng-Really-remove-gamma-correction-code.patch b/package/jpeg-turbo/0001-libspng-Really-remove-gamma-correction-code.patch
> new file mode 100644
> index 0000000000..5dcd95d0b9
> --- /dev/null
> +++ b/package/jpeg-turbo/0001-libspng-Really-remove-gamma-correction-code.patch
> @@ -0,0 +1,109 @@
> +From 0da22762971551462cfad8f0b11cfb037472a4e8 Mon Sep 17 00:00:00 2001
> +From: DRC <[email protected]>
> +Date: Thu, 16 Jul 2026 12:09:54 -0400
> +Subject: [PATCH] libspng: Really remove gamma correction code
> +
> +We really don't use it, and fpclassify() apparently introduces yet
> +another libm dependency in some cases (although I can't reproduce that.)
> +
> +Fixes #904

We require all patches added in Buildroot to have:

- An "Upstream:" tag that points to the upstream commit, PR or patch
  submission (in your case, commit)

- A "Signed-off-by:" tag from the person who introduced the patch into
  Buildroot, i.e you.

Could you adjust this, together with hopefully some explanation on why
-Os triggers the issue and not -O2?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.