The magic here is the {$DEFINE FPC_SYSTEM_HAS_MOD_LONGINT}, which instructs the system unit not to include the default fpc_mod_longint. It must be defined before generic.inc gets procesed; it might help moving this define up to the top of the file.