public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Gerrit P. Haase @ cygwin" <gp@familiehaase.de>
To: "Pierre A. Humblet" <Pierre.Humblet@ieee.org>
Cc: cygwin@cygwin.com
Subject: Re: Problem with "perl -MExtUtils::Embed -e ldopts"
Date: Sun, 09 Dec 2001 07:27:00 -0000	[thread overview]
Message-ID: <18164870789.20011209162856@familiehaase.de> (raw)
In-Reply-To: <3.0.5.32.20011208162816.0082ea00@pop.ne.mediaone.net>

[-- Attachment #1: Type: text/plain, Size: 2634 bytes --]

Hallo Pierre,

Am 2001-12-08 um 22:28 schriebst du:

> I have a package that uses perl itself to configure a makefile to
> use perl libraries. The command and its output are
 
>> perl  -MExtUtils::Embed -e ldopts
> Note (probably harmless): No library found for -lperl
>  -s  -s -L/usr/local/lib
> /usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a
> -L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lcrypt

> 3 observations:
> 1) The "harmless note" suggests that the perl library is not where expected.
>    Should it be -lperl5_6_1 or is there a missing link? 
> 2) The -s causes the linker to drop the symbol table [when the command 
>    output is blindly used in a makefile]. Not nice while debugging!
> 3) why list /usr/local/lib?

> While not a show stopper, can this be fixed in future releases? 
> Thanks.

1.
This is from ExtUtils::Embed::ldopts:
    my $libperl;
    if ($^O eq 'MSWin32') {
        $libperl = $Config{libperl};
    }
    else {
        $libperl = (grep(/^-l\w*perl\w*$/, @link_args))[0] || "-lperl";
    }

It seems that it doesn't work as it should.
I have patched this for now (attached), I'll look to get this in perl
included if it is still broken in bleadperl.

$ perl  -MExtUtils::Embed -e ldopts
 -s  -s -L/usr/local/lib /usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl5_6_1 -lcrypt

Alternative: create a symlink libperl.a -> libperl5_6_1.a

2. Cygwin Perl is built with -s flag, that strips the binaries, if you want
to have symbols in your module you will need symbols in perl, that means
you will have to rebuild perl yourself with symbols, that is: change nothing
at the source and do: ./Configure -Doptimize='-g' which turns on DEBUGGING.
(Note that Cygwin Perl is also build with '-Dmultiplicity').

I really don'y know why the '-s' flag is passed twice here.
Probable because there are several flags involved (ldflags & ccdlflags)

3. I didn't add /usr/local/lib to the linkline, it is done somewhere automagically.

You may change the values in Config.pm.
ldflags=''
then you get:
$ perl  -MExtUtils::Embed -e ldopts
 -s  /usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl5_6_1 -lcrypt

ccdlflags=''
$ perl  -MExtUtils::Embed -e ldopts
  /usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl5_6_1 -lcrypt

but as stated above I don't know if it is sufficient, maybe you need to
rebuild perl to get the symbols.

Ciao,

Gerrit P. Haase                                   mailto:gp@familiehaase.de
-- 
=^..^=

[-- Attachment #2: Embed.patch --]
[-- Type: application/octet-stream, Size: 877 bytes --]

--- perl5/5.6.1/ExtUtils/Embed.pm.orig	Sun Dec  9 15:23:22 2001
+++ perl5/5.6.1/ExtUtils/Embed.pm	Sun Dec  9 15:22:41 2001
@@ -207,9 +207,13 @@
     if ($^O eq 'MSWin32') {
 	$libperl = $Config{libperl};
     }
+    elsif ($^O eq 'cygwin') {
+	$libperl = "-lperl5_6_1";     
+    }
     else {
 	$libperl = (grep(/^-l\w*perl\w*$/, @link_args))[0] || "-lperl";
     }
+
 
     my $lpath = File::Spec->catdir($Config{archlibexp}, 'CORE');
     $lpath = qq["$lpath"] if $^O eq 'MSWin32';
--- perl5/5.6.1/cygwin-multi/ExtUtils/Embed.pm.orig	Sun Dec  9 15:23:10 2001
+++ perl5/5.6.1/cygwin-multi/ExtUtils/Embed.pm	Sun Dec  9 15:22:47 2001
@@ -207,6 +207,9 @@
     if ($^O eq 'MSWin32') {
 	$libperl = $Config{libperl};
     }
+    elsif ($^O eq 'cygwin') {
+	$libperl = "-lperl5_6_1";     
+    }
     else {
 	$libperl = (grep(/^-l\w*perl\w*$/, @link_args))[0] || "-lperl";
     }

[-- Attachment #3: Type: text/plain, Size: 214 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

      reply	other threads:[~2001-12-09 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-08 13:55 Pierre A. Humblet
2001-12-09  7:27 ` Gerrit P. Haase @ cygwin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18164870789.20011209162856@familiehaase.de \
    --to=gp@familiehaase.de \
    --cc=Pierre.Humblet@ieee.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).