The Return of Revenge of Son of the Speclib Strikes Back :)

Dave Korn
Sat Apr 18 13:43:00 GMT 2009

[ Let's try again in the right place, shall we? ]

  The new speclibs libraries work great, but there's one piece of
unanticipated fallout: the libtool func_win32_libid() tests can no longer
identify them as import libraries.  Which is fair enough, since they aren't,
they are now indirect references to import libraries; but we want it to treat
them the same anyway.

  Here's one possible approach: I add a dummy member to the archives just in
order to trip libtool's "nm | grep ' I '" test.  I repurposed the
as-far-as-I-can-tell currently unused "--static" option to speclib to mean
"bodily shove this object into the generated library".

  As usual, I don't speak perl good, which is why I add $static to the
%extract hash before invoking ar and remove it again afterward.  If I just
unconditionally tagged ", $static" on the end of the invocation, it would fail
if no --static option was supplied, giving ar an empty string as an argv
member, and I didn't know how to conditionally add it as an argument only when
defined, so it was either this or cut-and-paste two versions of the
invocation, one mentioning $static and the other not, with an if defined
$static to choose between them; I would welcome being shown a better way to do
this if there is one.

  I'm currently putting the attached through a full build / install/ rebuild
DLL, binutils and gcc cycle, but it already fixed the failure to build libjava
as a DLL that I've been getting on GCC HEAD with the new speclib libraries.

  What do you think?  Reasonable approach?  Reasonable implementation?
Problems with either?  Ok for head?


	* magicimportsym.s:  New file.
	* (speclib):  Add --static option to invocation
	naming magicimportsym.o
	(${CURDIR}/libc.a):  Add magicimportsym.o to dependencies.
	(${CURDIR}/libm.a):  Likewise.
	(libpthread.a):  Likewise.
	(libutil.a):  Likewise.
	(libdl.a):  Likewise.
	(libresolv.a):  Likewise.
	* speclib:  Repurpose --static option to add an archive member


-------------- next part --------------
A non-text attachment was scrubbed...
Name: magic-import-symbol-patch.diff
Type: text/x-c
Size: 3533 bytes
Desc: not available
URL: <>

More information about the Cygwin-patches mailing list