Browse Source

Fix syscall unit compilation for i386-linux using -dFPC_USE_LIBC

Pierre Muller 1 year ago
parent
commit
7c9cf75418
3 changed files with 6 additions and 5 deletions
  1. 1 0
      rtl/linux/i386/syscall.inc
  2. 0 5
      rtl/linux/system.pp
  3. 5 0
      rtl/unix/syscall.pp

+ 1 - 0
rtl/linux/i386/syscall.inc

@@ -45,6 +45,7 @@ type
 
 var
   psysinfo: LongWord = 0;
+  sysenter_supported : longint = 0;
 
 procedure InitSyscallIntf;
 var

+ 0 - 5
rtl/linux/system.pp

@@ -77,11 +77,6 @@ property cmdline:PAnsiChar read get_cmdline;
                                  implementation
 {*****************************************************************************}
 
-{$if defined(CPUI386) and not defined(FPC_USE_LIBC)}
-var
-  sysenter_supported: LongInt = 0;
-{$endif}
-
 const
   calculated_cmdline:PAnsiChar=nil;
 {$ifdef FPC_HAS_INDIRECT_ENTRY_INFORMATION}

+ 5 - 0
rtl/unix/syscall.pp

@@ -34,5 +34,10 @@ procedure seterrno(err:cint); external name 'FPC_SYS_SETERRNO';
 {$ifdef FPC_HAS_SETSYSNR_INC}
 begin
   SetSyscallNumbers;
+{$else}
+{$if defined(linux) and defined(i386) and defined(FPC_USE_LIBC)}
+begin
+  InitSyscallIntf;
+{$endif}
 {$endif FPC_HAS_SETSYSNR_INC}
 end.