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: environ: fix link error on 64-bit Cygwin


On Jan 31 07:52, Eric Blake wrote:
> Forwarding from the gnulib list; is this something we should fix in
> cygwin proper?

Why does anybody remove the -Wl,--disable-auto-import flag?  What for?
The idea was to never use this flag on Cygwin and to get rid of the
dllimport/dllexport nonsense...

> On 01/31/2018 04:42 AM, Bruno Haible wrote:
> > On 64-bit Cygwin, a libunistring build fails like this:
> > [...]
> > libtool: link: x86_64-pc-cygwin-gcc -g -O2 -Wl,--disable-auto-import -o .libs/test-environ.exe test-environ.o  -L/usr/local/cygwin64/lib libtests.a ../lib/.libs/libunistring.dll.a -liconv libtests.a -L/usr/local/cygwin64/lib
> > test-environ.o:test-environ.c:(.rdata$.refptr.environ[.refptr.environ]+0x0): undefined reference to `environ'
> > collect2: error: ld returned 1 exit status
> > 
> > This fixes it.
> > [...]
> > +_GL_EXTERN_C __declspec(dllimport) char **environ;

But, other than that, an equivalent newlib patch would be ok.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: signature.asc
Description: PGP signature


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