Bug 221134

Summary: Mk/Scripts/qa.sh: badlibmix -- Sanity check linking for SSL, GCC and gfortran libraries
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Open ---    
Severity: Affects Only Me CC: ports-bugs
Priority: --- Keywords: feature, needs-qa
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D11812
Attachments:
Description Flags
patch
none
patch
none
patch
none
patch
none
patch none

Description Yuri Victorovich freebsd_committer 2017-08-01 04:51:19 UTC
Created attachment 184880 [details]
patch

Reports such errors which often lead to later crashes.

One caveat that I know of is when executable is linked to the shared library by its absolute path. Such library isn't normally found by ldd in a stage directory until installed. Maybe somebody can suggest a solution to this. In case of relative shared library links, and in case of inter-package links it should work fine.

Testing performed:
* I artificially linked one executable to both SSLs and got this error:
> Error: /usr/local/bin/qtox is linked to /usr/local/lib/libssl.so.9 from security/openssl but it is not declared as a dependency

Open to suggestions.
Comment 1 Yuri Victorovich freebsd_committer 2017-08-01 04:53:06 UTC
Correction, the error message is:
> Error: /usr/local/bin/qtox is linked to both base and port SSL libraries: /usr/lib/libssl.so.8 /lib/libcrypto.so.8 and /usr/local/lib/libssl.so.9 /usr/local/lib/libcrypto.so.9
Comment 2 Yuri Victorovich freebsd_committer 2017-08-01 05:21:30 UTC
Created attachment 184881 [details]
patch
Comment 3 Yuri Victorovich freebsd_committer 2017-08-01 05:22:09 UTC
Created attachment 184882 [details]
patch
Comment 4 Yuri Victorovich freebsd_committer 2017-08-01 17:23:07 UTC
It needs to be generalized to include the mix of libgcc_s.so from the base and from gfortran.
Comment 5 Yuri Victorovich freebsd_committer 2017-08-01 19:25:58 UTC
Created attachment 184925 [details]
patch

Added libgcc_s check.

It might fail for many ports including fortran parts because many of them are broken.
Comment 6 Yuri Victorovich freebsd_committer 2017-08-01 19:31:14 UTC
Created attachment 184926 [details]
patch
Comment 7 Mathieu Arnold freebsd_committer 2017-08-01 20:50:26 UTC
Could you create a review on phabricator ? it feels like the we're back in the stone age trying to review this here.
Comment 8 Yuri Victorovich freebsd_committer 2017-08-01 21:09:41 UTC
https://reviews.freebsd.org/D11812
Comment 9 Yuri Victorovich freebsd_committer 2017-10-15 16:30:36 UTC
For the record, /lib/libedit.so.7 can also conflict with the port's version /usr/local/lib/libedit.so.0. This pair needs to be added to the check.