mainGNU Libtool - Support: sr #107959, Libtool generates invalid .def...


sr #107959: Libtool generates invalid .def files

Submitter:  Erik van Pienbroek <epienbro>
Submitted:  Sun 19 Feb 2012 10:45:44 PM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  Microsoft Windows
* Mandatory Fields

Add a New Comment Rich Markup

Fri 02 May 2014 02:31:14 PM UTC, comment #1: 

Fixed a while ago by commit a5a4944fbb2bbd20adb12b.


Peter Rosin <pekberg>
Group Member
Sun 19 Feb 2012 10:45:44 PM UTC, original submission:  

This is a follow-up from

In the latest binutils snapshots, a change was applied which makes the processing of .def files for the win32/win64 targets more strict. According to the MSDN documentation at all .def files must start with 'LIBRARY mylib.dll' followed by 'EXPORTS'.

Let's take this simple .def file for example:

LIBRARY mylib.dll

If this .def file is processed by libtool then it automatically performs this set of commands:

libtool: link: if test "x`/bin/sed 1q .libs/libcairo.def`" = xEXPORTS; then cp
.libs/libcairo.def .libs/libcairo-2.dll.def; else echo EXPORTS >
.libs/libcairo-2.dll.def; cat .libs/libcairo.def >> .libs/libcairo-2.dll.def;

This set of commands check if the first line of the .def file contains 'EXPORTS' and if this isn't the case, it automatically adds it.

Given the example .def file I mentioned earlier this will end up in:

LIBRARY mylib.dll

This obviously is incorrect and can't be processed by binutils.

Can libtool be changed so that it can process these kind of situations more properly?

Erik van Pienbroek <epienbro>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #26446:  01-def-syntax.patch added by None (467B - application/octet-stream - Patch for 1.10)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pekberg (Posted a comment)
  • -email is unavailable- added by epienbro (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-05-02 pekberg StatusNone Done
    2012-08-30 None Attached File- Added 01-def-syntax.patch, #26446

    Back to the top

    Powered by Savane 3.12