This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: stunnel build chokes on -no-undefined
- From: Peter Rosin <peda at lysator dot liu dot se>
- To: cygwin-apps at cygwin dot com
- Date: Tue, 26 May 2015 17:37:47 +0200
- Subject: Re: stunnel build chokes on -no-undefined
- Authentication-results: sourceware.org; auth=none
- References: <oq19mapuld6fnjh1dsk4f1dr44tvt4sqkg at 4ax dot com>
On 2015-05-26 16:55, Andrew Schulman wrote:
> In stunnel 5.17, the build of libstunnel.la fails with "can't build shared
> library unless -no-undefined is specified":
>
>
> /bin/sh ../libtool --tag=CC --mode=link gcc -Wl,-no-undefined
> -fdebug-prefix-map=/home/andrex/dev/cygwin/stunnel/stunnel-5.17-1.x86_64/build=/usr/src/debug/stunnel-5.17-1
> -fdebug-prefix-map=/home/andrex/dev/cygwin/stunnel/stunnel-5.17-1.x86_64/src/stunnel-5.17=/usr/src/debug/stunnel-5.17-1
> -Wall -Wextra -Wpedantic -Wformat=2 -Wconversion -Wno-long-long
> -Wno-deprecated-declarations -fstack-protector -fPIE -D_FORTIFY_SOURCE=2
> -avoid-version -fPIE -pie -o libstunnel.la -rpath /usr/lib env.lo -lz -lwrap
> libtool: error: can't build x86_64-unknown-cygwin shared library unless
> -no-undefined is specified
> Makefile:464: recipe for target 'libstunnel.la' failed
>
>
> Of course, the libtool command does include -Wl,-no-undefined. I don't know
> much about this, but I do seem to recall that the linker flags should come at
> the end, or something like that.
>
> Could anyone please suggest a solution? I'm attaching stunnel.cygport, and
> src/Makefile.am from which the above command was generated. Please let me know
> if there are other files I should provide.
There is the GNU ld flag --no-undefined (two dashes), and there's the libtool
flag -no-undefined (one dash). They are not the same, and spelling out
-no-undefined does not make libtool feed --no-undefined to the linker.
Nor does libtool look for -Wl,--no-undefined. -Wl,-no-undefined seems to be
some confused hybrid.
The libtool command should almost always include -no-undefined, so you
should probably add that.
Cheers,
Peter