This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [perl] Portably linking to libstdc++


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]