Bug#857623: mesa-opencl-icd: openCL is broken in LLVM < v5

2017-03-13 Thread Andreas Boll
Control: reassign -1 src:llvm-toolchain-3.9 1:3.9.1-5
Control: block 848258 by -1
Control: forwarded -1 https://bugs.llvm.org/show_bug.cgi?id=30217

On Mon, Mar 13, 2017 at 05:32:40AM -0700, Ian Bruce wrote:
> Package: mesa-opencl-icd
> Version: 13.0.5-1
> Severity: important
> Tags: upstream patch
> 
> LLVM versions before v5 contain a known language bug, involving the use
> of pointers as boolean values, which makes them essentially unusable for
> openCL:
> 
> https://bugs.llvm.org/show_bug.cgi?id=30217
> 
> https://reviews.llvm.org/D29038
> 
> https://reviews.llvm.org/rL294313
> 
> For an example of the problems this causes, see here:
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848258
> 
> https://developer.blender.org/T50522
> 
> a trivial test case illustrating the bug:
> 
> 
> $ cat ptr-expr2.c
> int ptr_expr(int *p)
> {
> if (!p)
> return(0);
> else
> return(1);
> }
> 
> $ clang-3.9 -x cl -emit-llvm -S ptr-expr2.c
> ptr-expr2.c:3:9: error: invalid argument type 'int *' to unary expression
> if (!p)
> ^~
> 1 error generated.
> 
> $ clang-4.0 -x cl -emit-llvm -S ptr-expr2.c
> ptr-expr2.c:3:9: error: invalid argument type 'int *' to unary expression
> if (!p)
> ^~
> 1 error generated.
> 
> $ clang-5.0 -x cl -emit-llvm -S ptr-expr2.c
> $ # compilation succeeds
> 
> 
> possible solutions:
> 
> - make openCL require LLVM-v5
> 
> - backport the bugfix from LLVM-v5 to earlier versions;
>   it is apparently a single line change (see LLVM link above)

Dear LLVM maintainers,

please cherry-pick r294313 for llvm-3.9 and llvm-4.0.

Thanks,
Andreas


> Until one or other of these solutions is applied, openCL in Mesa is
> effectively unusable.
> 
> 
> 
> -- System Information:
> Debian Release: 9.0
>   APT prefers testing
>   APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
> (500, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages mesa-opencl-icd depends on:
> ii  libc62.24-9
> ii  libclc-amdgcn0.2.0+git20160907-3
> ii  libclc-r600  0.2.0+git20160907-3
> ii  libdrm-amdgpu1   2.4.74-1
> ii  libdrm-nouveau2  2.4.74-1
> ii  libdrm-radeon1   2.4.74-1
> ii  libdrm2  2.4.74-1
> ii  libelf1  0.168-0.2
> ii  libexpat12.2.0-2
> ii  libgcc1  1:6.3.0-6
> ii  libgcrypt20  1.7.6-1
> ii  libllvm3.9   1:3.9.1-4
> ii  libsensors4  1:3.4.0-3+b1
> ii  libstdc++6   6.3.0-6
> ii  ocl-icd-libopencl1 [libopencl1]  2.2.11-1
> 
> mesa-opencl-icd recommends no packages.
> 
> mesa-opencl-icd suggests no packages.
> 
> Versions of packages xserver-xorg depends on:
> ii  x11-xkb-utils  7.7+3+b1
> ii  xkb-data   2.19-1
> ii  xserver-xorg-core  2:1.19.2-1
> ii  xserver-xorg-input-evdev [xorg-driver-input]   1:2.10.5-1
> ii  xserver-xorg-video-radeon [xorg-driver-video]  1:7.8.0-1+b1
> 
> Versions of packages xserver-xorg recommends:
> ii  libgl1-mesa-dri  13.0.5-1
> 
> Versions of packages xserver-xorg-core depends on:
> ii  keyboard-configuration1.160
> ii  libaudit1 1:2.6.7-1
> ii  libbsd0   0.8.3-1
> ii  libc6 2.24-9
> ii  libdbus-1-3   1.10.16-1
> ii  libdrm2   2.4.74-1
> ii  libegl1-mesa  13.0.5-1
> ii  libepoxy0 1.3.1-2
> ii  libgbm1   13.0.5-1
> ii  libgcrypt20   1.7.6-1
> ii  libgl1-mesa-glx [libgl1]  13.0.5-1
> ii  libpciaccess0 0.13.4-1
> ii  libpixman-1-0 0.34.0-1
> ii  libselinux1   2.6-3
> ii  libsystemd0   232-19
> ii  libudev1  232-19
> ii  libxau6   1:1.0.8-1
> ii  libxdmcp6 1:1.1.2-3
> ii  libxfont2 1:2.0.1-3
> ii  libxshmfence1 1.2-1
> ii  udev  232-19
> ii  xserver-common2:1.19.2-1
> 
> Versions of packages xserver-xorg-core recommends:
> ii  libgl1-mesa-dri  13.0.5-1
> ii  libpam-systemd   232-19
> 
> Versions of packages xserver-xorg-core suggests:
> ii  xfonts-100dpi1:1.0.4+nmu1
> ii  xfonts-75dpi 1:1.0.4+nmu1
> ii  xfonts-scalable  1:1.0.3-1.1
> 
> -- no debconf information


signature.asc
Description: Digital signature


Bug#857623: mesa-opencl-icd: openCL is broken in LLVM < v5

2017-03-13 Thread Ian Bruce
Package: mesa-opencl-icd
Version: 13.0.5-1
Severity: important
Tags: upstream patch

LLVM versions before v5 contain a known language bug, involving the use
of pointers as boolean values, which makes them essentially unusable for
openCL:

https://bugs.llvm.org/show_bug.cgi?id=30217

https://reviews.llvm.org/D29038

https://reviews.llvm.org/rL294313

For an example of the problems this causes, see here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848258

https://developer.blender.org/T50522

a trivial test case illustrating the bug:


$ cat ptr-expr2.c
int ptr_expr(int *p)
{
if (!p)
return(0);
else
return(1);
}

$ clang-3.9 -x cl -emit-llvm -S ptr-expr2.c
ptr-expr2.c:3:9: error: invalid argument type 'int *' to unary expression
if (!p)
^~
1 error generated.

$ clang-4.0 -x cl -emit-llvm -S ptr-expr2.c
ptr-expr2.c:3:9: error: invalid argument type 'int *' to unary expression
if (!p)
^~
1 error generated.

$ clang-5.0 -x cl -emit-llvm -S ptr-expr2.c
$ # compilation succeeds


possible solutions:

- make openCL require LLVM-v5

- backport the bugfix from LLVM-v5 to earlier versions;
  it is apparently a single line change (see LLVM link above)

Until one or other of these solutions is applied, openCL in Mesa is
effectively unusable.



-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
(500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages mesa-opencl-icd depends on:
ii  libc62.24-9
ii  libclc-amdgcn0.2.0+git20160907-3
ii  libclc-r600  0.2.0+git20160907-3
ii  libdrm-amdgpu1   2.4.74-1
ii  libdrm-nouveau2  2.4.74-1
ii  libdrm-radeon1   2.4.74-1
ii  libdrm2  2.4.74-1
ii  libelf1  0.168-0.2
ii  libexpat12.2.0-2
ii  libgcc1  1:6.3.0-6
ii  libgcrypt20  1.7.6-1
ii  libllvm3.9   1:3.9.1-4
ii  libsensors4  1:3.4.0-3+b1
ii  libstdc++6   6.3.0-6
ii  ocl-icd-libopencl1 [libopencl1]  2.2.11-1

mesa-opencl-icd recommends no packages.

mesa-opencl-icd suggests no packages.

Versions of packages xserver-xorg depends on:
ii  x11-xkb-utils  7.7+3+b1
ii  xkb-data   2.19-1
ii  xserver-xorg-core  2:1.19.2-1
ii  xserver-xorg-input-evdev [xorg-driver-input]   1:2.10.5-1
ii  xserver-xorg-video-radeon [xorg-driver-video]  1:7.8.0-1+b1

Versions of packages xserver-xorg recommends:
ii  libgl1-mesa-dri  13.0.5-1

Versions of packages xserver-xorg-core depends on:
ii  keyboard-configuration1.160
ii  libaudit1 1:2.6.7-1
ii  libbsd0   0.8.3-1
ii  libc6 2.24-9
ii  libdbus-1-3   1.10.16-1
ii  libdrm2   2.4.74-1
ii  libegl1-mesa  13.0.5-1
ii  libepoxy0 1.3.1-2
ii  libgbm1   13.0.5-1
ii  libgcrypt20   1.7.6-1
ii  libgl1-mesa-glx [libgl1]  13.0.5-1
ii  libpciaccess0 0.13.4-1
ii  libpixman-1-0 0.34.0-1
ii  libselinux1   2.6-3
ii  libsystemd0   232-19
ii  libudev1  232-19
ii  libxau6   1:1.0.8-1
ii  libxdmcp6 1:1.1.2-3
ii  libxfont2 1:2.0.1-3
ii  libxshmfence1 1.2-1
ii  udev  232-19
ii  xserver-common2:1.19.2-1

Versions of packages xserver-xorg-core recommends:
ii  libgl1-mesa-dri  13.0.5-1
ii  libpam-systemd   232-19

Versions of packages xserver-xorg-core suggests:
ii  xfonts-100dpi1:1.0.4+nmu1
ii  xfonts-75dpi 1:1.0.4+nmu1
ii  xfonts-scalable  1:1.0.3-1.1

-- no debconf information