This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: libjava does not build on arm-elf (newlib) after your patch
- From: Tom Tromey <tromey at redhat dot com>
- To: Adam Nemet <anemet at Lnxw dot com>
- Cc: java at gcc dot gnu dot org, rearnsha at arm dot com
- Date: 05 Jan 2003 11:56:37 -0700
- Subject: Re: libjava does not build on arm-elf (newlib) after your patch
- References: <15895.18675.970860.440324@anemet1.lynx.com>
- Reply-to: tromey at redhat dot com
>>>>> "Adam" == Adam Nemet <anemet@Lnxw.com> writes:
Adam> When trying to build libjava for arm-elf I get this:
Adam> In file included from /home/anemet/src/clean/clean/libjava/prims.cc:12:
Adam> include/platform.h: In function `void _Jv_platform_usleep(long unsigned int)':
Adam> include/platform.h:66: error: `usleep' undeclared (first use this function)
Try the appended patch.
The usleep code is only used when hash synchronization is in use.
I failed to take this into account when changing this code to use a
platform function.
If this patch works for you I will check it in.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* include/posix.h (_Jv_platform_usleep): Wrap in ifdef
JV_HASH_SYNCHRONIZATION.
* include/win32.h (_Jv_platform_usleep): Wrap in ifdef
JV_HASH_SYNCHRONIZATION.
Index: include/posix.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.14
diff -u -r1.14 posix.h
--- include/posix.h 31 Dec 2002 17:43:46 -0000 1.14
+++ include/posix.h 5 Jan 2003 18:52:06 -0000
@@ -1,6 +1,6 @@
// posix.h -- Helper functions for POSIX-flavored OSs.
-/* Copyright (C) 2000, 2002 Free Software Foundation
+/* Copyright (C) 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -60,11 +60,13 @@
::fcntl (fd, F_SETFD, FD_CLOEXEC);
}
+#ifdef JV_HASH_SYNCHRONIZATION
inline void
_Jv_platform_usleep (unsigned long usecs)
{
usleep (usecs);
}
+#endif /* JV_HASH_SYNCHRONIZATION */
#ifndef DISABLE_JAVA_NET
Index: include/win32.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/win32.h,v
retrieving revision 1.17
diff -u -r1.17 win32.h
--- include/win32.h 31 Dec 2002 17:43:47 -0000 1.17
+++ include/win32.h 5 Jan 2003 18:52:06 -0000
@@ -48,6 +48,7 @@
// Ignore.
}
+#ifdef JV_HASH_SYNCHRONIZATION
/* Suspends the execution of the current thread for the specified
number of microseconds. Tries to emulate the behaviour of usleep()
on UNIX and provides a granularity of 1 millisecond. */
@@ -60,6 +61,7 @@
Sleep (millis);
}
}
+#endif /* JV_HASH_SYNCHRONIZATION */
#ifndef DISABLE_JAVA_NET