Bug 221134 - Mk/Scripts/qa.sh: badlibmix -- Sanity check linking for SSL, GCC and gfortran libraries
Summary: Mk/Scripts/qa.sh: badlibmix -- Sanity check linking for SSL, GCC and gfortran...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D11812
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2017-08-01 04:51 UTC by Yuri Victorovich
Modified: 2017-10-15 16:30 UTC (History)
1 user (show)

See Also:


Attachments
patch (1.69 KB, patch)
2017-08-01 04:51 UTC, Yuri Victorovich
no flags Details | Diff
patch (2.27 KB, patch)
2017-08-01 05:21 UTC, Yuri Victorovich
no flags Details | Diff
patch (1.60 KB, patch)
2017-08-01 05:22 UTC, Yuri Victorovich
no flags Details | Diff
patch (2.23 KB, patch)
2017-08-01 19:25 UTC, Yuri Victorovich
no flags Details | Diff
patch (2.18 KB, patch)
2017-08-01 19:31 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.