diff options
Diffstat (limited to 'rtl/linux')
-rw-r--r-- | rtl/linux/Makefile | 67 | ||||
-rw-r--r-- | rtl/linux/arm/gprt0.as | 173 | ||||
-rw-r--r-- | rtl/linux/buildrtl.lpi | 4 | ||||
-rw-r--r-- | rtl/linux/i386/syscall.inc | 17 | ||||
-rw-r--r-- | rtl/linux/m68k/prt0.as | 2 | ||||
-rw-r--r-- | rtl/linux/mips/syscall.inc | 5 | ||||
-rw-r--r-- | rtl/linux/osmacro.inc | 6 | ||||
-rw-r--r-- | rtl/linux/ostypes.inc | 5 | ||||
-rw-r--r-- | rtl/linux/system.pp | 1 |
9 files changed, 198 insertions, 82 deletions
diff --git a/rtl/linux/Makefile b/rtl/linux/Makefile index 75c86228ea..bcc1d2d484 100644 --- a/rtl/linux/Makefile +++ b/rtl/linux/Makefile @@ -1,9 +1,9 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-04-01 rev 27428] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2014-12-07 rev 29213] # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos -BSDs = freebsd netbsd openbsd darwin +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android jvm-java jvm-android i8086-msdos +BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos OSNeedsComspecToRunBatch = go32v2 watcom @@ -430,6 +430,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix endif @@ -517,6 +520,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_UNITS+=$(SYSTEMUNIT) fpintres $(SYSINIT_UNITS) uuchar unixtype ctypes baseunix strings objpas macpas iso7185 syscall unixutil heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) linuxvcs sysutils typinfo math charset cpall character unixcp getopts errors dl dynlibs types sysconst fpwidestring cthreads classes fgl rtlconsts dos cwstring fpcylix endif @@ -655,6 +661,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable endif @@ -742,6 +751,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_IMPLICITUNITS+=exeinfo cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 cp437 cp646 cp850 cp856 cp866 cp874 cp8859_1 cp8859_5 cp8859_2 cp852 unicodedata unicodenumtable endif @@ -880,6 +892,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_LOADERS+=$(LOADERS) endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_LOADERS+=$(LOADERS) +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_LOADERS+=$(LOADERS) endif @@ -967,6 +982,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_LOADERS+=$(LOADERS) endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_LOADERS+=$(LOADERS) +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_LOADERS+=$(LOADERS) endif @@ -1105,6 +1123,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override TARGET_RSTS+=math typinfo sysconst rtlconsts endif +ifeq ($(FULL_TARGET),i386-aros) +override TARGET_RSTS+=math typinfo sysconst rtlconsts +endif ifeq ($(FULL_TARGET),m68k-linux) override TARGET_RSTS+=math typinfo sysconst rtlconsts endif @@ -1192,6 +1213,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override TARGET_RSTS+=math typinfo sysconst rtlconsts endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override TARGET_RSTS+=math typinfo sysconst rtlconsts +endif ifeq ($(FULL_TARGET),arm-linux) override TARGET_RSTS+=math typinfo sysconst rtlconsts endif @@ -1330,6 +1354,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override CLEAN_UNITS+=syslinux linux endif +ifeq ($(FULL_TARGET),i386-aros) +override CLEAN_UNITS+=syslinux linux +endif ifeq ($(FULL_TARGET),m68k-linux) override CLEAN_UNITS+=syslinux linux endif @@ -1417,6 +1444,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override CLEAN_UNITS+=syslinux linux endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override CLEAN_UNITS+=syslinux linux +endif ifeq ($(FULL_TARGET),arm-linux) override CLEAN_UNITS+=syslinux linux endif @@ -1556,6 +1586,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) endif @@ -1643,6 +1676,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) endif @@ -1781,6 +1817,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) endif @@ -1868,6 +1907,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON) endif @@ -2006,6 +2048,9 @@ endif ifeq ($(FULL_TARGET),i386-android) override COMPILER_TARGETDIR+=. endif +ifeq ($(FULL_TARGET),i386-aros) +override COMPILER_TARGETDIR+=. +endif ifeq ($(FULL_TARGET),m68k-linux) override COMPILER_TARGETDIR+=. endif @@ -2093,6 +2138,9 @@ endif ifeq ($(FULL_TARGET),x86_64-embedded) override COMPILER_TARGETDIR+=. endif +ifeq ($(FULL_TARGET),x86_64-dragonfly) +override COMPILER_TARGETDIR+=. +endif ifeq ($(FULL_TARGET),arm-linux) override COMPILER_TARGETDIR+=. endif @@ -2405,6 +2453,12 @@ EXEEXT= HASSHAREDLIB=1 SHORTSUFFIX=lnx endif +ifeq ($(OS_TARGET),dragonfly) +BATCHEXT=.sh +EXEEXT= +HASSHAREDLIB=1 +SHORTSUFFIX=df +endif ifeq ($(OS_TARGET),freebsd) BATCHEXT=.sh EXEEXT= @@ -2450,6 +2504,11 @@ EXEEXT= SHAREDLIBEXT=.library SHORTSUFFIX=amg endif +ifeq ($(OS_TARGET),aros) +EXEEXT= +SHAREDLIBEXT=.library +SHORTSUFFIX=aros +endif ifeq ($(OS_TARGET),morphos) EXEEXT= SHAREDLIBEXT=.library @@ -2914,7 +2973,7 @@ endif ifdef CREATESHARED override FPCOPT+=-Cg endif -ifneq ($(findstring $(OS_TARGET),freebsd openbsd netbsd linux solaris),) +ifneq ($(findstring $(OS_TARGET),dragonfly freebsd openbsd netbsd linux solaris),) ifeq ($(CPU_TARGET),x86_64) override FPCOPT+=-Cg endif diff --git a/rtl/linux/arm/gprt0.as b/rtl/linux/arm/gprt0.as index d7c3b8c929..dd7ebd0363 100644 --- a/rtl/linux/arm/gprt0.as +++ b/rtl/linux/arm/gprt0.as @@ -1,79 +1,136 @@ -/* - At this entry point, most registers' values are unspecified, except: - - a1 Contains a function pointer to be registered with `atexit'. - This is how the dynamic linker arranges to have DT_FINI - functions called for shared libraries that have been loaded - before this code runs. - - sp The stack contains the arguments and environment: - 0(sp) argc - 4(sp) argv[0] - ... - (4*argc)(sp) NULL - (4*(argc+1))(sp) envp[0] - ... - NULL +/* Startup code for ARM & ELF + Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. */ + +/* This is the canonical entry point, usually the first thing in the text + segment. + + Note that the code in the .init section has already been run. + This includes _init and _libc_init + + + At this entry point, most registers' values are unspecified, except: + + a1 Contains a function pointer to be registered with `atexit'. + This is how the dynamic linker arranges to have DT_FINI + functions called for shared libraries that have been loaded + before this code runs. + + sp The stack contains the arguments and environment: + 0(sp) argc + 4(sp) argv[0] + ... + (4*argc)(sp) NULL + (4*(argc+1))(sp) envp[0] + ... + NULL */ - .text - .globl _start - .type _start,#function + .text + .globl _start + .type _start,#function _start: - /* Clear the frame pointer since this is the outermost frame. */ - mov fp, #0 - ldmia sp!, {a2} + /* Clear the frame pointer since this is the outermost frame. */ + mov fp, #0 + ldmia sp!, {a2} - /* Pop argc off the stack and save a pointer to argv */ - ldr ip,=operatingsystem_parameter_argc - ldr a3,=operatingsystem_parameter_argv - str a2,[ip] + /* Pop argc off the stack and save a pointer to argv */ + ldr ip,=operatingsystem_parameter_argc + ldr a3,=operatingsystem_parameter_argv + str a2,[ip] - /* calc envp */ - add a2,a2,#1 - add a2,sp,a2,LSL #2 - ldr ip,=operatingsystem_parameter_envp + /* calc envp */ + add a4,a2,#1 + add a4,sp,a4,LSL #2 + ldr ip,=operatingsystem_parameter_envp - str sp,[a3] - str a2,[ip] + str sp,[a3] + str a4,[ip] - ldr r1,=_etext /* Initialize gmon */ + /* Save initial stackpointer */ + ldr ip,=__stkptr + str sp,[ip] + + /* Initialize gmon */ + mov r2,#1 + ldr r1,=_etext ldr r0,=_start - bl monstartup + bl __monstartup ldr r0,=_mcleanup bl atexit - /* Save initial stackpointer */ - ldr ip,=__stkptr - str sp,[ip] - /* align sp again to 8 byte boundary, needed by eabi */ - sub sp,sp,#4 + /* argc already loaded to a2*/ + ldr ip, =operatingsystem_parameter_argc + ldr a2,[ip] + + /* Fetch address of fini */ + ldr ip, =_fini + + /* load argv */ + mov a3, sp + + /* Push stack limit */ + str a3, [sp, #-4]! - /* Let the libc call main and exit with its return code. */ - bl PASCALMAIN + /* Push rtld_fini */ + str a1, [sp, #-4]! - .globl _haltproc - .type _haltproc,#function + /* Set up the other arguments in registers */ + ldr a1, =PASCALMAIN + ldr a4, =_init + + /* Push fini */ + str ip, [sp, #-4]! + + /* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */ + + /* Let the libc call main and exit with its return code. */ + bl __libc_start_main + + /* should never get here....*/ + bl abort + + .globl _haltproc + .type _haltproc,#function _haltproc: - /* r0 contains exitcode */ - swi 0x900001 - b _haltproc + ldr r0,=operatingsystem_result + ldrb r0,[r0] + swi 0x900001 + b _haltproc - .globl _haltproc_eabi + .globl _haltproc_eabi .type _haltproc_eabi,#function _haltproc_eabi: - /* r0 contains exitcode */ + bl exit /* libc exit */ + + ldr r0,=operatingsystem_result + ldrb r0,[r0] mov r7,#248 - swi 0x0 - b _haltproc_eabi + swi 0x0 + b _haltproc_eabi /* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start + .data + .globl __data_start __data_start: - .long 0 - .weak data_start - data_start = __data_start + .long 0 + .weak data_start + data_start = __data_start .bss .comm __stkptr,4 @@ -82,9 +139,9 @@ __data_start: .comm operatingsystem_parameter_argc,4 .comm operatingsystem_parameter_argv,4 - .section ".comment" - .byte 0 - .ascii "generated by FPC http://www.freepascal.org\0" + .section ".comment" + .byte 0 + .ascii "generated by FPC http://www.freepascal.org\0" /* We need this stuff to make gdb behave itself, otherwise gdb will chokes with SIGILL when trying to debug apps. diff --git a/rtl/linux/buildrtl.lpi b/rtl/linux/buildrtl.lpi index 563b207aad..6aafdcc117 100644 --- a/rtl/linux/buildrtl.lpi +++ b/rtl/linux/buildrtl.lpi @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> <Version Value="9"/> @@ -36,7 +36,6 @@ <Unit0> <Filename Value="buildrtl.pp"/> <IsPartOfProject Value="True"/> - <UnitName Value="buildrtl"/> </Unit0> </Units> </ProjectOptions> @@ -58,7 +57,6 @@ <ShowNotes Value="False"/> <ShowHints Value="False"/> </Verbosity> - <CompilerPath Value="$(CompPath)"/> <ExecuteBefore> <Command Value="cmd.exe /c "if not exist ../units/$(TargetCPU)-linux mkdir ../units/$(TargetCPU)-linux""/> <ShowAllMessages Value="True"/> diff --git a/rtl/linux/i386/syscall.inc b/rtl/linux/i386/syscall.inc index 9bf75db668..9c2e4f47c5 100644 --- a/rtl/linux/i386/syscall.inc +++ b/rtl/linux/i386/syscall.inc @@ -62,15 +62,16 @@ begin auxv := PElf32AuxiliaryVector(ep); - repeat - if auxv^.a_type = AT_SYSINFO then begin - psysinfo := auxv^.a_un.a_val; - if psysinfo <> 0 then - sysenter_supported := 1; // descision factor in asm syscall routines - Break; + while auxv^.a_type <> AT_NULL do + begin + if auxv^.a_type = AT_SYSINFO then begin + psysinfo := auxv^.a_un.a_val; + if psysinfo <> 0 then + sysenter_supported := 1; // descision factor in asm syscall routines + Break; + end; + Inc(auxv); end; - Inc(auxv); - until auxv^.a_type = AT_NULL; end; {***********************SYSENTER CODE END******************************} diff --git a/rtl/linux/m68k/prt0.as b/rtl/linux/m68k/prt0.as index a6ab51ad97..e7ed4fd743 100644 --- a/rtl/linux/m68k/prt0.as +++ b/rtl/linux/m68k/prt0.as @@ -50,6 +50,7 @@ _start: move.l %a0, operatingsystem_parameter_argv lea.l 8(%sp,%d0.l*4), %a0 move.l %a0, operatingsystem_parameter_envp + move.l %sp, __stkptr # move.l 8(%sp), %d0 # move.l %d0, operatingsystem_parameter_envp @@ -95,4 +96,5 @@ operatingsystem_parameters: .set operatingsystem_parameter_envp,operatingsystem_parameters+0 .set operatingsystem_parameter_argc,operatingsystem_parameters+4 .set operatingsystem_parameter_argv,operatingsystem_parameters+8 +.section .note.GNU-stack,"",%progbits diff --git a/rtl/linux/mips/syscall.inc b/rtl/linux/mips/syscall.inc index 8410f89153..e850f8faf1 100644 --- a/rtl/linux/mips/syscall.inc +++ b/rtl/linux/mips/syscall.inc @@ -16,11 +16,6 @@ {$UNDEF SYSCALL_DEBUG} {$ENDIF SYS_LINUX} -{ This variable is needed in syscall.inc assembler code } -var - fpc_threadvar_relocate_proc : TRelocateThreadVarHandler; public name 'FPC_THREADVAR_RELOCATE'; -{$define THREADVAR_RELOCATED_ALREADY_DEFINED} - {$define FPC_SYSTEM_HAS_FPFORK} { diff --git a/rtl/linux/osmacro.inc b/rtl/linux/osmacro.inc index 48138f6ecc..89757d655a 100644 --- a/rtl/linux/osmacro.inc +++ b/rtl/linux/osmacro.inc @@ -102,19 +102,19 @@ function __xmknod(__ver : cint; Pathname: PChar; Mode: mode_t; var Device: dev_t {$define FPC_HAS_BASEUNIX_STAT} function FpFstat(fd : cint; var sb : stat): cint;inline; begin - __fxstat(_STAT_VER,fd,sb); + FpFstat:=__fxstat(_STAT_VER,fd,sb); end; function fpLstat(path:pchar;Info:pstat):cint;inline; begin - __lxstat(_STAT_VER,path,Info^); + fpLstat:=__lxstat(_STAT_VER,path,Info^); end; function FpStat(path: pchar; var buf : stat): cint;inline; begin - __xstat(_STAT_VER,path,buf); + FpStat:=__xstat(_STAT_VER,path,buf); end; {$ifndef fs32bit} diff --git a/rtl/linux/ostypes.inc b/rtl/linux/ostypes.inc index ba79a28369..c8afeca30c 100644 --- a/rtl/linux/ostypes.inc +++ b/rtl/linux/ostypes.inc @@ -75,10 +75,15 @@ TYPE { include /include/asm-<cpu>/posix-types.h } const +{$ifndef cpux86_64} _STAT_VER_LINUX_OLD = 1; _STAT_VER_KERNEL = 1; _STAT_VER_SVR4 = 2; _STAT_VER_LINUX = 3; +{$else} + _STAT_VER_KERNEL = 0; + _STAT_VER_LINUX = 1; +{$endif} _STAT_VER = _STAT_VER_LINUX; type diff --git a/rtl/linux/system.pp b/rtl/linux/system.pp index a337d87cf6..82dae436e4 100644 --- a/rtl/linux/system.pp +++ b/rtl/linux/system.pp @@ -368,7 +368,6 @@ begin InOutRes:=0; { threading } InitSystemThreads; - initvariantmanager; { restore original signal handlers in case this is a library } if IsLibrary then RestoreOldSignalHandlers; |