build failure on latest sources?
I just pulled changes for the first time since 5/20/2009 and ran into the problem described here: http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html What is the current workaround for Mac? Thanks, -- John
+1: Undefined symbols: "_fdopendir", referenced from: _Java_sun_nio_fs_UnixNativeDispatcher_fdopendir in UnixNativeDispatcher.o ld: symbol(s) not found collect2: ld returned 1 exit status make[4]: *** [/export/dav/bsd-port-b60/build/bsd-i586/lib/i386/libnio.dylib] Error 1 make[3]: *** [all] Error 1 make[2]: *** [all] Error 1 make[1]: *** [jdk-build] Error 2 make: *** [build_product_image] Error 2 Regards, Andrei John Rose wrote:
I just pulled changes for the first time since 5/20/2009 and ran into the problem described here: http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html
What is the current workaround for Mac?
Thanks, -- John
On Jul 21, 2009, at 3:14 AM, John Rose wrote:
I just pulled changes for the first time since 5/20/2009 and ran into the problem described here: http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html
What is the current workaround for Mac?
FTR, here's what got me out of the weeds. -- John diff --git a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/ src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c --- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -132,6 +132,18 @@ } #endif +#if defined(_ALLBSD_SOURCE) && !defined(__linux__) +/* Solaris function missing on Darwin. Temporary workaround to allow building. + * Ref http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html + */ +static DIR* fake_fdopendir(int dfd) { + errno = ENOSYS; + return NULL; +} +#define fdopendir fake_fdopendir +#endif + + /** * Call this to throw an internal UnixException when a system/library * call fails
G'day John, On Tue, Jul 21, 2009 at 10:18:52PM -0700, John Rose wrote:
On Jul 21, 2009, at 3:14 AM, John Rose wrote:
I just pulled changes for the first time since 5/20/2009 and ran into the problem described here: http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html
What is the current workaround for Mac?
FTR, here's what got me out of the weeds. -- John
diff --git a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/ src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c --- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -132,6 +132,18 @@ } #endif
+#if defined(_ALLBSD_SOURCE) && !defined(__linux__) +/* Solaris function missing on Darwin. Temporary workaround to allow building. + * Ref http://mail.openjdk.java.net/pipermail/bsd-port-dev/2009-May/000645.html + */ +static DIR* fake_fdopendir(int dfd) { + errno = ENOSYS; + return NULL; +} +#define fdopendir fake_fdopendir +#endif + + /** * Call this to throw an internal UnixException when a system/library * call fails
Here is a patch I worked up for it. Can you let me know if this works for you also? If so I'll get it committed. diff -r cd10412684b5 src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c --- a/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Sun Jul 19 20:27:02 2009 -0700 +++ b/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c Wed Jul 22 12:08:25 2009 -0700 @@ -97,12 +97,14 @@ typedef int unlinkat_func(int, const char*, int); typedef int renameat_func(int, const char*, int, const char*); typedef int futimesat_func(int, const char *, const struct timeval *); +typedef DIR* fdopendir_func(int); static openat64_func* my_openat64_func = NULL; static fstatat64_func* my_fstatat64_func = NULL; static unlinkat_func* my_unlinkat_func = NULL; static renameat_func* my_renameat_func = NULL; static futimesat_func* my_futimesat_func = NULL; +static fdopendir_func* my_fdopendir_func = NULL; /** * fstatat missing from glibc on Linux. Temporary workaround @@ -215,6 +217,8 @@ flags |= sun_nio_fs_UnixNativeDispatcher_HAS_AT_SYSCALLS; } + my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir"); + return flags; } @@ -570,8 +574,13 @@ Java_sun_nio_fs_UnixNativeDispatcher_fdopendir(JNIEnv* env, jclass this, int dfd) { DIR* dir; + if (my_fdopendir_func == NULL) { + JNU_ThrowInternalError(env, "should not reach here"); + return -1; + } + /* EINTR not listed as a possible error */ - dir = fdopendir((int)dfd); + dir = (*my_fdopendir_func)((int)dfd); if (dir == NULL) { throwUnixException(env, errno); } -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org
On Jul 22, 12:25pm, glewis@eyesbeyond.com (Greg Lewis) wrote: -- Subject: Re: build failure on latest sources? | Here is a patch I worked up for it. Can you let me know if this works | for you also? If so I'll get it committed. You could also do: DIR *fdopendir(int) __attribute__((__weak__)); ... if (fdopendir == NULL) ... christos
G'day Christos, On Wed, Jul 22, 2009 at 03:57:01PM -0400, Christos Zoulas wrote:
On Jul 22, 12:25pm, glewis@eyesbeyond.com (Greg Lewis) wrote: -- Subject: Re: build failure on latest sources?
| Here is a patch I worked up for it. Can you let me know if this works | for you also? If so I'll get it committed.
You could also do:
DIR *fdopendir(int) __attribute__((__weak__));
...
if (fdopendir == NULL) ...
I was trying to keep to the way functions that various OSes might support are handled in the rest of the file :). That's good to know though, I probably wouldn't have thought of that. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org
On Jul 22, 2009, at 12:25 PM, Greg Lewis wrote:
G'day John,
Here is a patch I worked up for it. Can you let me know if this works for you also? If so I'll get it committed.
Yes, that works for me on Mac. Thanks! -- John
participants (4)
-
Andrei Dmitriev
-
christos@zoulas.com
-
Greg Lewis
-
John Rose