delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/29/17:58:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Date: Wed, 29 Jan 2003 22:54:00 +0000
From: Danny Smith <dannysmith AT clear DOT net DOT nz>
Subject: Re: progress on libstdc++.dll
To: Cygwin <cygwin AT cygwin DOT com>
Cc: Paul Kienzle <pkienzle AT jazz DOT ncnr DOT nist DOT gov>
Reply-to: Danny Smith <dannysmith AT users DOT sourceforge DOT net>
Message-id: <001701c2c7e9$51733f90$f790a7cb@DANNY>
MIME-version: 1.0
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Priority: 3
X-MSMail-priority: Normal

Paul Kienzle  wrote
> I have been advised from a couple of sources that the dlltool approach
to
> building libstdc++.dll will not work.  So I then tried the following:
>
>


gcc -shared -Wl,-whole-archive,--export-all-symbols,--enable-auto-image-
base \
>  /usr/lib/libstdc++.a -Wl,-no-whole-archive -o libstdc++.dll
>
>   gcc -o
str.exe -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc str.o \
>  libstdc++.dll
>
> but the linker complained about many missing symbols.  Using nm, they
seem
> to be in libstdc++.dll.  Any suggestions what I'm doing wrong?
>

The advice was not completly correck:(

If using g++ -shared to build libstdc++.dll, you need to explode the
static archive into component modules and build the dll from them.  The
reason:  libstdc++.a is a system lib that is ignored when using
(implicitly or explicitly) --export-all

Also the  reason to use g++ -shared rather than dlltool is if you want
to use an import lib rather than direct linking against dll  You will
have to tell the linker that you want an import lib,
with -Wl,--out-implib,libstdc++.dll.a.  The import lib produced by
dlltool does not have auto-import symbols. The import lib produced by
gcc -shared does.  The "implied" import lib generated on-the-fly when
linking directly against the dll is like the one produced by
gcc -shared.

Danny

> Thanks in advance,
>
> Paul Kienzle
> pkienzle AT nist DOT gov
>
>


--
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/

- Raw text -


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