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 Message-ID: <3D08744C.1030901@scytek.de> Date: Thu, 13 Jun 2002 12:30:36 +0200 From: Volker Quetschke User-Agent: Mozilla/5.0 (Windows; U; Win98; de-DE; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: de-DE MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Building dlls with cygwin Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/