Anyone have sucess converting MSVC 2010 COFF libs to OMF

Ettienne Gilbert ettienne.gilbert at gmail.com
Thu Apr 10 05:28:36 PDT 2014


On Tuesday, 8 April 2014 at 17:23:14 UTC, Byron wrote:
> I have several libs compiled in vs2010 that I need to convert 
> to omf.
>
> With the same setup I have this linked in win64, just want to 
> get win32.
>
> I have tried coff2omf but it fails with:
>> coff2omf leveldb.lib
> COFF2OMF: Converting 
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib'
> COFF2OMF: Ignoring unknown directive 'vc100-mt-1_56.lib" 
> /DEFAULTLIB' in
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib[.drectve]'
> COFF2OMF: Ignoring unknown directive 'vc100-mt-1_56.lib" 
> /DEFAULTLIB' in
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib[.drectve]'
> COFF2OMF: Ignoring unknown directive 'vc100-mt-1_56.lib" 
> /DEFAULTLIB' in
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib[.drectve]'
> COFF2OMF: Ignoring unknown directive 'vc100-mt-1_56.lib" 
> /DEFAULTLIB' in
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib[.drectve]'
> COFF2OMF: Ignoring unknown directive 'vc100-mt-1_56.lib" 
> /DEFAULTLIB' in
> 'd:\projects\leveldb\bin\release\tmp\leveldb.lib[.drectve]'
>
> This lib does require some boost libs I have compiled, these 
> libs do end
> with vc100-mt-1_56.lib.  The look like 
> libboost_chrono-vc100-mt-1_.56.lib
> So maybe the dash messing up coff2omf.
>
> the digitalmars site says you need to convert the coff format 
> via link /
> lib /convert [lib].  Is this only for really old version of vs?
>> link /lib /convert leveldb.lib
> Microsoft (R) Library Manager Version 10.00.30319.01
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> LINK : warning LNK4044: unrecognized option '/convert'; ignored
>
>
> I have also tried objconv:
>> objconv -fomf leveldb.lib leveldb_omf.lib
>
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> ...
> Warning 1060: Different alignments specified for same segment, 
> .data.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> ...
> Warning 1060: Different alignments specified for same segment, 
> .data.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> ....
> Warning 1060
> Input library: leveldb.lib, Format: COFF32, Output: 
> leveldb_omf.lib,
> Format: OMF32
> : Different alignments specified for same segment, .rdata. 
> Using highest
> alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Warning 1060: Different alignments specified for same segment, 
> .rdata.
> Using highest alignment
> Supressing further warning messages
> Error 2304: Word-size index exceeds 65535
> Error 2304: Word-size index exceeds 65535
> ....
> Supressing further warning messages
>
> objconv seems to work on the boost lib files but not leveldb.lib
>
> I tired messing tring to get dmc to compile boost, but there 
> are tons of
> errors, to many to make me want to not go that path.
>
>
> So does anyone have a fool prof way of converting coff to omf 
> libs.  I
> feel like this use to be easy..
>
> Thanks,
> -Byron

You can also look at http://www.agner.org/optimize/#objconv.

I used it quite a long time ago to convert OMF libs to COFF (the 
opposite of what you need), and only for Win32.

But it looks reasonably up-to-date and it claims to support both 
Win32/Win64.

Rgds,
Ettienne


More information about the Digitalmars-d-learn mailing list