Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: To: cygwin AT cygwin DOT com CC: Subject: Re:Building dlls with cygwin Date: Thu, 13 Jun 2002 11:34:55 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20020613113455.LBUH4626.mta02-svc.ntlworld.com@[10.137.100.62]> Volker Original Message: Hi! I wanted to implement some loadable extensions for gnupg. Cygwin gpg can already use loadable modules with the --load-extension swich, you can test this with the dll found in this archive: http://disastry.dhs.org/pgp/gpg/ideadll.zip The source is here: http://disastry.dhs.org/pgp/gpg/ideadllsrc.zip. This dll is compiled with MSVC, I thought I can compile it with gcc and followed the instructions in Chuck's dllhelpers (The makefile in C) and used the following script: --- # # Building DLLs with Cygwin for gnupg # CC=gcc DEBUG=" -g -Wall" CFLAGS=$DEBUG CPPFLAGS="-I." DLL_NAME="idea.dll" DLL_EXP_LIB="libidea.dll.a" DLL_EXP_DEF="libidea.def" DLL_LDFLAGS="-Wl,--export-all-symbols" ## any extra libraries that your DLL may depend on. ## build in gnupg-1.0.7/cipher DLL_LDLIBS="../cipher/libcipher.a ../util/libutil.a -lintl" ## Building .o $CC -c $CPPFLAGS $CFLAGS -o idea.o idea.c ## Making DLL gcc -shared -Wl,--out-implib=$DLL_EXP_LIB -o $DLL_NAME idea.o $DLL_LDLIBS $DLL_LDFLAGS ## making exec # is already made! --- The dll build without problem, but when I try to use it I get a dlsym: Win32 error 127. OK, I didn't build gpg with the import library (but it works with the MSVC build dll), but this is different from the dllhelpers example. Gpg uses dlopen() to load the module and then the dlsym() fails with the cygwin build dll. (Yes, I know the msvc sources contain a "g10_log.c", I tried to build the dll without $DLL_LDLIBS but with g10_log.o. You get a dll, but it also doesn't work.) Did I miss something? (Sure, what?) Any help is apreciated, I'd like to get this feature working in gnupg. Bye Volker -- 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/