Browse Source

* only i386 needs cprt21 to link with glibc 2.1+

peter 21 years ago
parent
commit
c0d3ba3a67

+ 8 - 4
rtl/linux/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 1.1 [2004/01/05]
+# Don't edit, this file is generated by FPCMake Version 1.1 [2004/02/03]
 #
 default: all
 MAKEFILETARGETS=linux go32v2 win32 os2 freebsd beos netbsd amiga atari sunos qnx netware openbsd wdosx palmos macos darwin emx watcom
@@ -185,11 +185,14 @@ override FPCDIR:=$(FPCDIR)/..
 ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
 override FPCDIR:=$(FPCDIR)/..
 ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
 override FPCDIR=c:/pp
 endif
 endif
 endif
 endif
+endif
 ifndef CROSSDIR
 CROSSDIR:=$(FPCDIR)/cross/$(FULL_TARGET)
 endif
@@ -211,6 +214,7 @@ INC=$(RTL)/inc
 PROCINC=$(RTL)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
 ifeq ($(CPU_TARGET),i386)
+CRT21=cprt21 gprt21
 CPU_UNITS=x86 ports cpu mmx graph
 else
 CPU_UNITS=
@@ -240,7 +244,7 @@ ifndef USELIBGGI
 USELIBGGI=NO
 endif
 override TARGET_UNITS+=$(SYSTEMUNIT) unixtype baseunix strings systhrds  objpas syscall unixutil heaptrc lineinfo $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc $(CPU_UNITS) dos crt objects printer ggigraph sysutils typinfo math varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst cthreads classes strutils rtlconst
-override TARGET_LOADERS+=prt0 dllprt0 cprt0 gprt0 cprt21 gprt21
+override TARGET_LOADERS+=prt0 dllprt0 cprt0 gprt0 $(CRT21)
 override TARGET_RSTS+=math varutils typinfo variants systhrds sysconst rtlconst
 override CLEAN_UNITS+=syslinux linux
 override INSTALL_FPCPACKAGE=y
@@ -1368,8 +1372,8 @@ cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
 	$(AS) -o cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
 cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
 	$(AS) -o cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
-gprt21$(OEXT) : $(CPU_TARGET)/gprt0.as
-	$(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt0.as
+gprt21$(OEXT) : $(CPU_TARGET)/gprt21.as
+	$(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt21.as
 $(SYSTEMUNIT)$(PPUEXT) : $(SYSTEMUNIT).pp sysconst.inc systypes.inc $(SYSDEPS)
 	$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
 systhrds$(PPUEXT): systhrds.pp $(INC)/threadh.inc $(SYSTEMUNIT)$(PPUEXT) objpas$(PPUEXT)

+ 4 - 4
rtl/linux/Makefile.fpc

@@ -6,7 +6,7 @@
 main=rtl
 
 [target]
-loaders=prt0 dllprt0 cprt0 gprt0 cprt21 gprt21
+loaders=prt0 dllprt0 cprt0 gprt0 $(CRT21)
 units=$(SYSTEMUNIT) unixtype baseunix strings systhrds  objpas syscall unixutil \
       heaptrc lineinfo \
       $(LINUXUNIT1) termio unix $(LINUXUNIT2) initc $(CPU_UNITS) \
@@ -54,6 +54,7 @@ PROCINC=$(RTL)/$(CPU_TARGET)
 UNIXINC=$(RTL)/unix
 
 ifeq ($(CPU_TARGET),i386)
+CRT21=cprt21 gprt21
 CPU_UNITS=x86 ports cpu mmx graph
 else
 CPU_UNITS=
@@ -133,9 +134,8 @@ cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
 cprt21$(OEXT) : $(CPU_TARGET)/cprt21.as
         $(AS) -o cprt21$(OEXT) $(CPU_TARGET)/cprt21.as
 
-# still need to use gprt1, because gprt21 crashes
-gprt21$(OEXT) : $(CPU_TARGET)/gprt0.as
-        $(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt0.as
+gprt21$(OEXT) : $(CPU_TARGET)/gprt21.as
+        $(AS) -o gprt21$(OEXT) $(CPU_TARGET)/gprt21.as
 
 
 #

+ 0 - 0
rtl/linux/arm/cprt21.as


+ 8 - 5
rtl/linux/i386/gprt21.as

@@ -45,13 +45,11 @@ _start:
         pushl   $_init_dummy
         pushl   %ebx
         pushl   %esi
-        pushl   $main
+        pushl   $cmain
         call    __libc_start_main
         hlt
 
 /* fake main routine which will be run from libc */
-        .globl  cmain
-        .type   cmain,@object
 cmain:
         /* save return address */
         popl    %eax
@@ -61,6 +59,8 @@ cmain:
         movl    %edi,___fpc_ret_edi
         pushl   %eax
 
+	call    __gmon_start__
+
         /* start the program */
         call    PASCALMAIN
         hlt
@@ -81,7 +81,7 @@ _fini_dummy:
         ret
 
         .globl  __gmon_start__
-        .type   __gmon_start__,@object
+        .type   __gmon_start__,@function
 __gmon_start__:
         pushl   %ebp
         movl    __monstarted,%eax
@@ -125,6 +125,9 @@ ___fpc_ret_edi:
 
 #
 # $Log$
-# Revision 1.4  2002-09-07 16:01:20  peter
+# Revision 1.5  2004-03-10 20:38:59  peter
+#   * only i386 needs cprt21 to link with glibc 2.1+
+#
+# Revision 1.4  2002/09/07 16:01:20  peter
 #   * old logs removed and tabs fixed
 #

+ 0 - 15
rtl/linux/powerpc/cprt21.as

@@ -1,15 +0,0 @@
-/*
-  $Id$
-*/
-
-/* 
-  $Log$
-  Revision 1.3  2002-09-07 16:01:20  peter
-    * old logs removed and tabs fixed
-
-  Revision 1.2  2002/07/26 17:09:44  florian
-    * log fixed
-
-  Revision 1.1  2002/07/26 17:07:11  florian
-    + dummy implementation to test the makefile
-*/

+ 0 - 9
rtl/linux/sparc/cprt21.as

@@ -1,9 +0,0 @@
-/*
-  $Id$
-*/
-
-/*
-  $Log$
-  Revision 1.3  2003-05-23 21:09:14  florian
-    + dummy implementation readded to satisfy makefile
-*/

+ 0 - 13
rtl/linux/x86_64/cprt21.as

@@ -1,13 +0,0 @@
-/*
-  $Id$
-  Dummy implementation
-
-*/
-
-
-
-/*
-  $Log$
-  Revision 1.1  2003-01-06 19:39:17  florian
-    + dummy implementations
-*/