Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610384 - dev-lang/perl: Automagic detection of libcl (from dev-libs/cryptlib or dev-libs/beignet)
Summary: dev-lang/perl: Automagic detection of libcl (from dev-libs/cryptlib or dev-li...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
: 610386 648994 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-21 18:34 UTC by Mircea Sava
Modified: 2019-05-11 22:38 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,682.06 KB, text/x-log)
2017-02-21 18:36 UTC, Mircea Sava
Details
environment (environment,222.52 KB, text/plain)
2017-02-21 18:50 UTC, Mircea Sava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mircea Sava 2017-02-21 18:34:36 UTC
Recent system cleanup removed dev-libs/cryptlib and subsequent rebuilding of media-gfx/graphviz failed.

Reproducible: Always

Steps to Reproduce:
1. emerge -c
2. emerge @preserved-rebuild
3.
Actual Results:  
ERROR: media-gfx/graphviz-2.38.0-r1::gentoo failed (compile phase)
Comment 1 Mircea Sava 2017-02-21 18:36:53 UTC
Created attachment 464564 [details]
build.log
Comment 2 Mircea Sava 2017-02-21 18:39:05 UTC
package ebuild should contain dev-libs/cryptlib in either CDEPEND or DEPEND variables.
Comment 3 Mircea Sava 2017-02-21 18:50:03 UTC
Created attachment 464576 [details]
environment
Comment 4 Arfrever Frehtes Taifersar Arahesis 2017-02-22 07:32:47 UTC
Your dev-lang/perl or another Perl-related package is broken. Rebuild them.
Comment 5 Arfrever Frehtes Taifersar Arahesis 2017-02-22 07:35:23 UTC
Above guess based on build log from bug #610386, which has e.g.:

checking for Perl LDFLAGS... -Wl,-E -Wl,-O1 -Wl,--as-needed  -L/usr/lib64/perl5/5.22.3/x86_64-linux/CORE -lperl -lcl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
Comment 6 Mircea Sava 2017-02-22 19:36:47 UTC
After rebuilding dev-lang/perl and running perl-cleaner the issue persists. By switching the perl flag off however, rebuilding of the affected package(s) succeeds.
Comment 7 Mircea Sava 2017-02-22 19:40:48 UTC
So, my suggestion should be contingent on the perl USE flag being set on.
Comment 8 Mircea Sava 2017-02-22 19:47:10 UTC
/usr/lib64/graphviz/perl/libgv_perl.so (media-gfx/graphviz-2.38.0-r1) needs /usr/lib64/libcl.so.3.4.0 (dev-libs/cryptlib-3.4.0-r1)
Comment 9 Arfrever Frehtes Taifersar Arahesis 2017-03-01 07:06:17 UTC
Show output of:
perl -MExtUtils::Embed -e ldopts

(This command is used by build systems of both media-gfx/graphviz and net-analyzer/net-snmp.)
Comment 10 Mircea Sava 2017-03-01 12:32:01 UTC
Warning (mostly harmless): No library found for -lcl
-Wl,-E -Wl,-O1 -Wl,--as-needed  -L/usr/lib64/perl5/5.22.3/x86_64-linux/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
Comment 11 Arfrever Frehtes Taifersar Arahesis 2017-03-01 18:36:36 UTC
Have you manually deleted /usr/lib64/libcl.so* ?


Anyway it is something for maintainers of dev-lang/perl to handle.
Nothing to change in media-gfx/graphviz or net-analyzer/net-snmp.
Comment 12 Arfrever Frehtes Taifersar Arahesis 2017-03-01 18:37:03 UTC
*** Bug 610386 has been marked as a duplicate of this bug. ***
Comment 13 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-03-01 19:20:38 UTC
Its worth noting, that if you fix this problem, due to how Perl works, you have to fix the problem by recompiling Perl first.

So:

1. Remove offending library
2. Recompile Perl 
3. Recompile graphviz

This is because the state of -l flags is recorded at stage #2 and reused at stage #3
Comment 14 Mircea Sava 2017-03-01 21:03:05 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #11)
> Have you manually deleted /usr/lib64/libcl.so* ?

As pointed out in the bug's description /usr/lib64/libcl.so* was deleted when dev-libs/cryptlib was removed during system cleanup, which was the point I made -- if /usr/lib64/libcl.so* was needed by the two packages then maybe dev-libs/cryptlib should be put in the ebuilds.
Comment 15 Alon Bar-Lev (RETIRED) gentoo-dev 2017-08-31 20:19:03 UTC
I do not see in sources that media-gfx/graphviz nor net-analyzer/net-snmp try to link against cryptlib.
Comment 16 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-09-04 19:11:25 UTC
(In reply to Alon Bar-Lev from comment #15)
> I do not see in sources that media-gfx/graphviz nor net-analyzer/net-snmp
> try to link against cryptlib.

You won't.

During the build process, the perl extensions of those use ExtUtils:: stuff to build.

Those extensions generically build all perl extensions using flags stored in Perl's Config.pm

*Those* flags are defined by perl itself during compile.


In a sense, these are like flags added at install time from pkgconfig entries. Just instead of pkgconfig, the flag source is a Perl file.

You can see what the flags would be on an affected system by:

/usr/bin/perl -V:ldflags -V:libs

The only way to avoid those flags being passed to your packages build chain is:

1. being aware of the threat and hacking around lots of dark perl magic to stop it happening
2. rebuilding perl such that it doesn't have those flags, and the perl -V incantation above ceases to emit them, and _then_ rebuilding an affected package.

Ideally, we'd want perl itself not to have the excess linking that causes this problem in the first place, we just haven't figured out how yet.
Comment 17 Andreas K. Hüttel archtester gentoo-dev 2019-04-07 13:53:05 UTC
*** Bug 648994 has been marked as a duplicate of this bug. ***
Comment 18 Larry the Git Cow gentoo-dev 2019-04-07 14:50:35 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=670aeb361e76ed7d2d5148f6f7d73a30ad2067cd

commit 670aeb361e76ed7d2d5148f6f7d73a30ad2067cd
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2019-04-07 14:50:13 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2019-04-07 14:50:28 +0000

    dev-lang/perl: Bump 5.28.2 patchset, fix for bug 610384
    
    Bug: https://bugs.gentoo.org/610384
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 dev-lang/perl/Manifest               | 2 +-
 dev-lang/perl/perl-5.28.2_rc1.ebuild | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 19 Arfrever Frehtes Taifersar Arahesis 2019-04-08 17:11:11 UTC
(dev-libs/cryptlib was deleted in commit 60da651906a0a9a4cf30b4792342660e0b59e9e4 
(https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60da651906a0a9a4cf30b4792342660e0b59e9e4).)
Comment 20 Arfrever Frehtes Taifersar Arahesis 2019-04-08 17:21:14 UTC
(In reply to Larry the Git Cow from comment #18)
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=670aeb361e76ed7d2d5148f6f7d73a30ad2067cd
> 
> commit 670aeb361e76ed7d2d5148f6f7d73a30ad2067cd
> Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
> AuthorDate: 2019-04-07 14:50:13 +0000
> Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
> CommitDate: 2019-04-07 14:50:28 +0000
> 
>     dev-lang/perl: Bump 5.28.2 patchset, fix for bug 610384

For interested users, solution applied is:

--- perl-5.28.2-patches-1/patches/gentoo/no-nsl.patch
+++ perl-5.28.2-patches-2/patches/gentoo/no-nsl-cl.patch
@@ -1,13 +1,16 @@
+See
+https://rt.perl.org/Public/Bug/Display.html?id=131485
+
 diff --git a/Configure b/Configure
 index e32d18ce1f..85ab0249bc 100755
 --- a/Configure
 +++ b/Configure
 @@ -1497,7 +1497,7 @@ archname=''
  usereentrant='undef'
  : List of libraries we want.
  : If anyone needs extra -lxxx, put those in a hint file.
 -libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
-+libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld"
++libswanted="socket bind inet ndbm gdbm dbm db malloc dl ld"
  libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
  : We probably want to search /usr/shlib before most other libraries.
  : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
Comment 21 Larry the Git Cow gentoo-dev 2019-04-19 16:54:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f7a94dc3f57dc784e88c85516c7bfcc4e3bf5f9

commit 2f7a94dc3f57dc784e88c85516c7bfcc4e3bf5f9
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2019-04-19 15:57:12 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2019-04-19 16:52:03 +0000

    package.mask: Unmask Perl 5.28.2
    
    Bug: https://bugs.gentoo.org/610384
    Bug: https://bugs.gentoo.org/670190
    Bug: https://bugs.gentoo.org/677012
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 profiles/package.mask | 7 -------
 1 file changed, 7 deletions(-)
Comment 22 Andreas K. Hüttel archtester gentoo-dev 2019-05-11 22:38:46 UTC
Fixed in ~arch, will go stable soon.