On 9/8/10, Matthias Klose <d...@debian.org> wrote: > Any news about this? It looks like there exists a port for openjdk-6 too,
I started porting openjdk-6 but it was too much work and gave up. I'm attaching my incomplete patch in case someone wants to continue. > see > http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/openjdk6/ > http://www.freebsd.org/cgi/cvsweb.cgi/ports/java/openjdk7/ The FreeBSD port might have some useful bits, but is not very useful in general. Most of the changes have to do with system detection (uname), which is different on Debian GNU/kFreeBSD, and with userland utilities which we don't need.
--- openjdk/jdk/make/common/shared/Platform.gmk~ 2010-06-29 22:07:19.000000000 -0400 +++ openjdk/jdk/make/common/shared/Platform.gmk 2010-06-30 07:34:10.000000000 -0400 @@ -190,7 +190,7 @@ endif # Platform settings specific to Linux -ifeq ($(SYSTEM_UNAME), Linux) +ifeq ($(SYSTEM_UNAME), GNU/kFreeBSD) PLATFORM = linux OS_NAME = linux OS_VERSION := $(shell uname -r) @@ -320,10 +320,12 @@ REQUIRED_OS_VERSION = 2.4.19-SMP endif endif + ifeq ($(SYSTEM_UNAME), Linux) ifneq ($(ARCH), ia64) # ALSA 0.9.1 and above REQUIRED_ALSA_VERSION = ^((0[.]9[.][1-9])|(1[.]0[.][0-9]))[0-9]* endif + endif # How much RAM does this machine have: MB_OF_MEMORY := $(shell m=`free -m | fgrep Mem: | sed -e 's...@\ \ *@ @g' | cut -d' ' -f2`; if [ "$$m" -lt 384 ]; then echo 384; else echo $$m; fi) endif --- openjdk/jdk/make/common/shared/Sanity.gmk~ 2010-06-29 21:47:17.000000000 -0400 +++ openjdk/jdk/make/common/shared/Sanity.gmk 2010-06-30 07:37:40.000000000 -0400 @@ -74,6 +74,7 @@ $(ECHO) "Unknown linux"; \ fi ) endif + ifeq ($(SYSTEM_UNAME), Linux) ifneq ($(ARCH), ia64) ifdef CROSS_COMPILATION # assume alsa version is correct and do not check it @@ -84,6 +85,7 @@ ALSA_VERSION = `if [ -f "$(ALSA_VERSION_CHECK)" ] ; then $(ALSA_VERSION_CHECK) ; fi` endif endif + endif endif ifeq ($(PLATFORM), windows) --- openjdk/jdk/make/common/shared/Sanity-Settings.gmk~ 2010-02-16 22:14:12.000000000 -0500 +++ openjdk/jdk/make/common/shared/Sanity-Settings.gmk 2010-06-30 07:39:08.000000000 -0400 @@ -183,9 +183,11 @@ endif ifeq ($(PLATFORM),linux) ALL_SETTINGS+=$(call addRequiredSetting,LINUX_VERSION) + ifeq ($(SYSTEM_UNAME), Linux) ifneq ($(ARCH), ia64) ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION) endif + endif endif ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION) ALL_SETTINGS+=$(call addRequiredSetting,OS_NAME) --- openjdk/corba/make/common/shared/Platform.gmk~ 2010-08-04 07:33:11.000000000 -0400 +++ openjdk/corba/make/common/shared/Platform.gmk 2010-08-04 08:52:08.590184486 -0400 @@ -175,7 +175,7 @@ endif # Platform settings specific to Linux -ifeq ($(SYSTEM_UNAME), Linux) +ifeq ($(SYSTEM_UNAME), GNU/kFreeBSD) PLATFORM = linux OS_NAME = linux OS_VERSION := $(shell uname -r) --- openjdk/hotspot/make/defs.make~ 2010-08-11 22:08:56.000000000 -0400 +++ openjdk/hotspot/make/defs.make 2010-08-12 10:38:20.000000000 -0400 @@ -123,14 +123,14 @@ endif # If not SunOS and not Linux, assume Windows -ifneq ($(OS), Linux) - ifneq ($(OS), SunOS) - OSNAME=windows - else - OSNAME=solaris - endif -else +ifeq ($(OS), Linux) + OSNAME=linux +else ifeq ($(OS), SunOS) + OSNAME=solaris +else ifeq ($(OS), GNU/kFreeBSD) OSNAME=linux +else + OSNAME=windows endif # Determinations of default make arguments and platform specific settings --- openjdk/hotspot/make/linux/Makefile~ 2010-08-11 22:09:03.000000000 -0400 +++ openjdk/hotspot/make/linux/Makefile 2010-08-12 10:50:49.000000000 -0400 @@ -233,6 +233,9 @@ SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7% OS_VERSION := $(shell uname -r) EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION)) +ifeq ($(shell uname -s), GNU/kFreeBSD) +EMPTY_IF_NOT_SUPPORTED = something +endif check_os_version: ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),) --- openjdk/hotspot/src/os/linux/vm/attachListener_linux.cpp.old 2010-08-12 11:35:39.000000000 -0400 +++ openjdk/hotspot/src/os/linux/vm/attachListener_linux.cpp 2010-08-12 11:51:12.000000000 -0400 @@ -31,6 +31,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <sys/stat.h> +#include <sys/ucred.h> // The attach mechanism on Linux uses a UNIX domain socket. An attach listener // thread is created at startup or is created on-demand via a signal from @@ -330,6 +331,9 @@ // get the credentials of the peer and check the effective uid/guid // - check with jeff on this. + uid_t peer_uid; + gid_t peer_gid; +#if defined(SO_PEERCRED) struct ucred cred_info; socklen_t optlen = sizeof(cred_info); if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) { @@ -337,10 +341,25 @@ RESTARTABLE(::close(s), res); continue; } + peer_uid = cred_info.uid; + peer_gid = cred_info.gid; +#elif defined(LOCAL_PEERCRED) + struct xucred cred_info; + socklen_t optlen = sizeof(cred_info); + if (::getsockopt(s, 0, LOCAL_PEERCRED, (void*)&cred_info, &optlen) == -1) { + int res; + RESTARTABLE(::close(s), res); + continue; + } + peer_uid = cred_info.cr_uid; + peer_gid = cred_info.cr_gid; +#else +#error +#endif uid_t euid = geteuid(); gid_t egid = getegid(); - if (cred_info.uid != euid || cred_info.gid != egid) { + if (peer_uid != euid || peer_gid != egid) { int res; RESTARTABLE(::close(s), res); continue; --- openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp~ 2009-12-08 18:12:17.000000000 -0500 +++ openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp 2010-08-12 12:14:12.000000000 -0400 @@ -172,7 +172,9 @@ "WINCH", SIGWINCH, /* Window size change (4.3 BSD, Sun). */ "POLL", SIGPOLL, /* Pollable event occurred (System V). */ "IO", SIGIO, /* I/O now possible (4.2 BSD). */ +#ifdef SIGPWR "PWR", SIGPWR, /* Power failure restart (System V). */ +#endif #ifdef SIGSYS "SYS", SIGSYS /* Bad system call. Only on some Linuxen! */ #endif