| Thread overview | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 08, 2014 Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
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 | ||||
April 09, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | coff2omf is probably opensource, so you may try to fix it. | |||
April 09, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | Also, what is the point in converting coff to omf, what do you plan to do with the result? | |||
April 09, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Wed, 09 Apr 2014 16:47:12 +0000, Kagamin wrote:
> Also, what is the point in converting coff to omf, what do you plan to do with the result?
Link a c library with D of course
| |||
April 09, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | On Wednesday, 9 April 2014 at 17:45:40 UTC, Byron wrote:
> On Wed, 09 Apr 2014 16:47:12 +0000, Kagamin wrote:
>
>> Also, what is the point in converting coff to omf, what do you plan to
>> do with the result?
>
> Link a c library with D of course
Yes,the work should be done.
Let other languages's tools work for D.
Let other languages's LIB work for D.
Let other languages's DLL work for D.
| |||
April 10, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | "Byron" wrote in message news:li1ba2$5lc$1@digitalmars.com... > So does anyone have a fool prof way of converting coff to omf libs. I > feel like this use to be easy.. In general, this won't work. The only thing that is straightforward and reliable is converting coff import libraries to omf import libraries. Converting the file formats over is possible, but then you usually hit problems with differences between microsoft's and digital mars' c libraries. If possible, building the lib as a dll might be a workaround. | |||
April 10, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | On Wednesday, 9 April 2014 at 17:45:40 UTC, Byron wrote:
> Link a c library with D of course
That won't work. You would need to link with c runtime. Try ldc - it compiles to coff and supports linking with msvc runtime.
| |||
April 10, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | 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 | |||
April 10, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Daniel Murphy | On Thu, 10 Apr 2014 14:10:37 +1000, Daniel Murphy wrote:
> "Byron" wrote in message news:li1ba2$5lc$1@digitalmars.com...
>
>> So does anyone have a fool prof way of converting coff to omf libs. I feel like this use to be easy..
>
> In general, this won't work. The only thing that is straightforward and reliable is converting coff import libraries to omf import libraries.
>
> Converting the file formats over is possible, but then you usually hit problems with differences between microsoft's and digital mars' c libraries.
>
> If possible, building the lib as a dll might be a workaround.
Thats what I ended up doing. I updates leveldb on code.dlang.org. Now builds with 32 and 64 bit wondows (includes dll and libs).
| |||
April 10, 2014 Re: Anyone have sucess converting MSVC 2010 COFF libs to OMF | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Byron | 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. Try the coffimplib tool: http://forum.dlang.org/thread/dpaolp$1oek$1@digitaldaemon.com | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply