rpms/z88dk/devel z88dk-1.7-64bit.patch, NONE, 1.1 z88dk.spec, 1.10, 1.11

Kevin Kofler (kkofler) fedora-extras-commits at redhat.com
Fri Dec 7 14:29:00 UTC 2007


Author: kkofler

Update of /cvs/pkgs/rpms/z88dk/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10317/devel

Modified Files:
	z88dk.spec 
Added Files:
	z88dk-1.7-64bit.patch 
Log Message:
* Fri Dec 7 2007 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.7-2
- patch for 64-bit issues (#185511)
- drop ExcludeArch for 64-bit architectures (#185511)

z88dk-1.7-64bit.patch:

--- NEW FILE z88dk-1.7-64bit.patch ---
diff -ur z88dk/src/appmake/zx.c z88dk-64bit/src/appmake/zx.c
--- z88dk/src/appmake/zx.c	2007-06-19 11:20:50.000000000 +0200
+++ z88dk-64bit/src/appmake/zx.c	2007-12-07 10:38:50.000000000 +0100
@@ -153,7 +153,7 @@
     writeword_p(26,fpout,&parity);         /* BASIC line length */
     writebyte_p(0xfd,fpout,&parity);       /* CLEAR */
     writebyte_p(0xb0,fpout,&parity);       /* VAL */
-    sprintf(mybuf,"\"%i\":",pos-1);        /* location for CLEAR */
+    sprintf(mybuf,"\"%li\":",pos-1);        /* location for CLEAR */
     writestring_p(mybuf,fpout,&parity);
     writebyte_p(0xef,fpout,&parity);       /* LOAD */
     writebyte_p('"',fpout,&parity);
@@ -163,7 +163,7 @@
     writebyte_p(0xf9,fpout,&parity);       /* RANDOMIZE */
     writebyte_p(0xc0,fpout,&parity);       /* USR */
     writebyte_p(0xb0,fpout,&parity);       /* VAL */
-    sprintf(mybuf,"\"%i\"",pos);           /* Location for USR */
+    sprintf(mybuf,"\"%li\"",pos);           /* Location for USR */
     writestring_p(mybuf,fpout,&parity);
     writebyte_p(0x0d,fpout,&parity);       /* ENTER (end of BASIC line) */
 
diff -ur z88dk/src/copt/copt.c z88dk-64bit/src/copt/copt.c
--- z88dk/src/copt/copt.c	2002-09-15 19:10:07.000000000 +0200
+++ z88dk-64bit/src/copt/copt.c	2007-12-07 12:34:34.000000000 +0100
@@ -507,12 +507,12 @@
 		/* check for activation rules */
 		if (o->o_new && strcmp(o->o_new->l_text, "%activate\n") == 0) {
 			/* we have to prevent repeated activation of rules */
-			char signature[160];
+			char signature[240];
 			struct lnode *lnp;
 			struct onode *nn, *last;
 			int skip = 0;
 			/* since we 'install()' strings, we can compare pointers */
-			sprintf(signature, "%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x\n",
+			sprintf(signature, (sizeof(char*)>4)?"%s%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx%016lx\n":"%s%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx%08lx\n",
 				activated,
 				vars[0], vars[1], vars[2], vars[3], vars[4],
 				vars[5], vars[6], vars[7], vars[8], vars[9]);
diff -ur z88dk/src/sccz80/io.c z88dk-64bit/src/sccz80/io.c
--- z88dk/src/sccz80/io.c	2006-06-18 15:03:13.000000000 +0200
+++ z88dk-64bit/src/sccz80/io.c	2007-12-07 11:51:57.000000000 +0100
@@ -336,7 +336,7 @@
 }
 
 
-void outdec(long number)
+void outdec(int number)
 {
         if ( number < 0 ) {
 		number=-number;
@@ -346,7 +346,7 @@
         outd2(number);
 }
 
-void outd2(long n)
+void outd2(int n)
 {
         if ( n > 9 ) {
                 outd2(n/10) ;
diff -ur z88dk/src/sccz80/io.h z88dk-64bit/src/sccz80/io.h
--- z88dk/src/sccz80/io.h	2006-06-18 15:03:13.000000000 +0200
+++ z88dk-64bit/src/sccz80/io.h	2007-12-07 11:51:48.000000000 +0100
@@ -24,8 +24,8 @@
 extern void ol(char *ptr);
 extern void ot(char *ptr);
 extern void blanks(void);
-extern void outdec(long number);
-extern void outd2(long n);
+extern void outdec(int number);
+extern void outd2(int n);
 extern void queuelabel(int);
 
 typedef struct {
diff -ur z88dk/src/sccz80/primary.c z88dk-64bit/src/sccz80/primary.c
--- z88dk/src/sccz80/primary.c	2007-07-05 20:39:00.000000000 +0200
+++ z88dk-64bit/src/sccz80/primary.c	2007-12-07 10:54:59.000000000 +0100
@@ -739,7 +739,7 @@
 	SYMBOL  *ptr;
     char    temp_type;
     int     itag;
-    char    nam[20];
+    char    nam[26];
 
 
 
@@ -794,7 +794,7 @@
  * returning pointers - to do this, we will define dummy symbols in
  * the local symbol table so that they do what we want them to do!
  */
-    sprintf(nam,"0dptr%d",(int)locptr);
+    sprintf(nam,"0dptr%lu",(unsigned long)locptr);
     temp_type = ( (lval->c_flags&FARPTR) ? CPTR : CINT );
     itag=0;
     if ( lval->c_tag) 
diff -ur z88dk/src/z80asm/config.h z88dk-64bit/src/z80asm/config.h
--- z88dk/src/z80asm/config.h	2007-06-24 18:41:41.000000000 +0200
+++ z88dk-64bit/src/z80asm/config.h	2007-12-07 12:30:55.000000000 +0100
@@ -64,6 +64,12 @@
 #define MAXCODESIZE 65536
 #endif
 
+#ifdef __linux__
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define ENDIAN 1
+#endif
+#else
 /* Some clever config-ing if we're using GNUC */
 #ifdef __BIG_ENDIAN__
 /* Sadly the compiler on OS-X falls over with the #if below... */
@@ -75,3 +81,4 @@
 #endif
 #endif	/* __GNUC__ */
 #endif
+#endif
diff -ur z88dk/src/z80asm/modlink.c z88dk-64bit/src/z80asm/modlink.c
--- z88dk/src/z80asm/modlink.c	2007-12-07 14:22:23.000000000 +0100
+++ z88dk-64bit/src/z80asm/modlink.c	2007-12-07 14:27:30.000000000 +0100
@@ -106,11 +106,11 @@
 int LinkLibModule (struct libfile *library, long curmodule, char *modname);
 int SearchLibfile (struct libfile *curlib, char *modname);
 char *ReadName (void);
-long ReadLong (FILE * fileid);
+int ReadLong (FILE * fileid);
 void redefinedmsg (void);
 void CreateLib (void);
 void SearchLibraries (char *modname);
-void WriteLong (long fptr, FILE * fileid);
+void WriteLong (int fptr, FILE * fileid);
 void LinkModules (void);
 void ModuleExpr (void);
 void CreateBinFile (void);
@@ -160,7 +160,7 @@
 ReadNames (long nextname, long endnames)
 {
   char scope, symtype;
-  long value;
+  int value;
   symbol *foundsymbol;
 
   do
@@ -509,7 +509,7 @@
   while (CURRENTMODULE != lastobjmodule->nextmodule);	/* parse only object modules, not added library modules */
 
   if (verbose == ON)
-    printf ("Code size of linked modules is %d bytes\n", CODESIZE);
+    printf ("Code size of linked modules is %lu bytes\n", (unsigned long) CODESIZE);
 
   if (ASMERROR == OFF)
     ModuleExpr ();		/*  Evaluate expressions in  all modules */
@@ -531,7 +531,7 @@
 int 
 LinkModule (char *filename, long fptr_base)
 {
-  long fptr_namedecl, fptr_modname, fptr_modcode, fptr_libnmdecl;
+  int fptr_namedecl, fptr_modname, fptr_modcode, fptr_libnmdecl;
   size_t lowbyte, highbyte, size;
   int flag = 0;
 
@@ -661,7 +661,7 @@
 SearchLibfile (struct libfile *curlib, char *modname)
 {
 
-  long currentlibmodule, modulesize, fptr_mname;
+  int currentlibmodule, modulesize, fptr_mname;
   int flag;
   char *mname;
 
@@ -755,8 +755,8 @@
 void 
 ModuleExpr (void)
 {
-  long fptr_namedecl, fptr_modname, fptr_exprdecl, fptr_libnmdecl;
-  long fptr_base;
+  int fptr_namedecl, fptr_modname, fptr_exprdecl, fptr_libnmdecl;
+  int fptr_base;
   struct linkedmod *curlink;
 
   if (verbose)
@@ -837,7 +837,7 @@
 	  *(reloctable + 3) = (unsigned short) sizeof_reloctable / 256U;/* total size of relocation table elements */
 
 	  fwrite (reloctable, 1U, sizeof_reloctable + 4, binaryfile);	/* write relocation table, inclusive 4 byte header */
-	  printf ("Relocation header is %d bytes.\n", sizeof_relocroutine + sizeof_reloctable + 4);
+	  printf ("Relocation header is %lu bytes.\n", (unsigned long) (sizeof_relocroutine + sizeof_reloctable + 4));
 	  fwrite (codearea, sizeof (char), CODESIZE, binaryfile);	/* write code as one big chunk */
 	  fclose (binaryfile);
 	}
@@ -880,9 +880,9 @@
 void 
 CreateLib (void)
 {
-  long Codesize;
+  int Codesize;
   FILE *objectfile = NULL;
-  long fptr;
+  int fptr;
   char *filebuffer, *fname;
 
   if (verbose)
@@ -1035,13 +1035,13 @@
 
 
 
-long 
+int 
 ReadLong (FILE * fileid)
 {
 
 #ifdef ENDIAN			/* high byte, low byte order... */
   int i;
-  unsigned long c, fptr = 0;
+  unsigned int c, fptr = 0;
 
   for (i = 1; i <= 3; i++)
     {
@@ -1052,7 +1052,7 @@
 
   return fptr;
 #else /* low byte, high byte order...    */
-  long fptr = 0;
+  int fptr = 0;
 
   /* long is *at least* 4 bytes long, and we have to write exactly 4 bytes */
   fread (&fptr, 4, 1, fileid);
@@ -1063,7 +1063,7 @@
 
 
 void 
-WriteLong (long fptr, FILE * fileid)
+WriteLong (int fptr, FILE * fileid)
 {
 #ifdef ENDIAN			/* high byte, low byte order... */
   int i;
diff -ur z88dk/src/z80asm/symbol.h z88dk-64bit/src/z80asm/symbol.h
--- z88dk/src/z80asm/symbol.h	2003-10-11 17:41:04.000000000 +0200
+++ z88dk-64bit/src/z80asm/symbol.h	2007-12-07 14:23:29.000000000 +0100
@@ -113,7 +113,7 @@
 
 struct libfile      { struct libfile    *nextlib;           /* pointer to next library file in list */
                       char              *libfilename;       /* filename of library (incl. extension) */
-                      long              nextobjfile;        /* file pointer to next object file in library */
+                      int               nextobjfile;        /* file pointer to next object file in library */
                     };
 
 struct linklist     { struct linkedmod  *firstlink;         /* pointer to first linked object module */
diff -ur z88dk/src/z80asm/z80asm.c z88dk-64bit/src/z80asm/z80asm.c
--- z88dk/src/z80asm/z80asm.c	2007-02-28 12:23:24.000000000 +0100
+++ z88dk-64bit/src/z80asm/z80asm.c	2007-12-07 11:06:37.000000000 +0100
@@ -826,7 +826,7 @@
     }
   if (*flagid == 'r')
     {
-      sscanf (flagid + 1, "%x", &EXPLICIT_ORIGIN);
+      sscanf (flagid + 1, "%lx", &EXPLICIT_ORIGIN);
       deforigin = ON;		/* explicit origin has been defined */
       return;
     }
diff -ur z88dk/src/z80asm/z80pass.c z88dk-64bit/src/z80asm/z80pass.c
--- z88dk/src/z80asm/z80pass.c	2002-05-11 22:09:38.000000000 +0200
+++ z88dk-64bit/src/z80asm/z80pass.c	2007-12-07 11:08:26.000000000 +0100
@@ -853,9 +853,9 @@
   fprintf (listfile, "%*.*s", 122 - strlen (_prog_name) - strlen (_version) - strlen (_copyright) - 3, strlen (date), date);
 #else
   fprintf (listfile, "%s", copyrightmsg);
-  fprintf (listfile, "%*.*s", (int) 122 - strlen (copyrightmsg), (int) strlen (date), date);
+  fprintf (listfile, "%*.*s", (int) (122 - strlen (copyrightmsg)), (int) strlen (date), date);
 #endif
-  fprintf (listfile, "Page %03d%*s'%s'\n\n\n", ++PAGENR, (int) 122 - 9 - 2 - strlen (lstfilename), "", lstfilename);
+  fprintf (listfile, "Page %03d%*s'%s'\n\n\n", ++PAGENR, (int) (122 - 9 - 2 - strlen (lstfilename)), "", lstfilename);
 }
 
 


Index: z88dk.spec
===================================================================
RCS file: /cvs/pkgs/rpms/z88dk/devel/z88dk.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- z88dk.spec	6 Dec 2007 08:08:32 -0000	1.10
+++ z88dk.spec	7 Dec 2007 14:28:26 -0000	1.11
@@ -1,15 +1,15 @@
 Summary: A Z80 cross compiler
 Name: z88dk
 Version: 1.7
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: Artistic clarified
 Group: Development/Tools
 Source: http://downloads.sourceforge.net/z88dk/z88dk-src-%{version}.tgz
 Patch0: z88make.patch
 Patch1: z88dk-1.7-makefile-fixes.patch
+Patch2: z88dk-1.7-64bit.patch
 URL: http://z88dk.sourceforge.net/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-ExcludeArch: x86_64 ia64 ppc64
 
 %description
 z88dk is a Z80 cross compiler capable of generating binary files for a variety
@@ -21,6 +21,8 @@
 %patch0 -p0
 # Lots of buggy makefiles there
 %patch1 -p1
+# 64-bit fixes
+%patch2 -p1
 %{_bindir}/find . -depth -name CVS -type d -exec %{__rm} -rf {} \;
 # Separate manpages from other docs and fix their permissions
 %{__mv} doc/netman .
@@ -76,6 +78,10 @@
 %{_mandir}/man3z/
 
 %changelog
+* Fri Dec 7 2007 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.7-2
+- patch for 64-bit issues (#185511)
+- drop ExcludeArch for 64-bit architectures (#185511)
+
 * Thu Dec 6 2007 Kevin Kofler <Kevin at tigcc.ticalc.org> - 1.7-1
 - update to 1.7
 - use preferred SF URL




More information about the fedora-extras-commits mailing list