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

 
 

sr #107959: Libtool generates invalid .def files

Submitted by:  Erik van Pienbroek <epienbro>
Submitted on:  Sun 19 Feb 2012 10:45:44 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: Done
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed a while ago by commit a5a4944fbb2bbd20adb12b.

Cheers,
Peter

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

This is a follow-up from http://sourceware.org/bugzilla/show_bug.cgi?id=13710

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 http://msdn.microsoft.com/en-us/library/d91k01sh%28v=vs.80%29.aspx all .def files must start with 'LIBRARY mylib.dll' followed by 'EXPORTS'.

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

LIBRARY mylib.dll
EXPORTS
my_func

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;
fi

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:

EXPORTS
LIBRARY mylib.dll
EXPORTS
my_func

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 File(s):
   
   
Comment:
   

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
  • -unavailable- added by pekberg (Posted a comment)
  • -unavailable- added by epienbro (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 02 May 2014 02:31:14 PM UTCpekbergStatusNone=>Done
    Thu 30 Aug 2012 07:52:10 AM UTCNoneAttached File-=>Added 01-def-syntax.patch, #26446

    Back to the top


    Powered by Savane 3.1-cleanup