From a9314038036d55d05c3c68e6aa4feeda993186cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Sun, 8 Jan 2017 16:40:01 +0000 Subject: [PATCH] amigaos4: de-uglified libinterface and libbase fetching upon startup, and enabled the pascal startup code as default git-svn-id: trunk@35271 - --- rtl/amiga/Makefile | 4 +++- rtl/amiga/Makefile.fpc | 2 ++ rtl/amiga/buildrtl.pp | 2 -- rtl/amiga/powerpc/si_prc.pp | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/rtl/amiga/Makefile b/rtl/amiga/Makefile index 6039dc712d..7e9d665f9b 100644 --- a/rtl/amiga/Makefile +++ b/rtl/amiga/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2016/12/04] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2017/01/07] # 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 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-iphonesim x86_64-aros x86_64-dragonfly arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros 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-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin @@ -353,7 +353,9 @@ SYSINITUNITS=si_prc RESUNIT=fpextres endif ifeq ($(ARCH),powerpc) +override LOADERS= RESUNIT=fpintres +SYSINITUNITS=si_prc endif ifeq ($(FULL_TARGET),i386-linux) override TARGET_UNITS+=$(SYSTEMUNIT) $(RESUNIT) uuchar objpas macpas iso7185 extpas buildrtl cpall diff --git a/rtl/amiga/Makefile.fpc b/rtl/amiga/Makefile.fpc index b93153421f..8b88784a54 100644 --- a/rtl/amiga/Makefile.fpc +++ b/rtl/amiga/Makefile.fpc @@ -70,7 +70,9 @@ RESUNIT=fpextres endif ifeq ($(ARCH),powerpc) +override LOADERS= RESUNIT=fpintres +SYSINITUNITS=si_prc endif [rules] diff --git a/rtl/amiga/buildrtl.pp b/rtl/amiga/buildrtl.pp index 59d2937360..dc753f6d46 100644 --- a/rtl/amiga/buildrtl.pp +++ b/rtl/amiga/buildrtl.pp @@ -3,9 +3,7 @@ unit buildrtl; interface uses -{$ifdef cpum68k} si_prc, -{$endif} athreads, dos, sysutils, ctypes, strings, diff --git a/rtl/amiga/powerpc/si_prc.pp b/rtl/amiga/powerpc/si_prc.pp index 325a3be9a2..6e0fb5456f 100644 --- a/rtl/amiga/powerpc/si_prc.pp +++ b/rtl/amiga/powerpc/si_prc.pp @@ -25,7 +25,6 @@ const var AOS_ExecBase: Pointer; public name '_ExecBase'; IExec: Pointer; public name '_IExec'; - realExecBase: Pointer absolute $4; StkLen: LongInt; external name '__stklen'; StackCookie: LongInt; external name '__stack_cookie'; sysinit_jmpbuf: jmp_buf; @@ -39,10 +38,11 @@ procedure PascalMain; external name 'PASCALMAIN'; { this function must be the first in this unit which contains code } -function _FPC_proc_start: longint; cdecl; public name '_start'; +{ apparently, the third argument contains the IExec on entry (KB) } +function _FPC_proc_start(arg0: pointer; arg1: pointer; argIExec: POS4Interface): longint; cdecl; public name '_start'; begin - AOS_ExecBase:=realExecBase; - IExec:=PPointer(@(PByte(AOS_ExecBase)[632]))^; // iexec interface's address... + IExec:=argIExec; + AOS_ExecBase:=argIExec^.Data.LibBase; { The StackCookie check is only here so the symbol is referenced and doesn't get striped out }