Package: src:libjpeg-turbo
Version: 1:1.5.0-1
Forwarded: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/88
Tags: upstream patch

Dear packager,

jpeg-turbo does not currently works on PowerPC without altivec. This
has been reported upstream, so until this gets fixed properly, we are
suggesting the following patch to adress this bug.

Please note that both gcc-6 and glibc ≥ 2.23 are required for this
patch to work.

Regards


---------- Forwarded message ----------
From: Lennart Sorensen <[email protected]>
Date: Tue, Jul 5, 2016 at 9:01 PM
Subject: Re: jpeg-turbo 6.2 and ppc G3
To: Riccardo Mottola <[email protected]>
Cc: PowerPC List Debian <[email protected]>


On Tue, Jul 05, 2016 at 07:46:10PM +0200, Riccardo Mottola wrote:
> Hi Lennart,
>
> Lennart Sorensen wrote:
> >On Sat, Jul 02, 2016 at 08:57:56AM +0200, Riccardo Mottola wrote:
> >>I what test program could I use? I noticed that e.g. Firefox (which works)
> >>is not linked against it.
> >You could try forcing altivec off in libjpegturbo by setting the environment:
> >
> >export JSIMD_FORCENONE=1
>
> that works! Once set, the application loads several JPG files without
> issues.

So it turns out libjpeg-turbo has NO runtime detection on powerpc and
just assumes altivec is valid.

This untested patch might work:

--- simd/jsimd_powerpc.c.orig   2016-07-05 14:57:48.305763762 -0400
+++ simd/jsimd_powerpc.c        2016-07-05 14:58:04.453763762 -0400
@@ -32,7 +32,10 @@
   if (simd_support != ~0U)
     return;

-  simd_support = JSIMD_ALTIVEC;
+  if (__builtin_cpu_supports("altivec"))
+    simd_support = JSIMD_ALTIVEC;
+  else
+    simd_support = 0;

   /* Force different settings through environment variables */
   env = getenv("JSIMD_FORCENONE");

--
Len Sorensen

Reply via email to