#1 2026-02-24 15:34:17

rastafarey
Member
Registered: 2019-05-13
Posts: 4

Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

[English]
Hi everyone / Arnaud,

I am trying to cross-compile a mORMot 2 server for Linux natively, using Delphi's Linux compiler (LLVM). However, I immediately hit hundreds of errors related to unsupported inline ASM (e.g., ReadBarrier missing PUREPASCAL check) and missing RTL functions (like GetTickCount64 in mormot.core.base.pas).

Trying to patch all these #IFDEFs and libc calls manually feels like I would need to modify half the framework.

My question is straightforward: Is there a supported/configured way to compile mORMot 2 for Linux strictly using the Delphi Linux compiler? Or is the framework architecture for Linux exclusively designed to be compiled via Free Pascal (or Delphi Win64 + Wine)?

Thank you very much!


[Français]
Bonjour à tous / Arnaud,

J'essaie de compiler (cross-compile) un serveur mORMot 2 pour Linux en utilisant le compilateur Linux natif de Delphi (LLVM). Cependant, je rencontre immédiatement des centaines d'erreurs liées à l'ASM non supporté (ex: ReadBarrier sans vérification PUREPASCAL) et aux fonctions RTL manquantes (comme GetTickCount64 dans mormot.core.base.pas).

Essayer de patcher manuellement tous ces #IFDEF et appels libc reviendrait presque à modifier la moitié du framework.

Ma question est simple : Existe-t-il une méthode supportée pour compiler mORMot 2 pour Linux exclusivement avec le compilateur Linux de Delphi ? Ou bien l'architecture du framework pour Linux est-elle exclusivement pensée pour être compilée via Free Pascal (ou Delphi Win64 + Wine) ?

Merci beaucoup !


[Español]
Hola a todos / Arnaud,
Estoy intentando compilar de forma cruzada un servidor mORMot 2 para Linux de forma nativa, utilizando el compilador de Delphi para Linux (LLVM). Sin embargo, inmediatamente me topo con cientos de errores relacionados con ASM no soportado (ej. ReadBarrier sin chequeo de PUREPASCAL) y funciones RTL faltantes (como GetTickCount64 en mormot.core.base.pas).

Intentar parchear manualmente todos estos #IFDEF y llamadas a libc se siente como si tuviera que modificar medio framework.

Mi pregunta es directa: ¿Existe alguna forma soportada/configurada de compilar mORMot 2 para Linux usando estrictamente el compilador de Delphi para Linux? ¿O la arquitectura del framework para Linux está diseñada exclusivamente para ser compilada mediante Free Pascal (o Delphi Win64 + Wine)?

¡Muchas gracias!

Offline

#2 2026-02-24 18:23:07

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 403

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

So it looks like this topic is still up to date:

https://synopse.info/forum/viewtopic.php?id=6050

Offline

#3 2026-02-24 20:18:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,411
Website

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

Not yet feasible, sorry.

The Linux x86_64 target is our main target for optimizations and productions, but... only with FPC yet.

Offline

#4 2026-02-25 16:59:11

mormot.coremy_only_lonely
Member
Registered: 2024-12-09
Posts: 7

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

Will Delphi for Linux support still be considered in the roadmap?
Surely we could use FPC for new projects. But a lot of people like me are trying to migrate the old Windows project to Linux, a total rewrite in FPC is often not practical. To be honst, I have used a lot of 3rd party libraries in my project, but for now mORMot is the last 3rd party library that does not support Delphi for Linux. I have to write a adapter to use mORMot and Indy version of HTTP Server.

Offline

#5 2026-02-25 20:51:29

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,411
Website

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

And you are happy with the Delphi for Linux compatibility, performance and stability?

Offline

#6 2026-02-26 06:48:00

rastafarey
Member
Registered: 2019-05-13
Posts: 4

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

[English]
Hi Arnaud and everyone,

Thank you for the follow-up. To answer your question: Yes, I am very satisfied with Delphi's Linux compiler in terms of stability and ease of deployment for our microservices. It works great and fits perfectly into our cross-platform workflow.

However, my challenge is strictly with mORMot 2. I am a huge fan of your work, especially the JSON parser—its speed is legendary, and the memory management is so clean that I never worry about leaks or fragmentation. It’s easily the best in the Pascal world.

I really wanted to use mORMot 2’s JSON engine in my Linux native projects, but when I tried to compile it with Delphi (LLVM), I hit a wall of ASM errors and missing RTL defines. I started patching it manually, but I realized it would take me months to port the whole framework. As a result, I’m sticking with SynCrossPlatformJSON.pas from version 1.18, because compiling mORMot 2 natively with Delphi for Linux currently feels like an impossible task.

I’d love to see mORMot 2 become more 'Delphi-Linux friendly', but for now, I’ll keep using your excellent 1.18 cross-platform units!"



[Español]
"Hola Arnaud,

Para responder a tu pregunta: Sí, estoy muy contento con la compatibilidad de Delphi para Linux. El rendimiento y la estabilidad son geniales para lo que hacemos.

Mi problema es específicamente con mORMot 2. Soy un gran admirador de tu parser JSON; la velocidad es increíble y lo mejor es que no tiene fugas ni fragmentación de memoria, algo vital para nosotros. Quise portar mORMot 2 a mis proyectos de Delphi Linux, pero me encontré con cientos de errores de ASM e IFDEFs faltantes. Intenté cambiarlo a mano, pero es una tarea titánica. Por ahora, me quedo con la unidad SynCrossPlatformJSON.pas de la versión 1.18, porque mORMot 2 con el compilador cruzado de Delphi es casi imposible de compilar.

¡Ojalá en el futuro sea más compatible, porque tus librerías son las mejores!"



[Français]
"Bonjour Arnaud,

Pour répondre à votre question : Oui, je suis très satisfait de Delphi pour Linux. La stabilité et les performances sont au rendez-vous pour nos serveurs.

Cependant, mon problème concerne uniquement mORMot 2. Je suis impressionné par la vitesse de votre parser JSON, c'est du grand art, sans aucune fuite ni fragmentation de mémoire. J'ai tenté de compiler mORMot 2 nativement avec Delphi (LLVM) pour Linux, mais les erreurs d'ASM et les dépendances RTL rendent la tâche impossible sans y passer des mois. C'est pourquoi je continue d'utiliser SynCrossPlatformJSON.pas de la version 1.18.

Votre travail est exceptionnel, et j'espère qu'un jour mORMot 2 sera plus accessible pour le compilateur Linux de Delphi

Offline

#7 2026-02-26 14:13:55

mormot.coremy_only_lonely
Member
Registered: 2024-12-09
Posts: 7

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

So did I. Most of the code just work after changing platforms, except for the parts relying on Windows unit. For us, performance is already good enough; compatibility is our main concern.

Offline

#8 Yesterday 08:20:53

pascal_l
Member
Registered: Yesterday
Posts: 2

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

I agree with both of you. I'm also a big fan of your project and have used it for many years on the Delphi Windows platform.

However, we recently decided to migrate some of our projects from WIN64 to LINUX64. We reviewed all the third-party components we rely on, such as ZeosLib and superobject, and found that they either support Delphi on Linux out of the box or require only minor adjustments. Unfortunately, it seems we may have to replace mORMot with other components, as it doesn’t yet fit seamlessly into our Linux migration plan.

As for why we don’t switch to FPC — that’s a fair question. Even when starting new projects, they still depend on a set of common utility code we’ve developed over the years. Migrating all of that code to FPC is simply not a viable option for us at this point.

Online

#9 Today 08:07:46

edwinsn
Member
Registered: 2010-07-02
Posts: 1,225

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

Subscribed to this topic.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#10 Today 09:34:56

pvn0
Member
From: Slovenia
Registered: 2018-02-12
Posts: 220

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

You can compile a shared library on fpc containing necessary components like the json routines and then absorb that in your delphi linux application, obviously following recommended best practices, avoid passing managed types as parameters, buffer pointers only, etc...

Offline

#11 Today 15:16:46

pascal_l
Member
Registered: Yesterday
Posts: 2

Re: Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib

Yes, I can, but it would be very hard to maintain because the shared code contains many managed types (like strings) and is not really designed to be exposed as a C interface library.
It would be marvelous if mORMot2 could support Delphi on Linux. I think this would help others who may face similar circumstances. Embarcadero doesn't supply a new platform without reason, there are certain people or companies(like us) that do have the requirement to migrate to Linux.

Online

Board footer

Powered by FluxBB