delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/05/18:28:33

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=xZCtg7L96fo3cDlG
RePb6X2CxHDmqf0gJ4CaAGxMDciWYMgO71A8MRH0KvL1z6g6ULIAWvktewk0JHRo
U1cv/Pgn8jX+WhfutvL2UffkccfBxNGElSc2LWnet2aWVHsfHL4btP9kiMiAaLeV
jCPJNCvCPIG8+jzn8T3Wqp0CEXs=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=oCl/hQ1Uln42WBobDBUciF
aKfW8=; b=b3xXwVSdUXOuc7/QAxCpBObk82BL10+ENxvFWRRSdCH8h+cpkH1647
W2ilTdwtaBjYusDA/LDLgJyqlv0IS03sWzESRS4bHd0KSO2ajvgo51gsx5xMk1Sv
S5jw5SYfidtelb1nx6fvF8y8J82mQ3jlvve8RZXHJx64E9rmRhp1M=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=
X-HELO: limerock02.mail.cornell.edu
X-CornellRouted: This message has been Routed already.
Subject: Re: bug: configuration problem in perl with gcc libs
To: cygwin AT cygwin DOT com
References: <20160603161419 DOT GA5300 AT karasik2>
From: Ken Brown <kbrown AT cornell DOT edu>
Message-ID: <785ef8ef-4335-2d25-284e-6ece02fbd427@cornell.edu>
Date: Sun, 5 Jun 2016 18:28:02 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1
MIME-Version: 1.0
In-Reply-To: <20160603161419.GA5300@karasik2>
X-PMX-Cornell-Gauge: Gauge=XXXXX
X-IsSubscribed: yes

On 6/3/2016 12:14 PM, Dmitry Karasik wrote:
> Hello,
>
> I'd like to report a configuration bug in perl.  The problem arises when a 3-rd
> party module tries to build an extension using perl configuration with a
> gcc-specific library.
>
> Generally perl extensions don't have a way to specify library to link with
> directly, they do that through ExtUtils::MakeMaker, the standard tool for that.
> Which in turn tries to resolve '-llibname' using its own
> compile-time-configured internal list of lib paths. Everything works so far
> libraries are found in perl's libpth (see by running 'perl -V:libpth') which is
> /usr/lib on my machine. The problem arises when I need to link together with
> libgomp, which is not found there, being a gcc-version-specific library.
>
> For example, the following minimal Makefile.PL configure script
>
>    use ExtUtils::MakeMaker;
>    WriteMakefile(NAME => 'foo', LIBS => '-lgomp');
>
> will emit a warning
>
>    Warning (mostly harmless): No library found for -lgomp
>
> and removes -lgomp from the linker command, resulting in perl extension not
> being able to compile.
>
> The problem is confirmed, when, if I edit perl configuration file
> /usr/lib/perl5/5.22/i686-cygwin-threads-64int/Config.pm, everything works:
>
>      ldlibpthname => 'PATH',
> -    libpth => '/usr/lib',
> +    libpth => '/usr/lib /usr/lib/gcc/i686-pc-cygwin/5.3.0',
>      osname => 'cygwin',
>
> I believe perl needs to be built with the properly set/found libpth in advance.

I'm no perl expert, but this doesn't strike me as a good solution.  It 
means that a specific gcc version is hard-coded into perl.

It seems to me that the bug is in perl's algorithm (in 
/usr/lib/perl5/5.22/ExtUtils/Liblist/Kid.pm) for finding libraries of 
the form -lfoo.  There's a special case for Cygwin at line 171 that 
looks for foo.dll (if it hasn't found libfoo.dll.a), which is wrong for 
two reasons.  First, it should look for cygfoo*.dll instead (or in 
addition).  Second, it should look in the path, or at least in /usr/bin, 
rather than in libpth.

In the present case of -lgomp, it would have found /usr/bin/cyggomp-1.dll.

Ken


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019