Trying to compile HotSpot on 4.7-STABLE -- with patch

Trying to compile HotSpot on 4.7-STABLE -- with patch

Post by Georg-W. Kolterman » Sat, 23 Nov 2002 18:22:18



--=-WZeLTLaU7fbhUIp0apEy
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

> ...
> I'll attach my patch. It does the following things:

Oops, here is the patch now.  Note that in order to actually use
hotspot, you must call it as "java -hotspot" and also edit
jdk1.3.1/jre/lib/jvm.cfg to move "-classic" to the bottom again.

I couldn't figure out how to force hotspot when -classic is the default
in jvm.cfg.

--
Georg.

--=-WZeLTLaU7fbhUIp0apEy
Content-Disposition: attachment; filename=patch-zgwk1
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=patch-zgwk1; charset=ISO-8859-15

diff -urN common/Defs-bsd.gmk common/Defs-bsd.gmk
--- common/Defs-bsd.gmk Thu Nov 21 14:35:47 2002
+++ common/Defs-bsd.gmk Mon Nov 18 15:24:27 2002
@@ -32,9 +32,9 @@
 AR             =3D $(USRBIN_PATH)ar
 AS             =3D $(USRBIN_PATH)as
 CAT            =3D $(UNIXCOMMAND_PATH)cat
-CC             =3D $(COMPILER_PATH)gcc
-CPP            =3D $(COMPILER_PATH)gcc -E
-CXX            =3D $(COMPILER_PATH)g++
+CC             =3D gcc32
+CPP            =3D gcc32 -E
+CXX            =3D g++32
 CD             =3D cd # intrinsic unix command
 CHMOD          =3D $(UNIXCOMMAND_PATH)chmod
 CMP            =3D $(USRBIN_PATH)cmp
diff -urN ../src/solaris/bin/java_wrapper_bsd.sh ../src/solaris/bin/java_wr=
apper_bsd.sh
--- ../src/solaris/bin/java_wrapper_bsd.sh      Thu Nov 21 14:35:46 2002
+++ ../src/solaris/bin/java_wrapper_bsd.sh      Thu Nov 21 16:38:40 2002
@@ -92,10 +92,10 @@
                ttype=3Dnative_threads
                shift 1
            else=20
-               if [ -d ${jre}/lib/${proc}/hotspot ]; then
-                   vmtype=3Dhotspot
-                   ttype=3Dnative_threads
-               else
+##             if [ -d ${jre}/lib/${proc}/hotspot ]; then
+##                 vmtype=3Dhotspot
+##                 ttype=3Dnative_threads
+##             else
                    vmtype=3Dclassic
                    if [ ${THREADS_FLAG:-${DEFAULT_THREADS_FLAG}} =3D native ]
                    then=20
@@ -103,7 +103,7 @@
                    else
                        ttype=3Dgreen_threads
                    fi
-               fi
+##             fi
            fi
        fi
     fi
diff -urN ../src/solaris/hpi/native_threads/src/threads_bsd.c ../src/solari=
s/hpi/native_threads/src/threads_bsd.c
--- ../src/solaris/hpi/native_threads/src/threads_bsd.c Thu Nov 21 14:35:46=
 2002
+++ ../src/solaris/hpi/native_threads/src/threads_bsd.c Wed Nov 20 13:53:54=
 2002
@@ -284,6 +284,7 @@
        "susp boundless"
 };
=20
+enum pthread_susp { a_one, a_two, a_three }; /* gwk, dummy */
 char *getSuspendStateString(enum pthread_susp suspendState)
 {
        if (suspendState < ANALRETENTIVE)
@@ -292,7 +293,7 @@
                return &SuspendList[ANALRETENTIVE-1][0];
 }
=20
-#define SATAN (21 + 1) /* for the error string at the end of the list */
+#define SATAN (22 + 1) /* for the error string at the end of the list */
=20
 char SignalList [SATAN][16]
 =3D
@@ -318,7 +319,8 @@
        "PS_DEAD",
        "PS_DEADLCK",
        "PS_STATE_MAX",
-       "PS_REQUEST_WAITING_SUSPENDED",
+/*     "PS_REQUEST_WAITING_SUSPENDED", gwk */
+       "PS_REQUEST_WSUS",
        "boundless"
 };
=20
@@ -527,6 +529,7 @@
        if (thread->state !=3D PS_SUSPENDED)
                dumpThreadLogStates(thread);
=20
+#if 0 /* gwk */
        switch ((int)thread->ctxtype)
        {
                case CTX_JB_NOSIG:      /* 0) jmp_buf context without signal mask for blockin=
g IO, etc... */
@@ -551,6 +554,7 @@
 #endif
                        break;
        }
+#endif /* gwk */
=20
 #ifdef DEBUG_BSD_NATIVE_THREADS
 TermFailed:
diff -urN ../../hotspot1.3.1/build/linux/makefiles/gcc32.make ../../hotspot=
1.3.1/build/linux/makefiles/gcc32.make
--- ../../hotspot1.3.1/build/linux/makefiles/gcc32.make Thu Jan  1 01:00:00=
 1970
+++ ../../hotspot1.3.1/build/linux/makefiles/gcc32.make Wed Nov 20 14:22:40=
 2002
@@ -0,0 +1,131 @@
+
+# put the *.o files in the a.out, not the shared library
+LINK_INTO =3D $(LINK_INTO/$(VERSION))
+LINK_INTO/debug     =3D AOUT
+#LINK_INTO/optimized =3D AOUT
+LINK_INTO/optimized =3D LIBJVM
+
+# apply this setting to link into the shared library even in the debug ver=
sion:
+LINK_INTO =3D LIBJVM
+
+# If MAKE_OPTO is null, then we will compile with the -DOPTO.
+# That switch, despite its name, has the effect of __disabling__ OPTO.
+$(MAKE_OPTO)CFLAGS +=3D -DOPTO
+
+#CFLAGS +=3D -v
+
+# The flags to use for an Optimized g++ build
+#OPT_CFLAGS +=3D -O3
+
+OPT_CFLAGS +=3D -O0
+
+CFLAGS +=3D -fPIC
+CFLAGS +=3D -Winline
+CFLAGS +=3D -fwritable-strings
+CFLAGS +=3D -fno-rtti
+CFLAGS +=3D -fhandle-exceptions
+CFLAGS +=3D -D__STDC__=3D1 -D_LARGEFILE64_SOURCE -DTEMPLATE_TABLE_BUG
+CFLAGS +=3D -D__GNU__ -D_REENTRANT
+CFLAGS +=3D -fcheck-new
+
+#--billh
+CFLAGS +=3D -D__FreeBSD__
+#-D__GNUC__
+
+# Set GCC_SAVE_TEMPS=3D-save-temps to keep temporary files (.ii, .s).
+CFLAGS +=3D $(GCC_SAVE_TEMPS)
+
+OPT_CFLAGS +=3D -O0
+# -O1
+#OPT_CFLAGS +=3D -fdefer-pop
+OPT_CFLAGS +=3D -fthread-jumps
+OPT_CFLAGS +=3D -fdelayed-branch
+OPT_CFLAGS +=3D -fomit-frame-pointer
+OPT_CFLAGS +=3D -fguess-branch-probability
+OPT_CFLAGS +=3D -fcprop-registers
+# END
+
+OPT_CFLAGS +=3D -ffloat-store
+OPT_CFLAGS +=3D -fno-default-inline
+OPT_CFLAGS +=3D -fno-defer-pop
+#bad, causes abort()
+#OPT_CFLAGS +=3D -ftrapv
+OPT_CFLAGS +=3D -fno-inline
+OPT_CFLAGS +=3D -fkeep-static-consts
+OPT_CFLAGS +=3D -fmerge-constants
+OPT_CFLAGS +=3D -fmerge-all-constants
+OPT_CFLAGS +=3D -fno-function-cse
+OPT_CFLAGS +=3D -ffast-math
+# END
+
+# -O2
+OPT_CFLAGS +=3D -foptimize-sibling-calls
+OPT_CFLAGS +=3D -fcse-follow-jumps
+OPT_CFLAGS +=3D -fcse-skip-blocks
+OPT_CFLAGS +=3D -fgcse-sm
+OPT_CFLAGS +=3D -fgcse-lm
+OPT_CFLAGS +=3D -fgcse
+
+OPT_CFLAGS +=3D -fexpensive-optimizations
+OPT_CFLAGS +=3D -fstrength-reduce
+OPT_CFLAGS +=3D -frerun-cse-after-loop
+OPT_CFLAGS +=3D -frerun-loop-opt
+OPT_CFLAGS +=3D -fcaller-saves
+OPT_CFLAGS +=3D -fforce-addr
+OPT_CFLAGS +=3D -fforce-mem
+OPT_CFLAGS +=3D -fpeephole2
+##
+OPT_CFLAGS +=3D -fschedule-insns
+OPT_CFLAGS +=3D -fschedule-insns2
+##
+OPT_CFLAGS +=3D -fregmove
+OPT_CFLAGS +=3D -fstrict-aliasing
+OPT_CFLAGS +=3D -fdelete-null-pointer-checks
+OPT_CFLAGS +=3D -freorder-blocks
+# END
+
+OPT_CFLAGS +=3D -fno-gcse
+OPT_CFLAGS +=3D -fdata-sections
+OPT_CFLAGS +=3D -fprefetch-loop-arrays
+OPT_CFLAGS +=3D -fmove-all-movables
+OPT_CFLAGS +=3D -freduce-all-givs
+OPT_CFLAGS +=3D -fno-guess-branch-probability
+
+OPT_CFLAGS +=3D -falign-functions
+OPT_CFLAGS +=3D -falign-labels
+OPT_CFLAGS +=3D -falign-loops
+OPT_CFLAGS +=3D -falign-jumps
+
+OPT_CFLAGS +=3D -fssa
+# END
+
+# -O3
+OPT_CFLAGS +=3D -finline-functions
+OPT_CFLAGS +=3D -frename-registers
+# END
+
+
+
+
+#####
+#harmless
+OPT_CFLAGS +=3D -fmemoize-lookups
+#unneeded
+#OPT_CFLAGS +=3D -fpeephole
+#bad
+# this creates a link error.
+#OPT_CFLAGS +=3D -fkeep-inline-functions
+#
+OPT_CFLAGS +=3D -funroll-loops
+OPT_CFLAGS +=3D -funroll-all-loops
+#####
+
+# Set the environment variable HOTSPARC_HOTSPARC_GENERIC to "true"
+# to inhibit the effect of the previous line on CFLAGS.
+
+CPP =3D g++32
+CC  =3D gcc32
+
+AOUT_FLAGS +=3D -export-dynamic=20
+DEBUG_CFLAGS +=3D -g
+
diff -urN ../../hotspot1.3.1/build/linux/platform_i486 ../../hotspot1.3.1/b=
uild/linux/platform_i486
--- ../../hotspot1.3.1/build/linux/platform_i486        Thu Nov 21 17:35:21 2002
+++ ../../hotspot1.3.1/build/linux/platform_i486        Wed Nov 20 14:20:54 2002
@@ -6,7 +6,7 @@
=20
 lib_arch =3D i386
=20
-compiler =3D gcc31
+compiler =3D gcc32
=20
 gnu_dis_arch =3D i386
=20
diff -urN ../../hotspot1.3.1/build/linux/platform_i486.gwk ../../hotspot1.3=
.1/build/linux/platform_i486.gwk
--- ../../hotspot1.3.1/build/linux/platform_i486.gwk    Thu Jan  1 01:00:00 19=
70
+++ ../../hotspot1.3.1/build/linux/platform_i486.gwk    Wed Nov 20 14:20:27 20=
02
@@ -0,0 +1,16 @@
+os_family =3D linux
+
+arch =3D i486
+
+os_arch =3D linux_i486
+
+lib_arch =3D i386
+
+compiler =3D gcc31
+
+gnu_dis_arch =3D i386
+
+sysdefs =3D -DLINUX -D_GNU_SOURCE -DIA32 -D_USE_PTHREAD_SPECIFIC -pthread =
-D_THREAD_SAFE
+
+mark_style =3D alignment
+
diff -urN ../../hotspot1.3.1/src/share/vm/utilities/globalDefinitions_gcc32=
.hpp ../../hotspot1.3.1/src/share/vm/utilities/globalDefinitions_gcc32.hpp
--- ../../hotspot1.3.1/src/share/vm/utilities/globalDefinitions_gcc32.hpp       T=
hu Jan  1 01:00:00 1970
+++ ../../hotspot1.3.1/src/share/vm/utilities/globalDefinitions_gcc32.hpp       W=
ed Nov 20 14:25:03 2002
@@ -0,0 +1,139 @@
+/*
+ * @(#)globalDefinitions_gcc.hpp       1.18 01/02/09 14:48:11
+ *
+ * Copyright 1993-2001 by Sun Microsystems, Inc.,
+ * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
+ * All rights reserved.
+ *=20
+ * This software is the confidential and proprietary information
+ * of Sun Microsystems, Inc. ("Confidential Information").  You
+ * shall not disclose such Confidential Information and shall use
+ * it only in accordance with the terms of the license agreement
+ * you entered into with Sun.
+ */
+
+// CopyrightVersion 1.2
+
+// This file holds compiler-dependent includes,
+// globally used constants & types, class (forward)
+// declarations and a few frequently used utility functions.
+
+# include <ctype.h>
+# include <string.h>
+# include <stdarg.h>
+# include <stddef.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <wchar.h>
+
+#ifdef SOLARIS
+# include <ieeefp.h>
+#endif
+
+# include <math.h>
+# include <time.h>
+# include <fcntl.h>
+# include <pthread.h>
+
+# include <limits.h>
+# include <errno.h>
+
+
+#ifdef LINUX
+# include <inttypes.h>
+# include <signal.h>
+# include <ucontext.h>
+# include <sys/time.h>
+
+#else
+
+// Compiler-specific primitive types
+typedef unsigned char      uint8_t;
+typedef unsigned short     uint16_t;
+typedef unsigned int       uint32_t;
+typedef unsigned long long uint64_t;
+
+typedef signed char        int8_t;
+typedef signed short       int16_t;
+typedef signed int         int32_t;
+typedef signed long long   int64_t;
+
+#endif /*LINUX*/
+
+// <sys/trap.h> promises that the system will not use traps 16-31
+#define ST_RESERVED_FOR_USER_0 0x10
+
+// Additional Java basic types
+
+typedef unsigned char      jubyte;
+typedef unsigned short     jushort;
+typedef unsigned int       juint;
+typedef unsigned long long julong;
+
+//------------------------------------------------------------------------=
----------------------------
+// Special (possibly not-portable) casts
+// Cast floats into same-size integers and vice-versa w/o changing bit-pat=
tern
+// %%%%%% These seem like standard C++ to me--how about factoring them out=
? - Ungar
+
+inline jint    jint_cast   (jfloat  x)           { return *(jint*   )&x; }
+inline jlong   jlong_cast  (jdouble x)           { return *(jlong*  )&x; }
+
+inline jfloat  jfloat_cast (jint    x)           { return *(jfloat* )&x; }
+inline jdouble jdouble_cast(jlong   x)           { return *(jdouble*)&x; }
+
+//------------------------------------------------------------------------=
----------------------------
+// Constant for jlong (specifying an long long canstant is C++ compiler sp=
ecific)
+
+#ifdef LINUX //-billh
+const int64_t min_jlong =3D 0x8000000000000000LL;
+const int64_t max_jlong =3D 0x7fffffffffffffffLL;
+#else
+const jlong min_jlong =3D 0x8000000000000000L;
+const jlong max_jlong =3D 0x7fffffffffffffffL;
+#endif
+
+//------------------------------------------------------------------------=
----------------------------
+// Debugging
+
+#define DEBUG_EXCEPTION ::abort();
+
+extern "C" void breakpoint();
+#define BREAKPOINT ::breakpoint()
+
+// checking for nanness
+
+inline int g_isnan(float  f) { return isnanf(f); }
+#if defined(SOLARIS) || defined(BSD4_4)=20
+inline int g_isnan(double f) { return isnand(f); }
+#elif LINUX
+inline int g_isnan(double f) { return isnan(f); }
+#else
+#error "missing platform-speicfic definition here"
+#endif
+
+
+// Checking for finiteness
+
+inline int g_isfinite(jfloat  f)                 { return finite(f); }
+inline int g_isfinite(jdouble f)                 { return finite(f); }
+
+
+// Wide characters
+
+inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
+
+
+#ifdef PRODUCT
+const int Interpreter_Code_Size =3D 55 * 1024;
+#else
+const int Interpreter_Code_Size =3D 75 * 1024;
+#endif
+
+// Portability macros
+#define PRAGMA_INTERFACE             #pragma interface
+#define PRAGMA_IMPLEMENTATION        #pragma implementation
+#if !defined(LINUX) && !defined(BSD4_4)
+#define PRAGMA_IMPLEMENTATION_(arg)  #pragma implementation(arg)
+#endif /*LINUX*/
+#define VALUE_OBJ_CLASS_SPEC
+
diff -urN ../src/solaris/bin/jvm.cfg ../src/solaris/bin/jvm.cfg
--- ../src/solaris/bin/jvm.cfg  Sun May  6 14:26:52 2001
+++ ../src/solaris/bin/jvm.cfg  Thu Nov 21 18:43:54 2002
@@ -8,7 +8,7 @@
 # List of JVMs that can be used as the first option to java, javac, etc.
 # Order is important -- first in this list is the default JVM.
 #
+-classic
 -client
 -hotspot
 -server
--classic

--=-WZeLTLaU7fbhUIp0apEy--

To Unsubscribe: send mail to majord...@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message

 
 
 

1. Trying to compile HotSpot on 4.7-STABLE

Thank you all who helped with their advice.  I've built hotspot on
4.7-STABLE now and it seems to work.  I ran jedit for a while in the
hotspot engine, and it did not crash.  It was only very noisy,
complaining about keys that were not found and yellow/red zoning not
working.  I think this behaviour is expected.

Unfortunately the hotspot engine would not run Together.  It hung during
startup.  Well... I couldn't really hope that it would work.

I'll attach my patch. It does the following things:

* Changes the build files so that both the classic VM (including the
native threads part) and the hotspot VM are built with GCC32.  I didn't
bother to mark the port to depend on GCC32 as a build dependency, I just
changed the build process.

* Changes the .java_wrapper so that it no longer activates native
threading in the classic VM.  It would do that as soon as it found the
hotspot library on disk, and would fail (in the classic VM) rather
quickly.

* Fixes a compilation error in the hotspot part which is due to some
recent changes in libc_r.  This is based on recent discussion on this
list, it just removes (#ifdefs out) the problem code.

You can drop the patch into your jdk13/files and it will apply during
the build.  Note, however, that a) you have to build the classic part
with "make WITH_NATIVE_THREADS=1", and then build the hotspot part by
hand as discussed in
http://www.freebsd.org/cgi/getmsg.cgi?fetch=63624+0+/usr/local/www/db... (only now you use GCC 3.2 instead of 3.1).

--
Regards,
Georg.


with "unsubscribe freebsd-java" in the body of the message

2. related simple thing

3. help, modem chat script not working

4. COMPILING NOW: Re: unable to compile 1.4 on 4.7-STABLE...

5. plugging a keyboard to a headless Sun box

6. Antec Xirlink XL-221 SCSI card

7. unable to compile 1.4 on 4.7-STABLE...

8. FreeBSD 4.7-STABLE Kernel compile

9. How to install 4.7-stable?

10. 4.7 Stable Startup problems