
Edit:
I also needed to add -Fu/usr/local/lib/fpc/3.3.1/units/aarch64-linux/x11/ as x is needed by sdl2.pas (line 146)
Then the compilation halts on 4 errors:
ZPlatform_SDL.inc(221,15) Error: Identifier not found "SDL_GetEnv"
ZPlatform_SDL.inc(343,51) Error: Illegal expression
ZPlatform_SDL.inc(345,24) Error: Identifier not found "MixBufferSamplesSize"
ZPlatform_SDL.inc(345,46) Error: Can't evaluate constant expression