This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libtool-devel proposal

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

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.



Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]