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)?

Comments

  1. Guess not: http://rvelthuis.de/articles/articles-cobjs.html#win64

    Maybe David Millington knows more?

    Primož Gabrijelčič Maybe the Object file converter from http://agner.org/optimize/ might help you?

    ReplyDelete
  2. Stefan Glienke I'm not having any actual problems :) Just researching the topic.

    ReplyDelete
  3. No, 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
  4. I usually use mingw or visual studio for generating x64 .o files for Delphi and FPC

    ReplyDelete
  5. I use LLVM Clang for x64 obj, visual c++ 64 obj are not linkable with DCC64 as far I have tested.

    ReplyDelete
  6. Roberto Della Pasqua wrong. I've been linking cl compiled objects to my 64 bit programs for over 5 years.

    ReplyDelete
  7. David Heffernan ah ok, last time I have tried some RTL dependancies was mandatory to the MSVC runtime

    ReplyDelete
  8. Roberto Della Pasqua msvcrt dependencies can be fixed by linking to msvcrt.dll. Delphi's unit System.Win.Crtl does that for you.

    ReplyDelete
  9. dcc32 does coff and omf, dcc64 only coff

    ReplyDelete
  10. One 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.

    I 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!

    ReplyDelete
  11. Just last night, I was considering making a blog post about "how Johnny can't link", and was going to lay blame on visual programming.

    Somehow, I find it hard to accept I may have finally been proven wrong (now twice) in a programming forum.

    ReplyDelete

Post a Comment