pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/30138: lang/sablevm for amd64



>Number:         30138
>Category:       pkg
>Synopsis:       lang/sablevm for amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Thu May 05 11:42:00 +0000 2005
>Originator:     Gary Duzan
>Release:        NetBSD 3.99.3
>Organization:
        Not A Lot
>Environment:
System: NetBSD capo 3.99.3 NetBSD 3.99.3 (CAPO64) #6: Sat Apr 9 21:07:15 EDT 
2005 gary@capo:/src/sys/arch/amd64/compile/obj.amd64/CAPO64 amd64
Architecture: x86_64
Machine: amd64
>Description:
        lang/sablevm doesn't work on amd64.
>How-To-Repeat:
        Try building it.
>Fix:
        This patch works well enough to get a basic test going,
        but I make no claims as to its absolute correctness.


Index: distinfo
===================================================================
RCS file: /usr2/netbsd-cvs/pkgsrc/lang/sablevm/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo    24 Feb 2005 09:03:11 -0000      1.3
+++ distinfo    5 May 2005 10:28:24 -0000
@@ -3,3 +3,6 @@
 SHA1 (sablevm-1.1.3.tar.gz) = 7b38a3c12a1ddc7fe5eae37207d8b4b44412c050
 RMD160 (sablevm-1.1.3.tar.gz) = 3a172d3513ad5298457ab8bc77728beafd7d9311
 Size (sablevm-1.1.3.tar.gz) = 654232 bytes
+SHA1 (patch-aa) = 515722cd0f395063a475d625d91ecaccb706048b
+SHA1 (patch-ab) = 6b3e0347c6fd7aa2ee9917ca2f86086828bce48e
+SHA1 (patch-ac) = e1788a681c2711df054d2c8df1022673104ecaf6
Index: patches/patch-aa
===================================================================
RCS file: patches/patch-aa
diff -N patches/patch-aa
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-aa    5 May 2005 10:25:46 -0000
@@ -0,0 +1,10 @@
+--- src/libsablevm/include/jni_system_specific.h.orig  2004-04-12 
16:29:07.000000000 -0400
++++ src/libsablevm/include/jni_system_specific.h       2005-04-12 
07:57:41.000000000 -0400
+@@ -20,6 +20,7 @@
+     || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \
+     || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \
+     || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \
++    || defined (__x86_64__) \
+      ) && defined (__GNUC__))
+ 
+ #define JNICALL
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ab    5 May 2005 10:26:11 -0000
@@ -0,0 +1,35 @@
+--- src/libsablevm/system.c.orig       2004-04-12 16:29:08.000000000 -0400
++++ src/libsablevm/system.c    2005-04-12 09:07:12.000000000 -0400
+@@ -18,6 +18,7 @@ extern void __clear_cache (char *beg, ch
+     || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \
+     || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \
+     || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \
++    || defined (__x86_64__) \
+      ) && defined (__GNUC__))
+ 
+ /*
+@@ -222,6 +223,24 @@ _svmh_compare_and_swap (volatile _svmt_w
+                       :"memory");
+ /* *INDENT-ON* */
+ 
++#elif defined (__x86_64__)
++
++  /* On the x86_64, cmpxchgl has a side effect.  When swapping fails,
++     the following variable contains the value that is currently in
++     *pword (presumably different from old_value). */
++
++  _svmt_word current_value;
++  _svmt_u8 result;
++
++/* *INDENT-OFF* */
++  __asm__ __volatile__ ("lock\n\t"
++                      "cmpxchgl %3, %1\n\t"
++                      "sete %0"
++                      :"=q" (result), "=m" (*pword), "=a" (current_value)
++                      :"r" (new_value), "m" (*pword), "a" (old_value)
++                      :"memory");
++/* *INDENT-ON* */
++
+ #elif defined (__ia64__)
+ 
+ #include <ia64intrin.h>
Index: patches/patch-ac
===================================================================
RCS file: patches/patch-ac
diff -N patches/patch-ac
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-ac    5 May 2005 10:26:30 -0000
@@ -0,0 +1,36 @@
+--- src/libsablevm/system.h.orig       2004-04-12 16:29:08.000000000 -0400
++++ src/libsablevm/system.h    2005-04-12 08:48:22.000000000 -0400
+@@ -54,6 +54,7 @@ int main (int argc, char *argv[])
+     || defined (__i386__) || defined (__powerpc__) || defined (__s390__) \
+     || defined (__hppa__) || defined (__arm__) || defined (__m68k__) \
+     || defined (__mc68000__) || defined (__mips__) || defined (__mipsel__) \
++    || defined (__x86_64__) \
+      ) && defined (__GNUC__))
+ 
+ /* "inline" is now an official keyword since the latest C standard (1999).
+@@ -136,6 +137,25 @@ typedef _svmt_f32 _svmt_float_word;
+ #include <inlined_i386-gcc-3.3.h>
+ #endif /* (GCC_VERSION >= 2095) && (GCC_VERSION <3000) */
+ 
++#elif defined (__x86_64__)
++
++typedef _svmt_u32 _svmt_word;
++typedef _svmt_f32 _svmt_float_word;
++
++#define SVM_WORD_SIZE 4               /* size in bytes */
++#define SVM_WORD_BIT_COUNT 32 /* size in bits */
++
++/* see comments at the head of this file */
++#define SVM_ALIGNMENT 8
++#define SVM_ALIGNMENT_POWER 3 /* 2 ^^ SVM_ALIGNMENT_POWER == SVM_ALIGNMENT */
++#define SVM_PAGE_SIZE 4096
++
++#if   (GCC_VERSION >= 2095) && (GCC_VERSION <3000)
++#include <inlined_i386-gcc-2.95.h>
++#else
++#include <inlined_i386-gcc-3.3.h>
++#endif /* (GCC_VERSION >= 2095) && (GCC_VERSION <3000) */
++
+ #elif defined (__ia64__)
+ 
+ typedef _svmt_u64 _svmt_word;




Home | Main Index | Thread Index | Old Index