summaryrefslogtreecommitdiff
path: root/lang/clisp/patches
diff options
context:
space:
mode:
authorjmc <jmc@pkgsrc.org>2002-03-14 07:44:21 +0000
committerjmc <jmc@pkgsrc.org>2002-03-14 07:44:21 +0000
commit713cf9a1c6b5e4e2d4b06724507e7b2dec24293e (patch)
tree63e057b891075c39a48955327a50faa07c936427 /lang/clisp/patches
parenta21faa53fc30fad739f6fc70ef621346e7d25b6d (diff)
downloadpkgsrc-713cf9a1c6b5e4e2d4b06724507e7b2dec24293e.tar.gz
Port to powerpc:
Provide a trampoline implementation that doesn't presume r11 is free (it's not in dynamically linked programs and the ELF ABI says as much but somehow linux managed to avoid this it seems). Use r13 for the time being since while gcc will allocate it, it's the last "local" one allocated so none of the clisp code hits that (nothing needed 17+ local registers in use ever). Update the vacall implementation to match the trampoline calls but otherwise for any assembly use the linux code. Make these changes specific to netbsd, update the test cases so everything works. This now passes all the clisp tests when done/installed.
Diffstat (limited to 'lang/clisp/patches')
-rw-r--r--lang/clisp/patches/patch-ab20
-rw-r--r--lang/clisp/patches/patch-ac18
-rw-r--r--lang/clisp/patches/patch-ad19
-rw-r--r--lang/clisp/patches/patch-ae13
-rw-r--r--lang/clisp/patches/patch-af22
-rw-r--r--lang/clisp/patches/patch-ag16
-rw-r--r--lang/clisp/patches/patch-ah79
7 files changed, 187 insertions, 0 deletions
diff --git a/lang/clisp/patches/patch-ab b/lang/clisp/patches/patch-ab
new file mode 100644
index 00000000000..f5b51f87779
--- /dev/null
+++ b/lang/clisp/patches/patch-ab
@@ -0,0 +1,20 @@
+$NetBSD: patch-ab,v 1.4 2002/03/14 07:44:23 jmc Exp $
+
+--- .././ffcall/avcall/Makefile.in.orig Tue Jun 12 07:31:01 2001
++++ .././ffcall/avcall/Makefile.in Wed Mar 6 05:38:16 2002
+@@ -117,12 +117,12 @@
+ case "$(OS)" in \
+ aix3*) syntax=aix.old;; \
+ aix*) syntax=aix.new;; \
+- linux*) syntax=linux;; \
++ linux* | netbsd*) syntax=linux;; \
+ *) syntax=sysv4;; \
+ esac; \
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-rs6000-$${syntax}.s ; \
+- cp avcall-rs6000-$${syntax}.lo avcall-rs6000.lo ; rm -f avcall-rs6000-$${syntax}.lo ; \
+- if test -f avcall-rs6000-$${syntax}.o; then mv avcall-rs6000-$${syntax}.o avcall-rs6000.o; fi
++ cp avcall-rs6000-$${syntax}.lo avcall-rs6000.lo ; \
++ if test -f avcall-rs6000-$${syntax}.o; then cp avcall-rs6000-$${syntax}.o avcall-rs6000.o; fi
+
+ avcall-m88k.lo : $(srcdir)/avcall-m88k.s
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/avcall-m88k.s
diff --git a/lang/clisp/patches/patch-ac b/lang/clisp/patches/patch-ac
new file mode 100644
index 00000000000..f7293a7d226
--- /dev/null
+++ b/lang/clisp/patches/patch-ac
@@ -0,0 +1,18 @@
+$NetBSD: patch-ac,v 1.4 2002/03/14 07:44:23 jmc Exp $
+
+--- .././ffcall/vacall/Makefile.in.orig Tue Mar 5 09:50:39 2002
++++ .././ffcall/vacall/Makefile.in Wed Mar 6 05:38:50 2002
+@@ -108,11 +108,11 @@
+ case "$(OS)" in \
+ aix3*) syntax=aix.old;; \
+ aix*) syntax=aix.new;; \
+- linux*) syntax=linux;; \
++ linux* | netbsd*) syntax=linux;; \
+ *) syntax=sysv4;; \
+ esac; \
+ $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; \
+- mv vacall-rs6000-$${syntax}.o vacall-rs6000.o
++ cp vacall-rs6000-$${syntax}.o vacall-rs6000.o
+
+ vacall-m88k.o : $(srcdir)/vacall-m88k.s
+ $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
diff --git a/lang/clisp/patches/patch-ad b/lang/clisp/patches/patch-ad
new file mode 100644
index 00000000000..a3ae8a80c97
--- /dev/null
+++ b/lang/clisp/patches/patch-ad
@@ -0,0 +1,19 @@
+$NetBSD: patch-ad,v 1.4 2002/03/14 07:44:23 jmc Exp $
+
+--- ../ffcall/callback/vacall_r/Makefile.in.orig Tue Jun 12 07:31:01 2001
++++ ../ffcall/callback/vacall_r/Makefile.in Thu Mar 14 07:13:43 2002
+@@ -118,11 +118,12 @@
+ aix3*) syntax=aix.old;; \
+ aix*) syntax=aix.new;; \
+ linux*) syntax=linux;; \
++ netbsd*) syntax=netbsd;; \
+ *) syntax=sysv4;; \
+ esac; \
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-rs6000-$${syntax}.s ; \
+- cp vacall-rs6000-$${syntax}.lo vacall-rs6000.lo ; rm -f vacall-rs6000-$${syntax}.lo ; \
+- if test -f vacall-rs6000-$${syntax}.o; then mv vacall-rs6000-$${syntax}.o vacall-rs6000.o; fi
++ cp vacall-rs6000-$${syntax}.lo vacall-rs6000.lo ; \
++ if test -f vacall-rs6000-$${syntax}.o; then cp vacall-rs6000-$${syntax}.o vacall-rs6000.o; fi
+
+ vacall-m88k.lo : $(srcdir)/vacall-m88k.s
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/vacall-m88k.s
diff --git a/lang/clisp/patches/patch-ae b/lang/clisp/patches/patch-ae
new file mode 100644
index 00000000000..eb56286eca0
--- /dev/null
+++ b/lang/clisp/patches/patch-ae
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.4 2002/03/14 07:44:23 jmc Exp $
+
+--- ../ffcall/callback/trampoline_r/Makefile.in.orig Tue Mar 5 09:57:45 2002
++++ ../ffcall/callback/trampoline_r/Makefile.in Tue Mar 5 09:57:54 2002
+@@ -90,7 +90,7 @@
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-hppa.s
+
+ cache-rs6000.lo : $(srcdir)/cache-rs6000-sysv4.s
+- $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-rs6000-sysv4.s ; mv -f cache-rs6000-sysv4.o cache-rs6000.o ; mv -f cache-rs6000-sysv4.lo cache-rs6000.lo
++ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-rs6000-sysv4.s ; cp cache-rs6000-sysv4.o cache-rs6000.o ; mv cache-rs6000-sysv4.lo cache-rs6000.lo
+
+ cache-convex.lo : $(srcdir)/cache-convex.s
+ $(LIBTOOL_COMPILE) $(CC) @GCC_X_NONE@ -c $(srcdir)/cache-convex.s
diff --git a/lang/clisp/patches/patch-af b/lang/clisp/patches/patch-af
new file mode 100644
index 00000000000..9bcde07ce0d
--- /dev/null
+++ b/lang/clisp/patches/patch-af
@@ -0,0 +1,22 @@
+$NetBSD: patch-af,v 1.3 2002/03/14 07:44:23 jmc Exp $
+
+--- lispbibl.d.orig Tue Mar 5 20:53:41 2002
++++ lispbibl.d Tue Mar 5 20:55:32 2002
+@@ -1400,7 +1400,7 @@
+ #define intBWsize intBsize
+ #define intWLsize intWsize
+ #define intBWLsize intBsize
+- #elif (defined(MC680X0) && defined(HPUX_ASSEMBLER)) || defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(M88000) || defined(RS6000) || defined(CONVEX) || defined(S390)
++ #elif (defined(MC680X0) && defined(HPUX_ASSEMBLER)) || defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(M88000) || defined(RS6000) || defined(CONVEX) || defined(S390) || defined(__powerpc__)
+ # Der Sparc-Prozessor kann mit uintB und uintW schlecht rechnen.
+ # Anderen 32-Bit-Prozessoren geht es genauso.
+ #define intBWsize intWsize
+@@ -1593,7 +1593,7 @@
+ #define intDsize 16
+ #define intDDsize 32 # = 2*intDsize
+ #define log2_intDsize 4 # = log2(intDsize)
+- #elif defined(MC680Y0) || defined(I80386) || defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(M88000) || defined(RS6000) || defined(VAX) || defined(CONVEX) || defined(ARM) || defined(DECALPHA) || defined(IA64) || defined(S390)
++ #elif defined(MC680Y0) || defined(I80386) || defined(SPARC) || defined(HPPA) || defined(MIPS) || defined(M88000) || defined(RS6000) || defined(VAX) || defined(CONVEX) || defined(ARM) || defined(DECALPHA) || defined(IA64) || defined(S390) || defined(__powerpc__)
+ #define intDsize 32
+ #define intDDsize 64 # = 2*intDsize
+ #define log2_intDsize 5 # = log2(intDsize)
diff --git a/lang/clisp/patches/patch-ag b/lang/clisp/patches/patch-ag
new file mode 100644
index 00000000000..788019f9d13
--- /dev/null
+++ b/lang/clisp/patches/patch-ag
@@ -0,0 +1,16 @@
+$NetBSD: patch-ag,v 1.1 2002/03/14 07:44:23 jmc Exp $
+
+--- ../ffcall/callback/trampoline_r/test1.c.orig Thu Mar 14 07:22:04 2002
++++ ../ffcall/callback/trampoline_r/test1.c Thu Mar 14 07:22:07 2002
+@@ -69,7 +69,11 @@
+ register void* env __asm__("r12");
+ #endif
+ #ifdef __rs6000__
++#ifdef __NetBSD__
++register void* env __asm__("r13");
++#else
+ register void* env __asm__("r11");
++#endif
+ #endif
+ #ifdef __m88k__
+ register void* env __asm__("r11");
diff --git a/lang/clisp/patches/patch-ah b/lang/clisp/patches/patch-ah
new file mode 100644
index 00000000000..c44067c027b
--- /dev/null
+++ b/lang/clisp/patches/patch-ah
@@ -0,0 +1,79 @@
+$NetBSD: patch-ah,v 1.1 2002/03/14 07:44:23 jmc Exp $
+
+--- ../ffcall/callback/trampoline_r/trampoline.c.orig Thu Mar 14 07:23:32 2002
++++ ../ffcall/callback/trampoline_r/trampoline.c Thu Mar 14 07:23:35 2002
+@@ -21,12 +21,16 @@
+ #endif
+ #endif
+ #if defined(__rs6000__)
++#if defined(__NetBSD__)
++#define __powerpcnetbsd__
++#else
+ #if !defined(_AIX)
+ #define __rs6000sysv4__ /* SysV.4 ABI, real machine code. */
+ #else
+ #define __rs6000aix__ /* AIX ABI, just a closure. */
+ #endif
+ #endif
++#endif
+ #if defined(__hppanew__)
+ /*
+ * A function pointer is a biased pointer to a data area whose first word
+@@ -259,7 +263,7 @@
+ #include <sys/syslocal.h>
+ #endif
+ /* Inline assembly function for instruction cache flush. */
+-#if defined(__sparc__) || defined(__sparc64__) || defined(__alpha__) || defined(__hppaold__) || defined(__rs6000sysv4__) || defined(__convex__)
++#if defined(__sparc__) || defined(__sparc64__) || defined(__alpha__) || defined(__hppaold__) || defined(__rs6000sysv4__) || defined(__convex__) || defined(__powerpcnetbsd__)
+ #ifdef __GNUC__
+ extern inline
+ #if defined(__sparc__) || defined(__sparc64__)
+@@ -336,7 +340,7 @@
+ #define TRAMP_LENGTH 32
+ #define TRAMP_ALIGN 4
+ #endif
+-#ifdef __rs6000sysv4__
++#if defined(__rs6000sysv4__) || defined(__powerpcnetbsd__)
+ #define TRAMP_LENGTH 24
+ #define TRAMP_ALIGN 4
+ #endif
+@@ -872,6 +876,39 @@
+ #define is_tramp(function) \
+ *(unsigned short *) (function + 0) == 0x3D60 && \
+ *(unsigned short *) (function + 4) == 0x616B && \
++ *(unsigned short *) (function + 8) == 0x3C00 && \
++ *(unsigned short *) (function +12) == 0x6000 && \
++ *(unsigned long *) (function +16) == 0x7C0903A6 && \
++ *(unsigned long *) (function +20) == 0x4E800420
++#define hilo(hiword,loword) \
++ (((unsigned long) (hiword) << 16) | (unsigned long) (loword))
++#define tramp_address(function) \
++ hilo(*(unsigned short *) (function +10), *(unsigned short *) (function +14))
++#define tramp_data(function) \
++ hilo(*(unsigned short *) (function + 2), *(unsigned short *) (function + 6))
++#endif
++#ifdef __powerpcnetbsd__
++ /* function:
++ * {liu|lis} 13,hi16(<data>) 3D A0 hi16(<data>)
++ * {oril|ori} 13,13,lo16(<data>) 61 AD lo16(<data>)
++ * {liu|lis} 0,hi16(<address>) 3C 00 hi16(<address>)
++ * {oril|ori} 0,0,lo16(<address>) 60 00 lo16(<address>)
++ * mtctr 0 7C 09 03 A6
++ * bctr 4E 80 04 20
++ */
++ *(short *) (function + 0) = 0x3DA0;
++ *(short *) (function + 2) = (unsigned long) data >> 16;
++ *(short *) (function + 4) = 0x61AD;
++ *(short *) (function + 6) = (unsigned long) data & 0xffff;
++ *(short *) (function + 8) = 0x3C00;
++ *(short *) (function +10) = (unsigned long) address >> 16;
++ *(short *) (function +12) = 0x6000;
++ *(short *) (function +14) = (unsigned long) address & 0xffff;
++ *(long *) (function +16) = 0x7C0903A6;
++ *(long *) (function +20) = 0x4E800420;
++#define is_tramp(function) \
++ *(unsigned short *) (function + 0) == 0x3DA0 && \
++ *(unsigned short *) (function + 4) == 0x61AD && \
+ *(unsigned short *) (function + 8) == 0x3C00 && \
+ *(unsigned short *) (function +12) == 0x6000 && \
+ *(unsigned long *) (function +16) == 0x7C0903A6 && \