3

I am searching for a list of supported object file formats for each delphi version. Object files should be linked with something like: {$L lib/object.o}.

The Reason for this is a linker error in Delphi7 for a project i maintain. The error does not occur in compilers >XE3. I have only XE3 and above to test.

Has someone maintained a list or knows a reference to one where i can find informations about the supported format and/or changes with newer versions, maybe also problems with object files, etc?

I would like to help a user of the project with this problem (lz4-delphi issue).

Hugie
  • 455
  • 5
  • 17

2 Answers2

3

The change came with XE2 which added support for the COFF object format. Prior versions only supported OMF objects.

The change to add support for COFF was driven by the new 64 bit compiler, introduced in XE2. Embarcadero did not have a 64 bit C++ compiler at that time and so needed to link objects produced by another compiler. They chose to use the MS compiler which emits COFF objects.

Allen Bauer's answer to a question that I asked contains more detail.

In practical terms this means that for Delphi 7 you will need to compile the source code with bcc32. Or compile the C code with some other compiler but then link to a DLL.

Community
  • 1
  • 1
David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Thx, i hope this information helps the D7 users of my project. I linked him to this. – Hugie Feb 20 '15 at 10:30
  • Have you any experience with object file converters like: http://agner.org/optimize/#objconv ? Should i suggest this? – Hugie Feb 20 '15 at 10:40
  • No. Suggest recompiling with bcc32. That is if you want to suggest a way forward that has any prospect of success. It's also fairly miraculous that anyone managed to get a mingw object to link. I never succeeded, but perhaps that was because I was linking to 64 bit. My own code base uses bcc32 for 32 bit and msvc for 64 bit. – David Heffernan Feb 20 '15 at 10:40
1

For future reference, Delphi 10.1 Berlin and 10.2 Tokyo both support ELF64 format, and also COFF.

Alexandre M
  • 1,146
  • 12
  • 23