digitalmars.D.learn - Anyone have sucess converting MSVC 2010 COFF libs to OMF
- Byron (65/68) Apr 08 2014 I have several libs compiled in vs2010 that I need to convert to omf.
- Kagamin (1/1) Apr 09 2014 coff2omf is probably opensource, so you may try to fix it.
- Kagamin (2/2) Apr 09 2014 Also, what is the point in converting coff to omf, what do you
- Byron (2/4) Apr 09 2014 Link a c library with D of course
- Daniel Murphy (6/8) Apr 09 2014 In general, this won't work. The only thing that is straightforward and...
- Byron (3/16) Apr 10 2014 Thats what I ended up doing. I updates leveldb on code.dlang.org. Now
- Ettienne Gilbert (8/102) Apr 10 2014 You can also look at http://www.agner.org/optimize/#objconv.
- Gary Willoughby (3/5) Apr 10 2014 Try the coffimplib tool:
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.libCOFF2OMF: 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.libMicrosoft (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.libWarning 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
Apr 08 2014
coff2omf is probably opensource, so you may try to fix it.
Apr 09 2014
Also, what is the point in converting coff to omf, what do you plan to do with the result?
Apr 09 2014
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
Apr 09 2014
On Wednesday, 9 April 2014 at 17:45:40 UTC, Byron wrote:On Wed, 09 Apr 2014 16:47:12 +0000, Kagamin wrote: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.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
Apr 09 2014
On Wednesday, 9 April 2014 at 17:45:40 UTC, Byron wrote:Link a c library with D of courseThat won't work. You would need to link with c runtime. Try ldc - it compiles to coff and supports linking with msvc runtime.
Apr 10 2014
"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.
Apr 09 2014
On Thu, 10 Apr 2014 14:10:37 +1000, Daniel Murphy wrote:"Byron" wrote in message news:li1ba2$5lc$1 digitalmars.com...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).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.
Apr 10 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: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, Ettiennecoff2omf leveldb.libCOFF2OMF: 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.libMicrosoft (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.libWarning 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
Apr 10 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.Try the coffimplib tool: http://forum.dlang.org/thread/dpaolp$1oek$1 digitaldaemon.com
Apr 10 2014