FPC generics are much stricter than Delphi's implementation. I wouldn't bother with making them compatible. To make them compatible you would need to specialize every generic class

Code:
type
{$ifdef FPC}
 generic TGenericType<T> = class
{$else}
 TGenericType<T> = class
{$endif}
  function Test(AArg: T): T;
 end;
 
 TSomeGeneric = {$ifdef FPC}specialize {$endif}TGenericType<longint>;

implementation

function TGenericType.Test(AArg: T): T;
begin
   result := T*2;
end;