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

[perl #131485] Arbitrary linking of libcl in Configure on FreeBSD

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
February 16, 2018 20:51
Subject:
[perl #131485] Arbitrary linking of libcl in Configure on FreeBSD
Message ID:
rt-4.0.24-7164-1518814284-1779.131485-15-0@perl.org
On Sun, 04 Jun 2017 08:57:26 GMT, hmbrand wrote:
> On Fri, 02 Jun 2017 12:51:33 -0700, "perlbug@perl.org (via RT)"
> <perlbug-followup@perl.org> wrote:
> 
> > TL;DR version:
> > 
> > Commit 90207ba1bd77fb10e2c39594d954b43a9e8ee948 added 'cl' to the
> > libswanted search. This was apparently needed on HP-UX.
> 
> s/was/is/
> 
> > This should not be arbitrarily added in for all platforms and should
> > be restricted to only HP-UX if that is required there.
> 
> Is was discussed then, and noone saw danger in that.
> 
> There are multiple possible approaches to this.
> 
> 1. leave Configure as is and remove cl from libswanted for problematic
>    OS's in hints
> 
> 2. Move prepending instead of appending to hints/hpux.sh

This is the course we should follow.  Indeed, it is the course we should have pursued in the first place.

If we revisit https://rt.perl.org/Ticket/Display.html?id=123543 for a moment, we see that the only complaint in that ticket was about a failing test on one of Tux's HP-UX boxes which was bisected to a particular commit by bulk88.  The commit message for the change to Configure reads:

#####
commit 90207ba1bd77fb10e2c39594d954b43a9e8ee948
Author: H.Merijn Brand <h.m.brand@xs4all.nl>
Date:   Mon Jan 5 12:33:49 2015 +0100

    Put pthread in front of libswanted and add cl
    
    If pthread is found on HP-UX, it is required to be in front and libcl is required too
#####

Nothing there about any other OS.  The corresponding change in the metaconfig repository reads:

#####
commit 746e95e8deee3cc9f1fc657c47ec61fb6845f66b
Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Date:   Mon Jan 5 12:31:45 2015 +0100

    Put pthread in front of libswanted and add cl
    
    If pthread is found on HP-UX, it is required to be in front and libcl is required too

diff --git a/U/modified/Myinit.U b/U/modified/Myinit.U
index c265a25..e508b67 100644
--- a/U/modified/Myinit.U
+++ b/U/modified/Myinit.U
@@ -32,8 +32,8 @@
 ?X: Put crypt here, even though I should really fix d_crypt.U to look
 ?X: for it correctly, including possible shared library versions.
 : If anyone needs extra -lxxx, put those in a hint file.
-libswanted="socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
-libswanted="$libswanted m crypt sec util c cposix posix pthread ucb bsd BSD"
+libswanted="cl pthread socket bind inet nsl nm 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.
#####

There's no evidence the change was needed on any OS other than HP-UX.  Hence, the change would have been better off in hints/hpux.sh.  This is even more true now that we have, in https://rt.perl.org/Ticket/Display.html?id=132771, the same problem showing up in a Linux distro as well as the FreeBSD problem cited in this ticket -- a problem which persists with blead, as I confirmed this morning following BingOS's suggestion about (temporarily) installing cryptlib.

I don't claim to understand the fine points about the interaction between cl and pthreads, so I don't claim to have a complete solution.  But what I think we should try is:

* In a branch, move the assignment of 'cl' to hints/hpux.sh.

* Smoke-test the branch on as many OSes as possible.

* When we're satisfied, merge to blead and make corresponding change to metaconfig repository.

> 
> 3. Analyse the real underlying problem and find a fix
> 
> The last option requires a lot of skills and access to many different
> problems but it will be the safest option
> 
> With declining access to HP-UX, it will be (very) hard to prove that we
> didn't break anything with option 2
> 
> Option 1 will probably cause duplication code in hints, unless we
> decide to put more code in Configure itself
> 
> This obviously is not a situation where we should decide on "But this
> doesn't work on *my* system". It was stable for over 2 years.
> 

Thank you very much.
-- 
James E Keenan (jkeenan@cpan.org)

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

Thread Previous | Thread Next


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