Talk:Lazarus Packages
Including Assembler-written Object Files
Maybe, either in the section "Coming from Delphi" or in the FAQ, the following problems could be addressed:
1. Whenever an object file (for example, one written in Assembler and assembled by NASM) is included by {$L myAsmFile}, Delphi would store this file in the .DCU. I am new and may be missing something, but it looks like Lazarus is quite different in this respect. Is it true that there is no mechanism to unite all included files together in the .ppu? Looks like I have to provide all the included .o files separately. In my case, this is a bit annoying, because there are really many of them. In Delphi, I have to distribute roughly 100 .DCU's, for Lazarus it will be 100 .ppu's and thousands of .o's.
2. Unlike Delphi, Lazarus appears to decorate function names in the pascal calling mode. This is a problem, if one wishes to create high-performance functions in Assembler and include them in Lazarus. Including the decorated names in the .ASM file is very difficult, as the decoration contains characters which are illegal in function names for NASM and other assemblers. The only way I found so far was to switch to cdecl calling mode - which has its own drawbacks which one might wish to avoid.
3. Apparently, symbols defined in the .PAS file are not accessible from the included .o (assembled .ASM) files, maybe again due to decoration. If there is a way around this problem, it would be good to mention it.
All these remarks refer to Lazarus 1.6.2 with FPC 3.0.0, Win64.
Best regards, Martin