Procházet zdrojové kódy

Merged revisions 8503,8506,8535-8537,8539-8546,8554,8560,8575-8576,8581-8587,8590,8593-8594,8596,8600,8605,8607,8625,8630-8638,8640-8641,8659,8665,8667,8681-8682,8686-8687,8702,8705,8710-8714,8719,8721-8723,8727,8730-8731,8743,8747-8751,8766-8769,8797,8822,8831,8848-8849,8851,8879,8885-8889,8891-8893,8895,8897,8912,8917,8942,8950,8953,8998-8999 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r8503 | florian | 2007-09-16 13:43:04 +0200 (Sun, 16 Sep 2007) | 2 lines

* put Charlie's writeln debugger between DEBUG_CHARLIE conditional compilation symbols
........
r8953 | florian | 2007-10-27 13:24:50 +0200 (Sat, 27 Oct 2007) | 2 lines

* fixed m68k compilation and put it in fullcycle
........
r8999 | peter | 2007-10-30 08:15:48 +0100 (Tue, 30 Oct 2007) | 2 lines

* remove duplciate m68k from ALLTARGETS
........

git-svn-id: branches/fixes_2_2@9000 -

peter před 18 roky
rodič
revize
e1ef460c71

+ 22 - 4
compiler/Makefile

@@ -1,11 +1,12 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/10/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/10/30]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos 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 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 sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
 .PHONY: FORCE
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
@@ -56,6 +57,11 @@ else
 SRCBATCHEXT=.bat
 endif
 endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
 ifdef inUnix
 PATHSEP=/
 else
@@ -102,7 +108,11 @@ ifndef FPC
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(FPCPROG),)
 FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
 FPC:=$(shell $(FPCPROG) -PB)
+endif
 ifneq ($(findstring Error,$(FPC)),)
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 endif
@@ -233,8 +243,8 @@ PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(F
 override PACKAGE_NAME=compiler
 override PACKAGE_VERSION=2.2.1
 unexport FPC_VERSION FPC_COMPILERINFO
-CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64
-ALLTARGETS=$(CYCLETARGETS) m68k
+CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k
+ALLTARGETS=$(CYCLETARGETS)
 ifdef ALPHA
 PPC_TARGET=alpha
 endif
@@ -2233,7 +2243,7 @@ override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-XP$(BINUTILSPREFIX) 
+override FPCOPT+=-XP$(BINUTILSPREFIX)
 endif
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-Xr$(RLINKPATH)
@@ -2365,9 +2375,13 @@ ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 else
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
 EXECPPAS:=@$(PPAS)
 endif
 endif
+endif
 .PHONY: fpc_exes
 ifndef CROSSINSTALL
 ifneq ($(TARGET_PROGRAMS),)
@@ -2599,8 +2613,12 @@ else
 endif
 ifdef inUnix
 	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) (ZIPWRAPPER)
 else
 	$(ZIPWRAPPER)
+endif
 endif
 	$(DEL) $(ZIPWRAPPER)
 else

+ 2 - 2
compiler/Makefile.fpc

@@ -32,10 +32,10 @@ fpcdir=..
 unexport FPC_VERSION FPC_COMPILERINFO
 
 # Which platforms are ready for inclusion in the cycle
-CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64
+CYCLETARGETS=i386 powerpc sparc arm x86_64 powerpc64 m68k
 
 # All supported targets used for clean
-ALLTARGETS=$(CYCLETARGETS) m68k
+ALLTARGETS=$(CYCLETARGETS)
 
 # Allow ALPHA, POWERPC, POWERPC64, M68K, I386 defines for target cpu
 ifdef ALPHA

+ 7 - 4
compiler/m68k/ag68kgas.pas

@@ -299,9 +299,12 @@ interface
          s:=gas_op2str[op]+cond2str[taicpu(hp).condition]+gas_opsize2str[taicpu(hp).opsize]
         else
          s:=gas_op2str[op]+gas_opsize2str[taicpu(hp).opsize];
-        if op = A_FMOVE then begin
-          writeln('fmove! opsize:',dword(taicpu(hp).opsize));
-        end;
+        if op = A_FMOVE then
+          begin
+{$ifdef DEBUG_CHARLIE}
+            writeln('fmove! opsize:',dword(taicpu(hp).opsize));
+{$endif DEBUG_CHARLIE}
+          end;
         getopcodestring:=s;
       end;
 
@@ -330,7 +333,7 @@ interface
                   owner.AsmWrite(s+#9);
                   s:=getopstr_jmp(taicpu(hp).oper[0]^);
                   { dbcc dx,<sym> has two operands! (KB) }
-                  if (taicpu(hp).ops>1) then 
+                  if (taicpu(hp).ops>1) then
                     s:=s+','+getopstr_jmp(taicpu(hp).oper[1]^);
                   if (taicpu(hp).ops>2) then
                     internalerror(2006120501);

+ 22 - 2
compiler/m68k/cgcpu.pas

@@ -235,8 +235,9 @@ unit cgcpu;
         pushsize : tcgsize;
         ref : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_reg');
-
+{$endif DEBUG_CHARLIE}
         { it's probably necessary to port this from x86 later, or provide an m68k solution (KB) }
 {$WARNING FIX ME! check_register_size()}
         // check_register_size(size,r);
@@ -262,8 +263,9 @@ unit cgcpu;
         pushsize : tcgsize;
         ref : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_const');
-
+{$endif DEBUG_CHARLIE}
         { remove "not" to trigger the location bug (KB) }
         if use_push(cgpara) then
           begin
@@ -330,7 +332,9 @@ unit cgcpu;
         len : aint;
         href : treference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_param_ref');
+{$endif DEBUG_CHARLIE}
 
         { cgpara.size=OS_NO requires a copy on the stack }
         if use_push(cgpara) then
@@ -363,7 +367,9 @@ unit cgcpu;
         tmpreg : tregister;
         opsize : topsize;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_paramaddr_ref');
+{$endif DEBUG_CHARLIE}
         with r do
           begin
             { i suppose this is not required for m68k (KB) }
@@ -459,7 +465,9 @@ unit cgcpu;
 
     procedure tcg68k.a_load_const_reg(list : TAsmList;size : tcgsize;a : aint;register : tregister);
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_const_reg');
+{$endif DEBUG_CHARLIE}
 
         if getregtype(register)=R_ADDRESSREGISTER then
          begin
@@ -479,7 +487,9 @@ unit cgcpu;
 
     procedure tcg68k.a_load_const_ref(list : TAsmList; tosize: tcgsize; a : aint;const ref : treference);
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_const_ref');
+{$endif DEBUG_CHARLIE}
 
         list.concat(taicpu.op_const_ref(A_MOVE,S_L,longint(a),ref));
       end;
@@ -491,7 +501,9 @@ unit cgcpu;
       begin
          href := ref;
          fixref(list,href);
+{$ifdef DEBUG_CHARLIE}
          writeln('a_load_reg_ref');
+{$endif DEBUG_CHARLIE}
          { move to destination reference }
          list.concat(taicpu.op_reg_ref(A_MOVE,TCGSize2OpSize[fromsize],register,href));
       end;
@@ -506,7 +518,9 @@ unit cgcpu;
         bref := dref;
         fixref(list,aref);
         fixref(list,bref);
+{$ifdef DEBUG_CHARLIE}
         writeln('a_load_ref_ref');
+{$endif DEBUG_CHARLIE}
         list.concat(taicpu.op_ref_ref(A_MOVE,TCGSize2OpSize[fromsize],aref,bref));
       end;
 
@@ -1263,7 +1277,9 @@ unit cgcpu;
         r,rsp: TRegister;
         ref  : TReference;
       begin
+{$ifdef DEBUG_CHARLIE}
         writeln('proc entry, localsize:',localsize);
+{$endif DEBUG_CHARLIE}
 
         if not nostackframe then
           begin
@@ -1316,7 +1332,9 @@ unit cgcpu;
         if not nostackframe then
           begin
             localsize := current_procinfo.calc_stackframe_size;
+{$ifdef DEBUG_CHARLIE}
             writeln('proc exit with stackframe, size:',localsize);
+{$endif DEBUG_CHARLIE}
             list.concat(taicpu.op_reg(A_UNLK,S_NO,NR_FRAME_POINTER_REG));
             if (localsize<>0) then
               begin
@@ -1331,7 +1349,9 @@ unit cgcpu;
           end
         else
           begin
+{$ifdef DEBUG_CHARLIE}
             writeln('proc exit, no stackframe');
+{$endif DEBUG_CHARLIE}
             list.concat(taicpu.op_none(A_RTS,S_NO));
           end;
 

+ 2 - 0
compiler/m68k/cpubase.pas

@@ -127,6 +127,8 @@ unit cpubase;
       first_mm_supreg    = 0;
       first_mm_imreg     = 0;
 
+      maxfpuregs = 8;
+
 {$WARNING TODO FIX BSSTART}
       regnumber_count_bsstart = 16;
 

+ 6 - 0
compiler/m68k/cpupara.pas

@@ -307,7 +307,9 @@ unit cpupara;
             if (p.proccalloption in [pocall_cdecl,pocall_cppdecl]) and
                is_array_of_const(paradef) then
               begin
+{$ifdef DEBUG_CHARLIE}
                 writeln('loc register');
+{$endif DEBUG_CHARLIE}
                 paraloc:=hp.paraloc[side].add_location;
                 { hack: the paraloc must be valid, but is not actually used }
                 paraloc^.loc:=LOC_REGISTER;
@@ -321,7 +323,9 @@ unit cpupara;
                is_open_array(paradef) or
                is_array_of_const(paradef) then
               begin
+{$ifdef DEBUG_CHARLIE}
                 writeln('loc register');
+{$endif DEBUG_CHARLIE}
                 paradef:=voidpointertype;
                 loc:=LOC_REGISTER;
                 paracgsize := OS_ADDR;
@@ -391,7 +395,9 @@ unit cpupara;
                 else { LOC_REFERENCE }
 }
                   begin
+{$ifdef DEBUG_CHARLIE}
 		    writeln('loc reference');
+{$endif DEBUG_CHARLIE}
                     paraloc^.loc:=LOC_REFERENCE;
                     paraloc^.size:=int_cgsize(paralen);
                     if (side = callerside) then

+ 4 - 17
compiler/systems/t_linux.pas

@@ -230,31 +230,18 @@ const
 {$ifdef arm}    platform_select='';{$endif} {unknown :( }
 {$ifdef m68k}    platform_select='';{$endif} {unknown :( }
 
-{$ifdef m68k}
 var
-  St : TSearchRec;
-{$endif m68k}
+  defdynlinker: string;
 begin
   with Info do
    begin
      ExeCmd[1]:='ld '+platform_select+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
      DllCmd[1]:='ld '+platform_select+' $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES -E';
      DllCmd[2]:='strip --strip-unneeded $EXE';
+
 {$ifdef m68k}
-     libctype:=glibc2;
-     if FindFirst('/lib/ld*',faAnyFile+faSymLink,st)<>0 then
-       begin
-         repeat
-            if copy(st.name,1,5)='ld-2.' then
-             begin
-               DynamicLinker:='/lib/'+St.name;
-               if st.name[6]<>'0' then
-                 libctype:=glibc21;
-               break;
-             end;
-         until FindNext(St)<>0;
-       end;
-     FindClose(St);
+     { experimental, is this correct? }
+     defdynlinker:='/lib/ld-linux.so.2';
 {$endif m68k}
 
 {$ifdef i386}