Robin Garner wrote:

I'm having problems building the boot JVM.  running jvm/build.sh I get

src/timeslice.c:82:71: thread.h: No such file or directory
src/timeslice.c: In function `timeslice_tick':
src/timeslice.c:221: error: invalid use of undefined type `struct itimerval'
src/timeslice.c: In function `timeslice_run':
src/timeslice.c:260: error: invalid use of undefined type `struct itimerval'
src/timeslice.c:262: error: invalid use of undefined type `struct itimerval'
src/timeslice.c:264: error: invalid use of undefined type `struct itimerval'
src/timeslice.c:266: error: invalid use of undefined type `struct itimerval'
src/timeslice.c:279: warning: implicit declaration of function `setitimer'
src/timeslice.c:279: error: `ITIMER_REAL' undeclared (first use in this
function)
src/timeslice.c:279: error: (Each undeclared identifier is reported only once
src/timeslice.c:279: error: for each function it appears in.)
src/timeslice.c:311: warning: implicit declaration of function `yield'
src/timeslice.c: At top level:
src/timeslice.c:178: error: storage size of `timeslice_period' isn't known
gcc: bin/timeslice.o: No such file or directory

Is this a header file missing ?  I'm running gentoo with a 2.6.13 kernel
and gcc 3.3.

Try the enclosed patch.

By the way, the top level config.sh/build.sh seems to expect that "." is
in the path.  And any chance of getting this to build using a real build
tool ?  Make ?  Ant ? (or is ant only for java ?)

cheers



Index: jvm/src/timeslice.c
===================================================================
--- jvm/src/timeslice.c (revision 328150)
+++ jvm/src/timeslice.c (working copy)
@@ -70,7 +70,7 @@
 
 #include <unistd.h>
 #include <signal.h>
-#if defined(CONFIG_WINDOWS) || defined(CONFIG_CYGWIN)
+#if defined(CONFIG_WINDOWS) || defined(CONFIG_CYGWIN) || defined(__linux__)
 #include <sys/time.h>
 #endif 
 
@@ -79,9 +79,13 @@
 
 #ifndef CONFIG_WINDOWS
 #ifndef CONFIG_CYGWIN
+#if defined(__linux__)
+#include <pthread.h>
+#else
 #include <thread.h> /* WATCH OUT!  /usr/include, not application .h */
 #endif
 #endif
+#endif
 
 #include "jvmcfg.h"
 #include "classfile.h"
@@ -308,8 +312,12 @@
 #if defined(CONFIG_WINDOWS) || defined(CONFIG_CYGWIN)
         /* do something useful */
 #else
+#if defined(__linux__)
+        pthread_yield();
+#else
         yield();
 #endif
+#endif
     }
 
 /*NOTREACHED*/

Reply via email to