Subject: Valid DLL def file mangled by libtool

From: Martin Doucha <[email-masked]>
Date: Fri, 11 Jan 2013 12:34:26 +0100

Hi,
I'd like to report a bug in libtool 2.4 (including the latest git 
revision) which mangles valid DLL def files under MinGW and makes the 
linker barf.

The bug is caused by incorect check for "EXPORTS" keyword in the def 
file which libtool does this way:
if test "x`$SED 1q $export_symbols`" != xEXPORTS; then ... [add another 
"EXPORTS" line at the beginning of file]

This test is incorrect because the "EXPORTS" keyword does not have to 
appear on the very first line. You should replace the test with this:
if test "x`$GREP EXPORTS $export_symbols`" != xEXPORTS; then ...

Also note that this test appears on several places throughout libtool 
sources (both as "xEXPORTS" and just "EXPORTS") so you need to fix all 
of them.

Regards,
Martin Doucha