Package: src:libjpeg-turbo
Version: 1:1.5.1-1
Severity: serious
Tags: patch upstream

libjpeg-turbo fails to build from source on mips* with the following

| libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time 
-D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/«PKGBUILDDIR»=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic 
-ffloat-store -c jsimd_mips_dspr2.S -fPIE -o jsimd_mips_dspr2.o >/dev/null 2>&1
| jsimd_mips.c: In function 'init_simd':
| jsimd_mips.c:82:3: error: 'env' undeclared (first use in this function)
|    env = getenv("JSIMD_FORCEDSPR2");
|    ^~~
| jsimd_mips.c:82:3: note: each undeclared identifier is reported only once for 
each function it appears in
| Makefile:596: recipe for target 'jsimd_mips.lo' failed

The problem is that the env variable is not declared in the MIPS
specific code. The following simple patch fixes the issue:

--- libjpeg-turbo-1.5.1.orig/simd/jsimd_mips.c
+++ libjpeg-turbo-1.5.1/simd/jsimd_mips.c
@@ -63,6 +63,8 @@ parse_proc_cpuinfo(const char* search_st
 init_simd (void)
+  char *env = NULL;
   if (simd_support != ~0U)

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: mips64el (mips64)

Kernel: Linux 4.7.0-1-5kc-malta
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply via email to