As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format.
As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format.
Bcc64 uses LLVM chain and therefore produces ELF .o files.
Does that mean that I can't use bcc64 to create an object file that is linkable with dcc64? Or am I missing something (maybe bcc64 can produce OMF and I only don't missed the switch to turn that on)?
Bcc64 uses LLVM chain and therefore produces ELF .o files.
Does that mean that I can't use bcc64 to create an object file that is linkable with dcc64? Or am I missing something (maybe bcc64 can produce OMF and I only don't missed the switch to turn that on)?
Guess not: http://rvelthuis.de/articles/articles-cobjs.html#win64
ReplyDeleteMaybe David Millington knows more?
Primož Gabrijelčič Maybe the Object file converter from http://agner.org/optimize/ might help you?
Thanks for confirming my suspicions.
ReplyDeleteStefan Glienke I'm not having any actual problems :) Just researching the topic.
ReplyDeleteNo, can't do OMF, only COFF. I've only ever had success with cl. No dice with gcc, got close, but no dice. Not tried clang. Nor the Intel compiler 'cos of the $$$$$
ReplyDelete/sub
ReplyDeleteI usually use mingw or visual studio for generating x64 .o files for Delphi and FPC
ReplyDeleteYep, cl.exe for Delphi objs.
ReplyDeleteI use LLVM Clang for x64 obj, visual c++ 64 obj are not linkable with DCC64 as far I have tested.
ReplyDeleteRoberto Della Pasqua wrong. I've been linking cl compiled objects to my 64 bit programs for over 5 years.
ReplyDeleteDavid Heffernan ah ok, last time I have tried some RTL dependancies was mandatory to the MSVC runtime
ReplyDeleteDavid Heffernan Which one can't do OMF?
ReplyDeleteRoberto Della Pasqua msvcrt dependencies can be fixed by linking to msvcrt.dll. Delphi's unit System.Win.Crtl does that for you.
ReplyDeletedcc32 does coff and omf, dcc64 only coff
ReplyDeleteOne of the difficulties with linking objects is the handling of exceptions. The 64 bit exception model is table based, in contrast to the stack based 32 bit model.
ReplyDeleteI don't think that the exception tables are written correctly for code linked in objects. If exceptions are raised then this can lead to abnormal process termination. Process just disappears. Poof!
One common way that this happens is floating point exceptions that are by default unmasked by the Delphi RTL. I have found it necessary to mask them when calling into any linked object code to avoid exceptions being raised.
And compiling with cl can be a bit of a game. It's stack checking options need to be disabled. And there are a few other key switches that help. And then there's the forward declaration trick to help the one pass compiler cope with C objects that are expected to be linked in a separate step.
Anyway, it can be quite a challenge at times, but I've yet to find a plain self contained C library that has defeated me!
David Heffernan Thanks for the info!
ReplyDeleteJust last night, I was considering making a blog post about "how Johnny can't link", and was going to lay blame on visual programming.
ReplyDeleteSomehow, I find it hard to accept I may have finally been proven wrong (now twice) in a programming forum.