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 To: cygwin AT cygwin DOT com Subject: libtool-devel proposal From: Andreas Ames Date: 28 Aug 2002 13:51:42 +0200 Message-ID: Lines: 45 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi all, thanks to Charles Wilson and , I think, Robert Collins for this package and their patches. I used it to build glib on mingw. I had one minor issue with it; as I said I used mingw, so I'm not sure this relates to mingw, if not, please just ignore me: If I use the --export-symbols commandline switch with libtool (with an appropriate .def file), the archive_expsym_cmds command is used. In /usr/autotool/devel/bin/libtool it reads archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}-retain-symbols-file \$wl\$export_symbols \${wl}--out-implib,\$lib". Although the link completes it exports all global symbols in the generated dll. This may not be what the user intended. The cause is that the --retain-symbols-file option of ld seems not to be intended to specify a list of symbols to be exported (and seems to have another syntax than .def files anyway, i.e. just a plain list of the symbols, one at a line, without EXPORTS and such). Rather the ld-docu states, within the explanation of -shared, if I remember correctly, that you can specify a usual .def file (which seems to must be called xyz.def, otherwise ld complaints) as the first object. The symbols within it are then resolved by the remaining, usual objects/libs. Another thing is that some packages (such as glib) seem to expect the import library to be named as libname.dll.a. So my proposal, which works for me, is to replace the above line with archive_expsym_cmds="\$CC -shared \$export_symbols \$libobjs \$deplibs \$compiler_flags -o \$output_objdir/\$soname \${wl}-retain-symbols-file \$wl\$export_symbols \${wl}--out-implib,\$output_objdir/\$libname.dll.a". I think, the --remain-symbols-file option could be ommitted all together but I didn't check. Additionally the resulting dll also exports, besides the symbols in the .def file, all symbols marked with the declspec crap, which is very nice. cheers, andreas -- 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/