kaffe-1.0.b2 && Openstep 4.1

Yasuyui TSUKUI ytsukui at sf.airnet.ne.jp
Wed Oct 7 10:46:43 PDT 1998


Hi,

> Did someone ever managed to compile kaffe-1.0.b2 on an Openstep 4.1 or 4.2 system?
> The first thing is that some makefile have the line
> 
> IMHO it should be
> LDFLAGS=	-undefined suppress
> 

I have tried some ld flags on OPENSTEP 4.2/Mach but couldn't get good result.
Even if rld_loader worked, rld_lookup() always failed for me.
So, I moved back onto NEXTSTEP 3.3 and then most things seems work fine.
Binaries compiled on NEXTSTEP 3.3 systems are OK on OPENSTEP systems
(Tested with kaffe-1.0.b1 only)

As for kaffe-1.0.b2, I am using following configurations:

	./configure --with-threads=unix-internal

This is because unix-jthreads system contains POSIX dependency and I don't know how to workaround it.

	>> cc -v
	Reading specs from /lib/i386/specs
	NeXT Computer, Inc. version cc-437.2.6.1, gcc version 2.5.8

I use original NeXT's cc.

	>> gnumake -v   
	GNU Make version 3.75, by Richard Stallman and Roland McGrath.

NeXT's original make doesn't work.

	setenv KAFFE_LIB /usr/local/share/kaffe/lib/i386-nextstep3 
	setenv LD_LIBRARY_PATH $KAFFE_LIB
	setenv CLASSPATH .:/usr/local/share/kaffe/Klasses.jar:/usr/local/share/kaffe/pizza.jar:/usr/local/share/sun/classes.zip

I don't know why dyna_load modules such like libnative.o are installed in /usr/local/share/kaffe/lib/i386-nextstep3/. The install location is changed from kaffe-1.0b1.

In ./config/config-hacks.h
  #undef  HAVE_SYS_UTSNAME_H
! #define HAVE_DYN_UNDERSCORE 1
! #undef        HAVE_SBRK

sbrk() memory allocator is broken on NeXT OS.
Instead, currentry using valloc(). Mach's vm_ allocator can be faster.

./config/i386/nextstep3/md.h
+ #define SP_OFFSET 9

This was gdb told me about SP offsetting for i386.

The rld related mod in kaffe/kaffevm/slib.h are basicaly what I salvaged from http://www.mathi.uni-heidelberg.de/STEPkaffe/. There may be much better solutions for OPENSTEP.

The other minor diffs can be because of old NeXT cc I used and you may not encouter these compilation errors if you use modern gcc.

With those fixes, all of the regression test suit (test/regression/TestScripts) are successfull except three tests (ExecTest, ProcessTest, UDPTest).


This may help,
and ... Good luck !!!

---
Yasuyuki TSUKUI  (津久井 保幸)
ytsukui at airnet.ne.jp
Yokohama, JAPAN
---


--- Diff for nextstep 3.3 ---
diff -rc1 /Kaffe-home/kaffe-1.0.b2/config/config-hacks.h /Kaffe-home/kaffe-1.0.b2-np1/config/config-hacks.h
*** /Kaffe-home/kaffe-1.0.b2/config/config-hacks.h       Thu Aug 20 06:42:09 1998
--- /Kaffe-home/kaffe-1.0.b2-np1/config/config-hacks.h   Thu Oct  8 00:29:46 1998
***************
*** 15,17 ****
  #undef  HAVE_SYS_UTSNAME_H
! #define HAVE_DYN_UNDERSTORE 1
  #endif
--- 15,18 ----
  #undef  HAVE_SYS_UTSNAME_H
! #define HAVE_DYN_UNDERSCORE 1
! #undef        HAVE_SBRK
  #endif
***************
*** 20,22 ****
  #if defined(__amigaos__)
! #define HAVE_DYN_UNDERSTORE 1
  #endif  
--- 21,23 ----
  #if defined(__amigaos__)
! #define HAVE_DYN_UNDERSCORE 1
  #endif  
***************
*** 31,33 ****
  #if defined(__NetBSD__)
! #define       HAVE_DYN_UNDERSTORE 1
  #define       DEFAULT_LIBRARYPATH "/usr/local/lib:/usr/lib"
--- 32,34 ----
  #if defined(__NetBSD__)
! #define       HAVE_DYN_UNDERSCORE 1
  #define       DEFAULT_LIBRARYPATH "/usr/local/lib:/usr/lib"
diff -rc1 /Kaffe-home/kaffe-1.0.b2/config/i386/nextstep3/md.h /Kaffe-home/kaffe-1.0.b2-np1/config/i386/nextstep3/md.h
*** /Kaffe-home/kaffe-1.0.b2/config/i386/nextstep3/md.h  Wed Apr  1 04:10:53 1998
--- /Kaffe-home/kaffe-1.0.b2-np1/config/i386/nextstep3/md.h      Thu Oct  8 00:35:27 1998
***************
*** 17,18 ****
--- 17,24 ----
  
+ /*
+  * Redefine stack pointer offset.
+  */
+ #undef SP_OFFSET
+ #define SP_OFFSET 9
+ 
  #if defined(TRANSLATOR)
diff -rc1 /Kaffe-home/kaffe-1.0.b2/kaffe/kaffevm/slib.h /Kaffe-home/kaffe-1.0.b2-np1/kaffe/kaffevm/slib.h
*** /Kaffe-home/kaffe-1.0.b2/kaffe/kaffevm/slib.h        Fri Aug 28 04:14:18 1998
--- /Kaffe-home/kaffe-1.0.b2-np1/kaffe/kaffevm/slib.h    Thu Oct  8 00:38:41 1998
***************
*** 56,57 ****
--- 56,58 ----
  #define       LIBRARYINIT()
+ #ifndef NeXT
  #define       LIBRARYLOAD(HAND, LIB)                                          \
***************
*** 64,65 ****
--- 65,84 ----
        }
+ #else NeXT
+ #define       LIBRARYLOAD(HAND, LIB)                                          \
+         {                                                               \
+               const char* filenames[2];                               \
+               NXStream *errorStream;                                  \
+               filenames[0]=(LIB);                                     \
+               filenames[1]=NULL;                                      \
+               errorStream = NXOpenMemory(NULL, 0, NX_WRITEONLY);      \
+               HAND = !objc_loadModules(filenames,errorStream,NULL,NULL,NULL);\
+               if (!HAND) {                                            \
+                       char *streamBuf;                                \
+                       int len, maxLen;                                \
+                       NXPutc(errorStream, (char)0);                   \
+                       NXGetMemoryBuffer(errorStream, &streamBuf, &len, &maxLen); \
+                       printf("LIBRARYLOAD(\"%s\") error: %s\n", LIB,streamBuf); \
+               }                                                       \
+        }
+ #endif NeXT
  #define       LIBRARYFUNCTION(FUNC, SYM)                                      \
diff -rc1 /Kaffe-home/kaffe-1.0.b2/kaffe/kaffevm/jit/machine.h /Kaffe-home/kaffe-1.0.b2-np1/kaffe/kaffevm/jit/machine.h
*** /Kaffe-home/kaffe-1.0.b2/kaffe/kaffevm/jit/machine.h Fri Sep 25 03:36:40 1998
--- /Kaffe-home/kaffe-1.0.b2-np1/kaffe/kaffevm/jit/machine.h     Thu Oct  8 00:39:29 1998
***************
*** 110,113 ****
  
! #define       willCatch(FLAG) willcatch.##FLAG = true
! #define       canCatch(FLAG)  willcatch.##FLAG
  
--- 110,115 ----
  
! //#define     willCatch(FLAG) willcatch.##FLAG = true
! //#define     canCatch(FLAG)  willcatch.##FLAG
! #define       willCatch(FLAG) willcatch.FLAG = true
! #define       canCatch(FLAG)  willcatch.FLAG
  
***/Kaffe-home/kaffe-1.0.b2/libraries/clib/net/PlainSocketImpl.c        Thu Oct  8 02:25:09 1998
---/Kaffe-home/kaffe-1.0.b2-np1/libraries/clib/net/PlainSocketImpl.c    Thu Oct  8 00:15:33 1998
***************
*** 16,17 ****
--- 16,20 ----
  #if defined(HAVE_NETINET_TCP_H)
+ #ifdef NeXT
+ #include <netinet/in_systm.h>
+ #endif NeXT
  #include <netinet/tcp.h>

--- end of diff ---



More information about the kaffe mailing list