Bug 64056 - building x264 dlltool / gendef - the def file created contained duplicate functions ending with ".skip_prologue"
Summary: building x264 dlltool / gendef - the def file created contained duplicate fun...
Status: NEW
Alias: None
Product: GStreamer SDK
Classification: Unclassified
Component: Windows SDK Distribution (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-29 17:56 UTC by Shimon Doodkin
Modified: 2013-04-30 09:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Shimon Doodkin 2013-04-29 17:56:50 UTC
on mingw it produced a def file with duplicate functions with .skip_prologue endings witch chould not made to lib file

in gstreamer-sdk\cerbero\cerbero\ide\vs\genlib.py

i made a fix for that simply deleted the lines with sed and dlltool worked as expected:

after line

 implib = '%s.lib' % libname[3:]

i have added:

  #fix x264 lib error
         shell.call('sed \'/skip_prologue$/d\' %s>%s_2' % (defname, defname), outputdir)
         shell.call('mv -f %s_2 %s' % (defname, defname), outputdir)

ps:
maybe could be implemented in a different way maybe with python.
maybe with perl -ie
sed -i some how creaded a temp file with permission error
did not investigated it, just quickly fixed that.

---

after change the file is:


import os

from cerbero.utils import shell


class GenLib(object):
    '''
    Generates an import library that can be used in Visual Studio from a DLL,
    using 'gendef' to create a .def file and than libtool to create the import
    library
    '''

    DLLTOOL_TPL = '$DLLTOOL -d %s -l %s -D %s'

    def create(self, dllpath, outputdir=None):
        bindir, dllname = os.path.split(dllpath)
        if outputdir is None:
            outputdir = bindir

        # Create the .def file
        shell.call('gendef %s' % dllpath, outputdir)
        if '-' in dllname:
            # libfoo-1.0-0.dll -> libfoo-1.0
            libname = dllname.rsplit('-', 1)[0]
        else:
            # libfoo.dll
            libname = dllname.rsplit('.', 1)[0]

        defname = dllname.replace('.dll', '.def')
        implib = '%s.lib' % libname[3:]
        
        #fix x264 lib error
        shell.call('sed \'/skip_prologue$/d\' %s>%s_2' % (defname, defname), outputdir)
        shell.call('mv -f %s_2 %s' % (defname, defname), outputdir)     
                
        # Create the import library
        shell.call(self.DLLTOOL_TPL % (defname, implib, dllname), outputdir)
        return os.path.join(outputdir, implib)
Comment 1 Andoni Morales Alastruey 2013-04-30 09:46:40 UTC
Hi Shimon,

This should be fixed in x264's recipe, sub-classing the post-install step. There is also a util in cerbero.utils.shell to replace strings in files that you should use instead of sed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.