#1 Re: mORMot 2 » Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib » 2026-02-26 06:48:00

[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

#2 mORMot 2 » Compiling mORMot 2 for Linux with Delphi's LLVM compiler: Is it feasib » 2026-02-24 15:34:17

rastafarey
Replies: 14

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

#3 Re: mORMot 1 » multipart/form-data not implemented yet » 2019-05-14 14:59:03

A ver como realizar una pregunta en este foro y no morir en el intento sin que te manden a leer  la peor documentación del mundo

Como agregar enviar un servidor via http.

Tengo esto y funciona.
procedure TForm2.Button5Click(Sender: TObject);
Var
  D: Variant;
begin
  TDocVariantData(D).AddValue('campo','Nice guy');
  Memo1.Text := TWinHTTP.Post('https://utc24h.s1.com.ve/campo', D, 'Content-Type: application/json', true, nil);
end;

Ahora quiere enviar una imagen.
intente esto y no funciona

procedure TForm2.Button3Click(Sender: TObject);
Var
  D: Variant;
  Imagen: TMemoryStream;
   LRawBytes : RawByteString;
begin
  Imagen := TMemoryStream.Create;
  Try
    Imagen.LoadFromFile('C:\Users\Administrador\Desktop\yomismo.jpg');
    LRawBytes := StreamToRawByteString(Imagen);
    TDocVariantData(D).AddValue('archivo', LRawBytes);
    Memo1.Text := TWinHTTP.Post('https://utc24h.s1.com.ve/archivo', D, 'Content-Type: Application/octet-stream', true, nil);
  Finally
    Imagen.Free;
  End;
end;


esto tampoco

procedure TForm2.Button3Click(Sender: TObject);
Var
  D: Variant;
  Imagen: TMemoryStream;
   LRawBytes : RawByteString;
begin
  Imagen := TMemoryStream.Create;
  Try
    Imagen.LoadFromFile('C:\Users\Administrador\Desktop\yomismo.jpg');
    LRawBytes := StreamToRawByteString(Imagen);
    TDocVariantData(D).AddValue('archivo', LRawBytes);
    Memo1.Text := TWinHTTP.Post('https://utc24h.s1.com.ve/archivo', D, 'Content-Type: multipart/form-data; boundary=' +IntToHex(Random(MaxInt), 8) + '_info_boundary', true, nil);
  Finally
    Imagen.Free;
  End;
end;

#4 Re: mORMot 1 » How to Encrypt/Decrypt with AESECB? » 2019-05-13 11:24:27

Hola buen día.
Estoy intentando enviar una imagen usando
TWinHTTP.Post(Url, data, '', true, Nil);
pero no entiendo como cargar una imagen al parámetro data.
Si alguien me podría indicar como hacerlo.

Con TNetHTTPClient lo he realizado usando TMultipartFormData, pero me gustaría usar mORMot.

Gracias por su ayuda.

Board footer

Powered by FluxBB