X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0	tests=AWL,BAYES_00,TW_TX,TW_YG,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4F6C5B92.2030802@lysator.liu.se>
Date: Fri, 23 Mar 2012 12:16:34 +0100
From: Peter Rosin <peda@lysator.liu.se>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: libtool issue on shared lib
References: <4F6C5908.3090503@gmail.com>
In-Reply-To: <4F6C5908.3090503@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

marco atzeri skrev 2012-03-23 12:05:
> I am trying to adapt socketxx to cygwin
> (http://www.linuxhacker.at/socketxx)
> 
> In addition to a lot of other problems, I have a puzzling libtool issue
> 
> 
> make[2]: Entering directory `/pub/devel/gdcm/socket++-1.12.13_build/socket++'
> /bin/sh ../libtool --tag=CXX    --mode=link g++   -Wall -g -O2 -version-info 1:2:0  -o libsocket++.la -rpath /usr/local/lib sockstream.lo sockinet.lo sockunix.lo  pipestream.lo fork.lo protocol.lo echo.lo smtp.lo ftp.lo  sig.lo
> libtool: link: warning: undefined symbols not allowed in i686-pc-cygwin shared libraries
> 
> but
> 
> g++   -Wall -g -O2 -shared  -o cygsocket++-0.dll -Wl,--out-implib=libsocket++.dll.a sockstream.o sockinet.o sockunix.o pipestream.o fork.o protocol.o echo.o smtp.o ftp.o  sig.o
> Creating library file: libsocket++.dll.a
> 
> $ cygcheck ./cygsocket++-0.dll
> E:\cygwin\pub\devel\gdcm\socket++-1.12.13_build\socket++\cygsocket++-0.dll
>   E:\cygwin\bin\cygwin1.dll
> [cut]
>   E:\cygwin\bin\cyggcc_s-1.dll
>   E:\cygwin\bin\cygstdc++-6.dll
> 
> 
> So where is the undefined symbol ??

Libtool want's the package to declare that it does not have any
undefined symbols.  But if this package does have undefined
symbols in it, then it can't be build (easily) on Cygwin.

> I am already using "autoreconf -f -i" and the libtool
> seems equivalent to what is working for any other package
> 
> adding LT_INIT([dlopen win32-dll shared])
> to configure.in had no effect
> 
> and the  Makefile.am is very basic
> ---------------------------------------------
> INCLUDES = -I$(top_srcdir) -I$(top_builddir)
> 
> lib_LTLIBRARIES = libsocket++.la
> libsocket___la_SOURCES = sockstream.cpp sockstream.h \
>         sockinet.cpp sockinet.h \
>         sockunix.cpp sockunix.h\
>         pipestream.cpp pipestream.h \
>         fork.cpp fork.h \
>         protocol.cpp protocol.h \
>         echo.cpp echo.h \
>         smtp.cpp smtp.h \
>         ftp.cpp ftp.h \
>         sig.cpp sig.h
> 
> libsocketincludedir=$(includedir)/socket++
> libsocketinclude_HEADERS = \
>         sockstream.h \
>         sockinet.h \
>         sockunix.h\
>         pipestream.h \
>         fork.h \
>         protocol.h \
>         echo.h \
>         smtp.h \
>         ftp.h \
>         sig.h
> libsocket___la_LDFLAGS = -version-info @LIBSOCKET_SO_VERSION@
> -------------------------------------------------
> 
> Any idea about what I should look for ?

You can try to feed -no-undefined to libtool when it links, telling
libtool that the library does not have any undefined symbols,
libtool will then at least try to create a DLL.  I would add it
to libsocket___la_LDFLAGS.

Cheers,
Peter


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

