Re: Odonata+SableVM+Classpath works! (and bootclasspath question)

2004-04-07 Thread David Bélanger
On Mon, Apr 05, 2004 at 10:14:11AM +0100, S. Meslin-Weber wrote:
 Hi everyone,
 
 As reported on #sablevm I'm happy to say that Odonata[1] runs well under
 SableVM. I haven't measured any speeds or memory usage but with regards
 to visual output SableVM is on a par with GIJ (both use GNU Classpath,
 I know, but I didn't want to assume that all JVM using GNU Classpath
 would give the same results). I believe that the GNUClasspath AWT is the
 cause of any visual/behavioural discrepancies I see when running Odonata
 on SableVM (and GIJ) and on Sun's 1.4.2 Java2 SDK.
 

Hi,

Good work!

 On a related note, I develop Odonata against Sun's 1.4.2 Java2 SDK and
 make use of the -Xbootclasspath/p feature to prepend my classes ahead of
 the JVM's own classes so that mine will be loaded in preference to any
 default ones.
 
 With SableVM I had to resort to extracting my jar file *over* SableVM's
 core classpath installation. This is due to the bootclasspath argument
 in SableVM seemingly not being able to take more than one path. Ideally,
 Sun-like arguments to override, append or prepend to the bootclasspath
 would be highly beneficial.
 

Yes, this functionality is currently not in SableVM.

In case you or some SableVM developer is interested, it should
be relatively easy to change the code in:
function _svmh_bootcl_internal_load_class_file
in file src/libsablevm/class_loader.c
to parse the boot class path property for multiple paths.

This will allow an override but with multiple paths.  Ex:
your_path:sablevm_boot_classpath

The next step will consist of playing with src/sablevm/sablevm.c
to add append, prepend options.



David

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


darwin / OS X support - revisited

2004-01-24 Thread David Bélanger

Hi,

Chris Hoffmann from the JikesRVM team sent a patch some time ago for
Mac OS X support.
(see: http://mail.gnu.org/archive/html/classpath/2003-10/msg00032.html)

I adapted his work to suit more the target native framework.

Basically, what I did is:
1) Copy the Linux target directory to a Darwin directory.  (Darwin is
the name of the Unix system under Mac OS X).
2) Modified configure.ac/Makefile to use it.

Note: The diff between Darwin and Linux are quite small, basically 2
lines but I still added a arch.

Note: I am not a Darwin/OS X expert by the way.


From the original patch:

+#if (defined( __BIG_ENDIAN__)  defined( __APPLE__ ))
+#define __IEEE_BIG_ENDIAN
+#endif 
+
+

I did not use that.  I simply set CPPFLAGS as -D__PPC__ -D_BIG_ENDIAN
when compiling and leave that file untouched.  It may be tempting to add
a __APPLE__ beside the __AIX__, but __PPC__ is not defined by gcc and
we still need the CPPFLAGS anyway.  Unless we do a completely separte #ifdef
__APPLE__... not under the #ifdef __PPC__.


-  INIT_FIELD (in, 0);
-  INIT_FIELD (out, 1);
-  INIT_FIELD (err, 2);
+  INIT_FIELD (in, ((long long)0));
+  INIT_FIELD (out, ((long long)1));
+  INIT_FIELD (err, ((long long)2));

I did not do that part either.  Seem to work fine.


+#ifndef O_SYNC
+#undef TARGET_NATIVE_FILE_FILEFLAG_SYNC
+#define TARGET_NATIVE_FILE_FILEFLAG_SYNC O_FSYNC
+#endif

Here the problem is that O_FSYNC is be defined in fcntl.h.
However, fcntl.h is not included for the constant in the generic file.
On Linux works fine,
OS X don't like it.  So either the Linux fcntl.h gets included
by some other include etc.  Would need investigation.

What I did, is to add a #include in the Darwin specific target file.

Finally, for:
+#ifdef __MACH__
+typedef intsocklen_t;   
+#endif

I simply added it (without the #ifdef) to the network target specific
file.

David
SableVM developer

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt

Index: native/target/Darwin/target_native_math_float.h
===
--- native/target/Darwin/target_native_math_float.h (revision 1442)
+++ native/target/Darwin/target_native_math_float.h (revision 1477)
@@ -0,0 +1,80 @@
+/* ???.h - ???
+   Copyright (C) 1998 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+ 
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version. */
+
+/*
+Description: Darwin target defintions of float/double constants/
+ macros/functions
+Systems: all
+*/
+
+#ifndef __TARGET_NATIVE_MATH_FLOAT__
+#define __TARGET_NATIVE_MATH_FLOAT__
+
+/** Includes ***/
+/* do not move; needed here because of some macro definitions */
+#include config.h
+
+#include stdlib.h
+
+/** Conditional compilation switches ***/
+
+/* Constants ***/
+
+/* Datatypes ***/
+
+/* Variables ***/
+
+/** Macros */
+
+/* Functions ***/
+
+#ifdef

small compilation problem fix

2004-01-20 Thread David Bélanger

Hi,

Small bug fix.  Some gtk code does not compile since it is
not official C standard code: variable declaration after statements.

The patch attached fixes it.

FYI, we just updated SableVM ( http://www.sablevm.org/ ) with a yesterday
Classpath CVS snapshot in our staging branch.
http://devel.sablevm.org/wiki/Getting for info on how to get it.


David

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt

Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
===
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c   (revision 1440)
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c   (working copy)
@@ -249,9 +249,11 @@
 item_activate (GtkItem *item __attribute__((unused)),
   struct item_event_hook_info *ie)
 {
+  jstring label;
+
   gdk_threads_leave ();
 
-  jstring label = (*gdk_env)-NewStringUTF (gdk_env, ie-label);
+  label = (*gdk_env)-NewStringUTF (gdk_env, ie-label);
   (*gdk_env)-CallVoidMethod (gdk_env, ie-peer_obj,
  choicePostItemEventID,
  label,
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [Sablevm-developer] Sockets in 0.07 might be broken on some non-intel arches

2003-12-07 Thread David Bélanger

Actually, that could explain why I got so many more Mauve test cases
passed on x86.  I was getting less this weekend and was puzzled, but
because I changed arch...

It may be related to small/big endian issues.

David


On Sat, Dec 06, 2003 at 11:59:07PM -0500, Grzegorz B. Prokopski wrote:
 Hi!
 
 It really intrigued me when Mark said that Sockets work for him with
 development [1] version of SableVM (which uses latest GNU Classpath).
 
 After doing some tests and many compilations I figured out that the
 error doesn't show up on my Intel machine but does on Sparc:
 
 [EMAIL PROTECTED]:~/sablebot$ ../usr/bin/sablevm -Y sb
 java.net.SocketException: Invalid argument
at gnu.java.net.PlainSocketImpl.getOption (PlainSocketImpl.java)
at gnu.java.net.PlainSocketImpl.connect (PlainSocketImpl.java:216)
at java.net.Socket.connect (Socket.java:402)
at java.net.Socket.connect (Socket.java:366)
at java.net.Socket.Socket (Socket.java:292)
at java.net.Socket.Socket (Socket.java:149)
at sb.main (sb.java:9)
at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
at java.lang.VirtualMachine.main (VirtualMachine.java:88)
 
 The code of sb.java is simply this:
 
 import java.net.*;
 public class sb
 {
public static void main(String[] args) throws Exception
{
   java.net.Socket socket = new java.net.Socket(irc.sablevm.org,
 6667);
   System.out.println(socket);
}
 }
 
 I have no time now to track it further. I belive that it's probably
 a problem in Classpath but Cc:ing SableVM-devel just in case.
 
 HTH
 
   Grzegorz B. Prokopski
 
 [1] http://devel.sablevm.org
 
 -- 
 Grzegorz B. Prokopski [EMAIL PROTECTED]
 Debian GNU/Linux  http://www.debian.org
 SableVM - LGPLed JVM  http://www.sablevm.org
 
 
 
 ---
 This SF.net email is sponsored by: IBM Linux Tutorials.
 Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
 Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
 Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
 ___
 Sablevm-developer mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/sablevm-developer

-- 

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [Sablevm-developer] Sockets in 0.07 might be broken on some non-intel arches

2003-12-07 Thread David Bélanger

Actually, not really, I'm getting about the same Mauve results on both
my platforms now (x86 and ppc).  So ignore my previous comments.

BTW, I tested your code on Linux/ppc and it worked.  So, it may be sparc
specific.


David


On Sun, Dec 07, 2003 at 04:46:17PM -0500, David Bélanger wrote:
 
 Actually, that could explain why I got so many more Mauve test cases
 passed on x86.  I was getting less this weekend and was puzzled, but
 because I changed arch...
 
 It may be related to small/big endian issues.
 
 David
 
 
 On Sat, Dec 06, 2003 at 11:59:07PM -0500, Grzegorz B. Prokopski wrote:
  Hi!
  
  It really intrigued me when Mark said that Sockets work for him with
  development [1] version of SableVM (which uses latest GNU Classpath).
  
  After doing some tests and many compilations I figured out that the
  error doesn't show up on my Intel machine but does on Sparc:
  
  [EMAIL PROTECTED]:~/sablebot$ ../usr/bin/sablevm -Y sb
  java.net.SocketException: Invalid argument
 at gnu.java.net.PlainSocketImpl.getOption (PlainSocketImpl.java)
 at gnu.java.net.PlainSocketImpl.connect (PlainSocketImpl.java:216)
 at java.net.Socket.connect (Socket.java:402)
 at java.net.Socket.connect (Socket.java:366)
 at java.net.Socket.Socket (Socket.java:292)
 at java.net.Socket.Socket (Socket.java:149)
 at sb.main (sb.java:9)
 at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)
 at java.lang.VirtualMachine.main (VirtualMachine.java:88)
  
  The code of sb.java is simply this:
  
  import java.net.*;
  public class sb
  {
 public static void main(String[] args) throws Exception
 {
java.net.Socket socket = new java.net.Socket(irc.sablevm.org,
  6667);
System.out.println(socket);
 }
  }
  
  I have no time now to track it further. I belive that it's probably
  a problem in Classpath but Cc:ing SableVM-devel just in case.
  
  HTH
  
  Grzegorz B. Prokopski
  
  [1] http://devel.sablevm.org
  
  -- 
  Grzegorz B. Prokopski [EMAIL PROTECTED]
  Debian GNU/Linux  http://www.debian.org
  SableVM - LGPLed JVM  http://www.sablevm.org
  
  
  
  ---
  This SF.net email is sponsored by: IBM Linux Tutorials.
  Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
  Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
  Click now! http://ads.osdn.com/?ad_id=1278alloc_id=3371op=click
  ___
  Sablevm-developer mailing list
  [EMAIL PROTECTED]
  https://lists.sourceforge.net/lists/listinfo/sablevm-developer
 
 -- 
 
 ---
 
 David Bélanger
 Graduate Student
 School of Computer Science
 McGill University
 Office: MC226
 
 Web page:   http://www.cs.mcgill.ca/~dbelan2/
 Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt
 
 
 
 ---
 This SF.net email is sponsored by: IBM Linux Tutorials.
 Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
 Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
 Click now! http://ads.osdn.com/?ad_id78alloc_id371opÌk
 ___
 Sablevm-developer mailing list
 [EMAIL PROTECTED]
 https://lists.sourceforge.net/lists/listinfo/sablevm-developer
 

-- 

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


patch ZipFile

2003-11-24 Thread David Bélanger

Classpath developers,

The SableVM developers are moving to Classpath 0.06.  I will start
sending bug fixes found in Classpath.

The first one is in ZipFile.  See patch included.
The current Classpath implementation removes the path component
from the name when the JarFile is created with new ZipFile(new
File(name)).

Sun's JDK does not remove the path, getName() always return the name
specified in the constructor of ZipFile or File.

(Without this fix, it is impossible to load jar files with the
SystemClassLoader that are not located in the current directory).



David


---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt

Index: java/util/zip/ZipFile.java
===
--- java/util/zip/ZipFile.java  (revision 1011)
+++ java/util/zip/ZipFile.java  (revision 1075)
@@ -105,7 +105,7 @@
   public ZipFile(File file) throws ZipException, IOException
   {
 this.raf = new RandomAccessFile(file, r);
-this.name = file.getName();
+this.name = file.getPath();
   }
 
   /**
@@ -134,7 +134,7 @@
  (OPEN_DELETE mode not supported yet in java.util.zip.ZipFile);
   }
 this.raf = new RandomAccessFile(file, r);
-this.name = file.getName();
+this.name = file.getPath();
   }
 
   /**
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


File.list()

2003-11-24 Thread David Bélanger

Hi,

This may be some trace left from a old bug.

File: java/io/File.java.


A long time ago, there was a bug with listInternals as it was
not returning an empty array for no files.  This has been
fixed since then and listInternals returns only NULL on error.
If there are no files, it correctly returns a String array
of length 0.

The current implementation of Filelists is as follows:

-
  public String[] list (FilenameFilter filter)
  {
checkRead ();

// Get the list of files
String list_path = PlatformHelper.removeTailSeparator(path);
File dir = new File(list_path);

if (! dir.exists() || ! dir.isDirectory() ) return null;

String files[] = listInternal(list_path);

-- if (files == null)
--   return new String[0];
if (filter == null)
  return files;


Note: From the current implementation of listInternal, it will return NULL
  only on error, and it will correctly return new String[0] if
  the directory is empty.  (I checked with gdb to make sure).

So, I suggest something like:
if (files == null) {
  throw new IOException(Unknown IO Exception);
}
I am assuming some JCL_* functions set exceptions on errors (did not study
them) but this may get other exceptional cases.


Let me know if it makes sense.


David


---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


java_io_File.c deletelocalref and cl in ObjectInputStream

2003-11-24 Thread David Bélanger

Hi,

These are 2 more changes that were done on the old Classpath used in SableVM
but are not currently found in the most recent Classpath.

I think Etienne did these two changes, I'm not sure.  Maybe Etienne
could answer your questions on these.

java_io_File.c: Basically, it frees a local ref, I guess otherwise it may
run out of local refs for a long directory listing.

ObjectInputStream.java: I don't understand ClassLoader enough to explain this
one.



David



---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt

Index: native/jni/java-io/java_io_File.c
===
--- native/jni/java-io/java_io_File.c   (revision 1011)
+++ native/jni/java-io/java_io_File.c   (revision 1076)
@@ -682,6 +682,7 @@
 
   /* save into array */
   (*env)-SetObjectArrayElement(env, filearray, i, str);
+  (*env)-DeleteLocalRef (env, str);
 }
 
   /* free resources */
Index: java/io/ObjectInputStream.java
===
--- java/io/ObjectInputStream.java  (revision 1011)
+++ java/io/ObjectInputStream.java  (revision 1076)
@@ -559,7 +559,7 @@
 if (cl == null)
   return Class.forName (osc.getName ());
 else
-  return cl.loadClass (osc.getName ());
+  return Class.forName (osc.getName (), false, cl);
   }
 
   /**
___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: porting to another jvm/jit

2003-10-07 Thread David Bélanger
On Tue, Oct 07, 2003 at 08:46:44PM +0200, Joseph Wenninger wrote:
 Hi
 
 I'm porting a jvm/jit for a university project to the gnu classpath,
 since it is nearly impossible to support the sun jre, if you can't sign
 the sun community license, and  therefor don't have the sun-namespaces
 sources.
 
 I have done a quick hack for testing purposes, but how would I cleanly
 integrate the classpath? My question is, how other jvm developers cope
 with the the VM*.c files ? Do they have to be in the classpath
 hierarchy, or can I somehow create a static classpath lib and than link
 that one against my own, which contains the VM specific implementations
 ?

In SableVM, all the VM specific java_lang_VM*.c are located in the
SableVM source tree and are compiled with the other SableVM code.  Most of
these need accesses to internal data structures and functions.

David

 
 
 
 Off-topic:
 By the way, we would like to support jdk 1.2 class files (major 45,
 minor 3). I tried to compile the classpath with jikes -source 1.2
 -target 1.2, but it looks like jikes 1.18 doesn't really work with that.
 Did anybody try that ? Is there another usable compiler for jre 1.2
 compatible class files ?  With jikes I get wrong
 [Field|Method|InterfaceMethod]Ref infos structures for many classes,
 they point into the constant pool to array constants instead of object
 constants. According to my knowledge that's wrong.
 Could it be a problem of how the classpath is compiled ?
 
 
 
 
 I'm using the 0.06 tarball
 
 Thanks in advance for any information/help
 
 Kind regards
 Joseph Wenninger
 
 
 
 ___
 Classpath mailing list
 [EMAIL PROTECTED]
 http://mail.gnu.org/mailman/listinfo/classpath

-- 

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


SableVM and Classpath 0.06

2003-09-03 Thread David Bélanger

Classpath and SableVM developers,

I started merging Classpath 0.06 with SableVM.  My goal is to
minimize the number of changes required in Classpath and SableVM.

In the next few days / weeks, I will start giving some feedback to the
Classpath team.  (I couldn't wait to announce it!)

Most work is currently done.  As a test, I was able to run Ant with SableVM
/ Classpath 0.06 to build successfully SableCC.

People interested in using/testing SableVM/Classpath 0.06 may get it from
the SableVM svn repository.  Note that it is still experimental.  It
will get much stable in the next few weeks.

It is located in:
/developers/belanger/sandbox/sablevm-classpath/

Info on how to access the svn repository is here:
http://sourceforge.net/mailarchive/forum.php?thread_id=2629744forum_id=4154

SableVM is built as before.
Look at
/developers/belanger/sandbox/sablevm-classpath/bin/build_classpath
to know how to build classpath for SableVM.
You will have to do symlinks to map Classpath library names to
SableVM library names.  Look at:
/developers/belanger/sandbox/sablevm-classpath/bin/make_symlinks


David


---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath


Re: [Classpathx-discuss] [gnujaxp] javax.xml.* conform to jaxp1.1

2003-08-25 Thread David Bélanger
On Sun, Aug 24, 2003 at 03:53:01PM +0200, Arnaud Vandyck wrote:
 On 22 Aug 2003 11:05:25 +0100
 Nic [EMAIL PROTECTED] wrote:
 
  Would Debian have  a problem with this? It's just  a dependancy on the
  package isn't it? Most people will already have libxml2 I suspect.
 
 No problem with Debian. But maybe  with other JDK/ JRE. What does kaffe,
 sablevm, jikes, gcj and so think about this?

There should not be any problem with SableVM as long as the library is
available for the underlying OS.

David,
SableVM Developer

 
 -- Arnaud Vandyck, STE fi, ULg
Formateur Cellule Programmation.
 
 
 ___
 Classpath mailing list
 [EMAIL PROTECTED]
 http://mail.gnu.org/mailman/listinfo/classpath

-- 

---

David Bélanger
Graduate Student
School of Computer Science
McGill University
Office: MC226

Web page:   http://www.cs.mcgill.ca/~dbelan2/
Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt



___
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath