delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/20/09:08:24

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <48FC8298.9BC00943@dessent.net>
Date: Mon, 20 Oct 2008 06:07:36 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [perl] Portably linking to libstdc++
References: <586E6C4720134D06B35A67112D3BBBCE AT desktop2> <C9004AE9971E4B7ABBC246E73FC599AF AT desktop2> <48FB462B DOT 4B75336B AT dessent DOT net> <BA6845624D6F4E01AA4E2CCEC494A9E5 AT desktop2> <48FC5562 DOT 1DDA1FAE AT dessent DOT net> <362AEC237F86449F9A0FDD5F0198E068 AT desktop2>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
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

Sisyphus wrote:

> Apparently g++ needs a "-shared" but ld2 doesn't. (I don't understand that.)
> 
> And I don't understand what is achieved by:
> 
> gcc -shared -o
>  Size.dll -Wl,--out-implib=libSize.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import
>  -Wl,--stack,8388608 -Wl,--enable-auto-image-base \
> -s -L/usr/local/lib Size.o  /usr/lib/perl5/5.8/cygwin/CORE/libperl.dll.a
> 
> That command gets run only if LD is ld2 - there doesn't seem to be a
> comparable command if LD is set to either "g++" or "g++ -shared".

/usr/bin/ld2 is a wrapper script that calls /usr/bin/perlld which is
another wrapper script that adds all those extra parameters if it
detects that a library is being linked.  So yet another workaround would
be to edit perlld and change "my $CC = 'gcc'" to g++.

Maybe you should try the current perl 5.10 where all these crufty
wrapper scripts are gone and it should work without any hacks.

Brian

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

- Raw text -


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