Jump to content

A.M. Hoornweg

Members
  • Content Count

    482
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by A.M. Hoornweg

  1. Please try to disable "code inlining control" in the compiler settings and see if the problem disappears.
  2. A.M. Hoornweg

    Linker error L902

    Hello all, I have ported a large project (32-bit, 1.4 million LOC) from Delphi 11 to Delphi 12 (enterprise). Performing a "full build" works fine, but a "make" produces linker error L902 every time; now just imagine you're debugging something and have to do a full build all the time. It's simply no fun. I have never had this problem in Delphi 11. Is there any way I can circumvent this problem ?
  3. A.M. Hoornweg

    Linker error L902

    FOUND! The L902 linker error disappears if I set the compiler switch "code inlining control" to OFF! I can reproduce this in several 32-bit programs that had this problem. Kudos to my colleague Ralf Claussen who discovered this by chance.
  4. A.M. Hoornweg

    What new features would you like to see in Delphi 13?

    I want "F2084 Internal Error L902" gone !!!
  5. A.M. Hoornweg

    Reduce exe weight : Link with runtime package

    What are you talking about??? I'm not compressing any EXEs. I'm just preventing that 30-40% of unused stuff gets linked into them (it would be nice if Delphi's linker had such an option). And of course I use highly compressed setups.
  6. A.M. Hoornweg

    Reduce exe weight : Link with runtime package

    I have *always* used installers. Nowadays executable size is not much of an issue anymore, thanks to better networks. But in a not so distant past I had to regularly push software updates to locations that were using T&T Inmarsat Mini-M satellite terminals. Imagine the slowest and most expensive connection imaginable, 2400 bps, costing like 5 euros per minute. I'm glad those days are over.
  7. A.M. Hoornweg

    Reduce exe weight : Link with runtime package

    It adds up in some projects consisting of dozens of dlls and executables. I had to cope with deployment over slow connections paid by data volume until quite recently.
  8. A.M. Hoornweg

    Reduce exe weight : Link with runtime package

    The problem with using UPX is the following. Normally Windows would open an executable file using a "memory mapped file" mechanism instead of bluntly allocating memory and loading the contents. This allows the Windows virtual memory manager to efficiently "page in" sections of the executable as needed (on demand paging), improving performance and minimizing memory use. If the file is compressed using UPX, execution starts in the UPX loader stub which immediately allocates a big block of memory and extracts the executable into that before proceeding with the "real" execution. This simply wastes precious resources.
  9. A.M. Hoornweg

    Reduce exe weight : Link with runtime package

    I have made an application that copies the Delphi RTL/VCL source files into a temporary folder, inserts the text '{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}' in the right places and re-builds the whole lot. The compiled *.dcu files contain a lot less RTTI than before. By linking against this compacted RTL I achieve a size reduction in a 64-bit VCL application from 14 MB to 10.3 MB using Delphi 12. For just a single executable that isn't worthwhile, but I use this in some multi-module projects that consist of a few dozen ActiveX EXE's and DLL'S. There the cumulative size reduction is substantial. Proper testing is hugely important, one has to be sure that the missing RTTI doesn't cause the program to malfunction.
  10. A.M. Hoornweg

    fmxLinux missing?

    I have updated my Delphi 12.1 Enterprise to version 12.2, selecting the Windows, Android and Linux platforms in the installer. But the Linux platform seems to be missing in the IDE and fmxLinux is unavailable in GetIt. Am I missing something?
  11. A.M. Hoornweg

    DLL Load Issue

    In that case it may have to do with the changed FPU flags behavior in Delphi 12. Try doing this right before calling your DLL, does it make a difference? SetFPUMask([exdenormalized, exunderflow, exprecision]); This setting makes the FPU behave like in previous Delphi versions. In other words, a FP division by 0 will generate an exception instead of continuing the code path with a NAN result.
  12. A.M. Hoornweg

    DLL Load Issue

    Please verify if "sizeof (tViewerParams)" gives the same result in all compilers. Also, is the calling convention to the dll function declared identically and clearly in all projects (e.g. "stdcall") ?
  13. A.M. Hoornweg

    DLL Load Issue

    The thing that may bite you here is field alignment. The compiler that created the DLL and the compiler that created the *.exe must use identical settings for field alignment so they expect the members of the record at identical offsets. see https://docwiki.embarcadero.com/RADStudio/Athens/en/Align_fields_(Delphi)
  14. A.M. Hoornweg

    DLL Load Issue

    @StephenM: You write "It ingests a data structure that identifies a report". Please be aware that there are strict limitations about what data types you can safely pass between the exe <--> dll boundary. Can you describe what this data structure looks like?
  15. Hello all, I saw how FreeAndNil is implemented in the RTL using a "CONST [ref]" parameter and then a little "tweak" is used to NIL the variable being referenced. I wondered why the heck the object wasn't simply passed as a VAR parameter in the first place. Until I tried that out and found that it wouldn't compile. Delphi insists that you either pass the exact object type or use a typecast. What I don't understand is the reason why Delphi is so strict here; if a class derives from tObject, it still has all the original stuff in place from its ancestor so you can't really "break" anything by treating it as a tObject, so why is Delphi so strict? It feels counter-intuitive. Type tBase=Class(tObject) procedure test; end; Procedure tBase.Test; begin // end; Procedure MyFreeAndNil(VAR obj: tObject); begin obj.free; obj:=Nil; end; procedure test; var t:tbase; begin t:=tbase.create; MyFreeAndNil(t); end;
  16. A.M. Hoornweg

    Double, default value

    Just declare class procedure MyFormShow(Sender: TObject); STATIC; That way the method does not have a hidden "self" parameter. Having no "self" parameter turns the class method into a regular procedure inside the namespace tTest (it is no longer a "procedure of object"). Static class methods are unable to access any members or methods that require a "self" parameter.
  17. A.M. Hoornweg

    Double, default value

    I for one would find it an advantage if stuff like local pointer variables would default to NIL, it would make the language just a little bit more memory safe.
  18. A.M. Hoornweg

    Double, default value

    As far as I know, when an object is created all its members are filled with zero. And for stack variables, all managed types are filled with zero upon entry of a method. However, wouldn't it actually save CPU time if Delphi simply wiped the local variables area of the stack upon entry of a method (a known fixed number of bytes - a simple REP STOSD will do) instead of determining which local variables are managed types and then wiping those individually?
  19. Hello all, We're a small company, our Delphi developer team works largely remotely and I'm one of the members who actually lives in a different country from the rest of the team. We must frequently release updates of our various software products. Each team member uses Finalbuilder and Signtool to automate the process of compiling, code signing and generating setups. Some of our products consist of dozens of executables and dll's so the automation of the build-and-sign process is a must-have. Our Digicert EV code certificate expires in February 2025. We're now faced with the problem that certificate providers seem to expect you to have the certificate on a USB device which is kinda unpractical if developers work remotely from different countries. We need common access to the certificate and we need to be able to automate the signing process. I'd very much like to hear from other developer teams who are in the same boat, how they tackle this problem.
  20. Hello all, just a short question: is System.Threading.tParallelarray not usable with interfaces? The following won't compile: Type iDownloadJob=Interface [{3d24b7a2-6111-46e7-a281-7fdc318be5c4}] procedure Download; end; procedure test; var x: array of iDownloadJob; temp:Integer; begin // ..... fill the array here .... temp:=tParallelArray.ForThreshold; tParallelArray.ForThreshold:=1; try tParallelArray.&For<iDownloadJob>(x, procedure (const AValues: array of iDownloadJob; AFrom, ATo: NativeInt) var i:NativeInt; begin for i:=AFrom to ATo do aValues[i].Download; end); finally tParallelArray.ForThreshold:=temp; end; end; It would be just my luck if such a nice new feature doesn't work for me 😞 .
  21. A.M. Hoornweg

    tParallelArray and interfaces

    This is a totally weird experience. Tuesday my compiler kept saying "There is no overloaded version of tParallelArray.For ... that can be called with these arguments" and I searched in vain for the cause. Then something came up and I had to abandon the project for a few days. Today I resumed working on it and it compiled just fine - I had changed nothing! I think that something got corrupted in the memory of the IDE process on Tuesday and the reboot just made it go away... I do have regular exceptions in the IDE since installing the inline update for 12.2 (build nr 29.0.53982.0329). Anyway, I'm thrilled that I can continue now.
  22. A.M. Hoornweg

    Delphi 12.2 Patch 1

    Am I right that the the internal source code formatter is no longer there? It is still documented as a feature on Embarcadero's site though: https://docwiki.embarcadero.com/RADStudio/Athens/en/Source_Code_Formatter Is there a third-party formatter that handles generics correctly?
  23. A.M. Hoornweg

    Code signing in a remotely working team?

    That's not what I read: "DigiCert KeyLocker is a cloud-based service that helps you generate and store the private key without a physical HSM (Hardware Security Module). It was developed to reduce certificate administrators’ efforts and strengthen private key security." (https://signmycode.com/blog/what-is-digicert-keylocker-everything-to-know-about)
  24. A.M. Hoornweg

    Code signing in a remotely working team?

    I'm very interested!
×