develooper Front page | perl.perl5.porters | Postings from February 2018

[perl #132771] perl5 erroneously links in libcl on linux

From:
James E Keenan via RT
Date:
February 17, 2018 14:14
Subject:
[perl #132771] perl5 erroneously links in libcl on linux
Message ID:
rt-4.0.24-32169-1518876884-1397.132771-15-0@perl.org
On Fri, 26 Jan 2018 09:53:39 GMT, d.newsgroups@gmail.com wrote:
> This is a bug report for perl from d.newsgroups@gmail.com,
> generated with the help of perlbug 1.40 running under perl 5.26.1.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> perls "Configuration" has "cl" in its libswanted.
> Here, libcl.so exists and is provided by beignet (OpenCL implementation
> for Intel GPU):
> 
> $ ls -l /usr/lib64/libcl.so
> lrwxrwxrwx 1 root root 43 13. Okt 16:29 /usr/lib64/libcl.so ->
> OpenCL/vendors/beignet/lib/beignet/libcl.so
> 
> 1) perl should not depend on this library, it pulls in a lot of other
> stuff:
> 
> $ ldd miniperl
> 	linux-vdso.so.1 (0x00007ffcb276f000)
> 	libcl.so => /usr/lib64/OpenCL/vendors/beignet/libcl.so
> (0x00007f043ce0e000)
> 	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f043c89b000)
> 	libnsl.so.2 => /usr/lib64/libnsl.so.2 (0x00007f043c680000)
> 	libdl.so.2 => /lib64/libdl.so.2 (0x00007f043c47c000)
> 	libm.so.6 => /lib64/libm.so.6 (0x00007f043c134000)
> 	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f043befc000)
> 	libutil.so.1 => /lib64/libutil.so.1 (0x00007f043bcf9000)
> 	libc.so.6 => /lib64/libc.so.6 (0x00007f043b935000)
> 	librt.so.1 => /lib64/librt.so.1 (0x00007f043b72d000)
> 	libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007f043b524000)
> 	libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007f043b305000)
> 	libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f043afa9000)
> 	libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007f043ad93000)
> 	libXfixes.so.3 => /usr/lib64/libXfixes.so.3
> (0x00007f043ab8d000)
> 	libdrm_intel.so.1 => /usr/lib64/libdrm_intel.so.1
> (0x00007f043a962000)
> 	libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007f043a74e000)
> 	libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f043a4cb000)
> 	libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007f043a28e000)
> 	libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-
> gnu/7.2.0/libstdc++.so.6 (0x00007f0439e8a000)
> 	libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-
> gnu/7.2.0/libgcc_s.so.1 (0x00007f0439c73000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007f043cccd000)
> 	libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007f0439a46000)
> 	libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f043983e000)
> 	libbsd.so.0 => /usr/lib64/libbsd.so.0 (0x00007f0439622000)
> 	libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f04393f7000)
> 	libpciaccess.so.0 => /usr/lib64/libpciaccess.so.0
> (0x00007f04391ed000)
> 	libz.so.1 => /lib64/libz.so.1 (0x00007f0438fce000)
> 	libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007f0438d8f000)
> 	libxcb-dri3.so.0 => /usr/lib64/libxcb-dri3.so.0
> (0x00007f0438b8c000)
> 	libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0
> (0x00007f0438984000)
> 	libxcb-present.so.0 => /usr/lib64/libxcb-present.so.0
> (0x00007f0438781000)
> 	libxcb-sync.so.1 => /usr/lib64/libxcb-sync.so.1
> (0x00007f043857a000)
> 	libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1
> (0x00007f0438378000)
> 	libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x00007f0438147000)
> 	libXdamage.so.1 => /usr/lib64/libXdamage.so.1
> (0x00007f0437f44000)
> 	libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1
> (0x00007f0437d42000)
> 	libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0
> (0x00007f0437b26000)
> 	libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0
> (0x00007f0437921000)
> 	libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1
> (0x00007f043771b000)
> 	libwayland-client.so.0 => /usr/lib64/libwayland-client.so.0
> (0x00007f043750c000)
> 	libgbm.so.1 => /usr/lib64/libgbm.so.1 (0x00007f0437303000)
> 	libwayland-server.so.0 => /usr/lib64/libwayland-server.so.0
> (0x00007f04370ef000)
> 	libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f0436eeb000)
> 	libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007f0436ce5000)
> 	libffi.so.6 => /usr/lib64/libffi.so.6 (0x00007f0436adb000)
> 
> 
> 2) perl compiles and installs. However, if run as a restricted (non-X-
> )user, the additional dependencies (beignet) complain and print "No
> protocol specified" to stderr. This for example breaks
> ExtUtils::MakeMaker:
> 	in find_perl 
> 		ExtUtils/MM_Unix.pm:1133: my $version_check =
> qq{"/usr/bin/perl" -le "require $ver; print qq{VER_OK}"};
> 		ExtUtils/MM_Unix.pm:1144: close STDERR if
> $stderr_duped;
> 		ExtUtils/MM_Unix.pm:1145: $val = `$version_check`;
> 	on my machine, the call to perl with libcl.so dependency
> returns with $?=0 but without output. Commenting the "close STDERR"
> solves this issue in most cases. (However I was not able to build perl
> itself with 
> this modification: the test call never finishes.)
> 	Maybe this is a separate issue but highlights side-effects.
> 
> 3) removing "cl" from libswanted results in perl with
> 
> $ ldd perl
> 	linux-vdso.so.1 (0x00007ffcbbd5b000)
> 	libperl.so.5.26 => /usr/lib64/libperl.so.5.26
> (0x00007fdb48923000)
> 	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdb48703000)
> 	libnsl.so.2 => /usr/lib64/libnsl.so.2 (0x00007fdb484e8000)
> 	libdl.so.2 => /lib64/libdl.so.2 (0x00007fdb482e4000)
> 	libm.so.6 => /lib64/libm.so.6 (0x00007fdb47f9c000)
> 	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fdb47d64000)
> 	libutil.so.1 => /lib64/libutil.so.1 (0x00007fdb47b61000)
> 	libc.so.6 => /lib64/libc.so.6 (0x00007fdb4779d000)
> 	/lib64/ld-linux-x86-64.so.2 (0x00007fdb48b69000)
> 	libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007fdb47570000)
> 
> See also perl bug #131485 reported against freebsd.
> 
> 

Can you try to build Perl 5 in this environment from the source code in the smoke-me/jkeenan/131485-cl branch?

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=132771



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About