changeset 19:142b74086f40

Removed unimplemented parts in Makefile, so a relatively complete JRE can be built.
author Ao Qi <aoqi@loongson.cn>
date Fri, 29 Oct 2010 09:44:58 +0800
parents d2a6a000ff33
children 7a9f890eafef
files corba/make/common/Defs-linux.gmk env_debug.sh env_product.sh hotspot/agent/make/saenv.sh hotspot/agent/src/os/linux/LinuxDebuggerLocal.c hotspot/agent/src/os/linux/Makefile hotspot/agent/src/os/linux/libproc.h hotspot/make/Makefile hotspot/make/defs.make hotspot/make/linux/makefiles/buildtree.make hotspot/make/linux/makefiles/debug.make hotspot/make/linux/makefiles/defs.make hotspot/make/linux/makefiles/gcc.make hotspot/make/linux/makefiles/launcher.make hotspot/make/linux/makefiles/sa.make hotspot/make/linux/makefiles/vm.make hotspot/src/share/vm/runtime/reflection.cpp jdk/make/common/Defs-linux.gmk jdk/make/common/Program.gmk jdk/make/common/shared/Compiler-gcc.gmk jdk/make/common/shared/Platform.gmk jdk/make/java/instrument/Makefile jdk/make/java/redist/Makefile jdk/make/javax/sound/SoundDefs.gmk jdk/src/share/native/com/sun/media/sound/SoundDefs.h make/hotspot-rules.gmk
diffstat 26 files changed, 178 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/corba/make/common/Defs-linux.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/corba/make/common/Defs-linux.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -197,6 +197,10 @@
 EXTRA_LIBS += -lc
 
 LDFLAGS_DEFS_OPTION  = -z defs
+ifeq ($(ARCH), mips64)
+# MIPS do not know this defs option
+	LDFLAGS_DEFS_OPTION  = 
+endif
 LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 
 #
--- a/env_debug.sh	Sat Oct 30 17:47:17 2010 +0800
+++ b/env_debug.sh	Fri Oct 29 09:44:58 2010 +0800
@@ -1,27 +1,27 @@
 export LANG=C
 export LC_ALL=C
-export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk
+export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin
 export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk
 #export ALT_BOOTDIR=/home/loongson/java/j2sdk-gs2
 export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs
-export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-openjdk
-#export ALT_SLASH_JAVA=/yangyongqiang
+#export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-openjdk
 export ARCH_DATA_MODEL=32
 
+#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. 
 export DEBUG_NAME=debug
-#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. 
 
-export BUILD_LANGTOOLS=fasle
+# If want to build entire JDK, set all envs below true.
+export BUILD_LANGTOOLS=false
 export BUILD_CORBA=false
 export BUILD_JAXP=false
 export BUILD_JAXWS=false
+# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded.
+# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is.
+#export ALT_DROPS_DIR=~/zip_dir
+
 export BUILD_MOTIF=false
 export BUILD_JDK=false
 export BUILD_DEPLOY=false
 
-export CLIENT_ONLY=true
-
-
 unset CLASSPATH
 unset JAVA_HOME
-
--- a/env_product.sh	Sat Oct 30 17:47:17 2010 +0800
+++ b/env_product.sh	Fri Oct 29 09:44:58 2010 +0800
@@ -1,15 +1,20 @@
 export LC_ALL=C
-export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk
+export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin
 export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk
 export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs
 export ARCH_DATA_MODEL=32
 
 #The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. 
 
+# If want to build entire JDK, set all envs below true.
 export BUILD_LANGTOOLS=false
 export BUILD_CORBA=false
 export BUILD_JAXP=false
 export BUILD_JAXWS=false
+# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded.
+# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is.
+#export ALT_DROPS_DIR=~/zip_dir
+
 export BUILD_MOTIF=false
 export BUILD_JDK=false
 export BUILD_DEPLOY=false
--- a/hotspot/agent/make/saenv.sh	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/agent/make/saenv.sh	Fri Oct 29 09:44:58 2010 +0800
@@ -42,6 +42,10 @@
      SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
      CPU=amd64
+   elif [ "$ARCH" = "mips64" ] ; then
+     SA_LIBPATH=$STARTDIR/../src/os/linux/mips:$STARTDIR/linux/mips
+     OPTIONS="-Dsa.library.path=$SA_LIBPATH"
+     CPU=mips
    else
      SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
--- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c	Fri Oct 29 09:44:58 2010 +0800
@@ -41,6 +41,10 @@
 #include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h"
 #endif
 
+#if defined(mipsel) || defined(mips) 
+#include "sun_jvm_hotspot_debugger_mips_MIPSThreadContext.h"
+#endif
+
 static jfieldID p_ps_prochandle_ID = 0;
 static jfieldID threadList_ID = 0;
 static jfieldID loadObjectList_ID = 0;
@@ -307,6 +311,9 @@
 #if defined(sparc) || defined(sparcv9)
 #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG
 #endif
+#if defined(mips) || defined(mipsel)
+#define NPRGREG sun_jvm_hotspot_debugger_mips_MIPSThreadContext_NPRGREG
+#endif
 
   array = (*env)->NewLongArray(env, NPRGREG);
   CHECK_EXCEPTION_(0);
@@ -406,6 +413,45 @@
   regs[REG_INDEX(R_O7)]  = gregs.u_regs[14];
 #endif /* sparc */
 
+#if defined(mips) || defined(mipsel)
+
+#define REG_INDEX(reg) sun_jvm_hotspot_debugger_mips_MIPSThreadContext_##reg
+
+  regs[REG_INDEX(ZERO)]  = gregs.regs[0];
+  regs[REG_INDEX(AT)]  = gregs.regs[1];
+  regs[REG_INDEX(V0)]  = gregs.regs[2];
+  regs[REG_INDEX(V1)]  = gregs.regs[3];
+  regs[REG_INDEX(A0)]  = gregs.regs[4];
+  regs[REG_INDEX(A1)]  = gregs.regs[5];
+  regs[REG_INDEX(A2)]  = gregs.regs[6];
+  regs[REG_INDEX(A3)]  = gregs.regs[7];
+  regs[REG_INDEX(T0)]  = gregs.regs[8];
+  regs[REG_INDEX(T1)]  = gregs.regs[9];
+  regs[REG_INDEX(T2)]  = gregs.regs[10];
+  regs[REG_INDEX(T3)]  = gregs.regs[11];
+  regs[REG_INDEX(T4)]  = gregs.regs[12];
+  regs[REG_INDEX(T5)]  = gregs.regs[13];
+  regs[REG_INDEX(T6)]  = gregs.regs[14];
+  regs[REG_INDEX(T7)]  = gregs.regs[15];
+  regs[REG_INDEX(S0)]  = gregs.regs[16];
+  regs[REG_INDEX(S1)]  = gregs.regs[17];
+  regs[REG_INDEX(S2)]  = gregs.regs[18];
+  regs[REG_INDEX(S3)]  = gregs.regs[19];
+  regs[REG_INDEX(S4)]  = gregs.regs[20];
+  regs[REG_INDEX(S5)]  = gregs.regs[21];
+  regs[REG_INDEX(S6)]  = gregs.regs[22];
+  regs[REG_INDEX(S7)]  = gregs.regs[23];
+  regs[REG_INDEX(T8)]  = gregs.regs[24];
+  regs[REG_INDEX(T9)]  = gregs.regs[25];
+  regs[REG_INDEX(K0)]  = gregs.regs[26];
+  regs[REG_INDEX(K1)]  = gregs.regs[27];
+  regs[REG_INDEX(GP)]  = gregs.regs[28];
+  regs[REG_INDEX(SP)]  = gregs.regs[29];
+  regs[REG_INDEX(FP)]  = gregs.regs[30];
+  regs[REG_INDEX(S8)]  = gregs.regs[30];
+  regs[REG_INDEX(RA)]  = gregs.regs[31];
+#endif /* mips */
+
 
   (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT);
   return array;
--- a/hotspot/agent/src/os/linux/Makefile	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/agent/src/os/linux/Makefile	Fri Oct 29 09:44:58 2010 +0800
@@ -22,7 +22,11 @@
 #  
 #
 
-ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
+ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; \
+		elif ([ `uname -m` = "x86_64" ]) ; then echo amd64 ; \
+		elif ([ `uname -m` = "sparc64" ]) ; then echo sparc ; \
+		elif ([ `uname -m` = "mips64" ]) ; then echo mips ; \
+		else echo i386 ; fi )
 GCC      = gcc
 
 JAVAH    = ${JAVA_HOME}/bin/javah
--- a/hotspot/agent/src/os/linux/libproc.h	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/agent/src/os/linux/libproc.h	Fri Oct 29 09:44:58 2010 +0800
@@ -43,6 +43,11 @@
 
 #endif //sparc or sparcv9
 
+#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el)
+#include <asm/ptrace.h>
+void abc();
+#endif
+
 /************************************************************************************
 
 0. This is very minimal subset of Solaris libproc just enough for current application.
@@ -83,7 +88,11 @@
 };
 #endif
 
-#if defined(sparc)  || defined(sparcv9)
+#if defined(sparc)  || defined(sparcv9) 
+#define user_regs_struct  pt_regs
+#endif
+
+#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el)
 #define user_regs_struct  pt_regs
 #endif
 
--- a/hotspot/make/Makefile	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/Makefile	Fri Oct 29 09:44:58 2010 +0800
@@ -89,7 +89,8 @@
 JDK_DIRS=bin include jre lib demo
 
 all:           all_product all_fastdebug
-all_product:   product product1 productkernel docs export_product
+all_product:   product1 productkernel docs export_product
+#all_product:   product product1 productkernel docs export_product
 all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
 all_debug:     jvmg1 jvmgkernel docs export_debug
 #all_debug:     jvmg jvmg1 jvmgkernel docs export_debug
@@ -303,7 +304,9 @@
 	$(install-file)
 
 # Xusage file
-$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
+# FIXME: EXPORT_SERVER_DIR is null now. aoqi
+#$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
+$(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
 	$(prep-target)
 	$(RM) $@.temp
 	$(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
--- a/hotspot/make/defs.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/defs.make	Fri Oct 29 09:44:58 2010 +0800
@@ -218,6 +218,8 @@
     endif
   endif
   ifeq ($(BUILDARCH), mips)
+    # FIXME: Simply set BUILDARCH mipsel, because loongson is mipsel. aoqi
+    BUILDARCH = mipsel
     ifdef LP64
       BUILDARCH = mips64
     endif
@@ -232,8 +234,10 @@
   LIBARCH/ia64    = ia64
   LIBARCH/mips    = mips
   LIBARCH/mips64  = mips64
+  LIBARCH/mipsel  = mipsel
+  LIBARCH/mips64el= mips64el
 
-  LP64_ARCH = sparcv9 amd64 ia64 mips64
+  LP64_ARCH = sparcv9 amd64 ia64 mips64 mips64el
 endif
 
 # Required make macro settings for all platforms
--- a/hotspot/make/linux/makefiles/buildtree.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/buildtree.make	Fri Oct 29 09:44:58 2010 +0800
@@ -114,7 +114,7 @@
 BUILDTREE_MAKE	= $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
 
 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
-        env.sh env.csh .dbxrc #test_gamma
+        env.sh env.csh .dbxrc test_gamma
 
 BUILDTREE_VARS	= GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
 	ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
--- a/hotspot/make/linux/makefiles/debug.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/debug.make	Fri Oct 29 09:44:58 2010 +0800
@@ -40,5 +40,5 @@
 
 G_SUFFIX =
 VERSION = debug
-SYSDEFS += -DASSERT -DDEBUG -DLOONGSONDEBUG
+SYSDEFS += -DASSERT -DDEBUG
 PICFLAGS = DEFAULT
--- a/hotspot/make/linux/makefiles/defs.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/defs.make	Fri Oct 29 09:44:58 2010 +0800
@@ -87,22 +87,32 @@
   HS_ARCH          = x86
 endif
 
+# mips
+ifeq ($(ARCH), mips64)
+  ARCH_DATA_MODEL  = 32
+  PLATFORM         = linux-mipsel
+  VM_PLATFORM      = linux_mipsel
+  HS_ARCH          = mips
+endif
+
 JDK_INCLUDE_SUBDIR=linux
 
 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
 VM_DEBUG=jvmg
 
 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
-EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
-EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
-EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
-EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
+#server cannot work now. FIXME aoqi
+#EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
+#EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
+#EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
+#EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
 ifeq ($(ARCH_DATA_MODEL), 32)
   EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.so
   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 
-  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
+#libsaproc.so is not generated yet, its build is in saproc.make. FIXME aoqi
+#  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
   EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
 else
   ifeq ($(ARCH),ia64)
--- a/hotspot/make/linux/makefiles/gcc.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/gcc.make	Fri Oct 29 09:44:58 2010 +0800
@@ -83,7 +83,7 @@
 endif
 
 # Compiler warnings are treated as errors
-WARNINGS_ARE_ERRORS =
+WARNINGS_ARE_ERRORS = 
 
 # Except for a few acceptable ones
 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
--- a/hotspot/make/linux/makefiles/launcher.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/launcher.make	Fri Oct 29 09:44:58 2010 +0800
@@ -31,11 +31,16 @@
 LAUNCHERFLAGS = $(ARCHFLAG) \
                 -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
                 -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
-                -DARCH=\"$(LIBARCH)\" \
                 -DGAMMA \
                 -DLAUNCHER_TYPE=\"gamma\" \
                 -DLINK_INTO_$(LINK_INTO)
 
+ifeq ($(LIBARCH),mips)
+  LAUNCHERFLAGS += -DARCH=\"mipsel\" 
+else
+  LAUNCHERFLAGS += -DARCH=\"$(LIBARCH)\" 
+endif
+
 ifeq ($(LINK_INTO),AOUT)
   LAUNCHER.o                 = launcher.o $(JVM_OBJ_FILES)
   LAUNCHER_MAPFILE           = mapfile_reorder
--- a/hotspot/make/linux/makefiles/sa.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/sa.make	Fri Oct 29 09:44:58 2010 +0800
@@ -42,6 +42,7 @@
 
 # gnumake 3.78.1 does not accept the *s that
 # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them
+# see sa.files
 AGENT_FILES1 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES1))
 AGENT_FILES2 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES2))
 
@@ -91,6 +92,8 @@
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
 	$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
+#*.java of MIPS in hotspot/agent/src/share/classes/sun has not been implemented yet. FIXME aoqi
+#$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.mips.MIPSThreadContext
 
 clean:
 	rm -rf $(SA_CLASSDIR)
--- a/hotspot/make/linux/makefiles/vm.make	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/make/linux/makefiles/vm.make	Fri Oct 29 09:44:58 2010 +0800
@@ -221,7 +221,7 @@
 
 #----------------------------------------------------------------------
 
-#TODO aoqi
+#FIXME aoqi, libsaproc[_g].so(serviceability agent) of mips has not been implemented yet.
 #build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB)
 
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Sat Oct 30 17:47:17 2010 +0800
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Fri Oct 29 09:44:58 2010 +0800
@@ -882,7 +882,6 @@
         }
       }  else {
         // if the method can be overridden, we resolve using the vtable index.
-        tty->print_cr("resolve not interface call");
         int index  = reflected_method->vtable_index();
         method = reflected_method;
         if (index != methodOopDesc::nonvirtual_vtable_index) {
--- a/jdk/make/common/Defs-linux.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/common/Defs-linux.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -109,6 +109,7 @@
 LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
 CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
 LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
+CFLAGS_REQUIRED_mips64  += -D_LITTLE_ENDIAN
 CFLAGS_REQUIRED         =  $(CFLAGS_REQUIRED_$(ARCH))
 LDFLAGS_COMMON          += $(LDFLAGS_COMMON_$(ARCH))
 
@@ -213,6 +214,10 @@
 EXTRA_LIBS += -lc
 
 LDFLAGS_DEFS_OPTION  = -z defs
+ifeq ($(ARCH), mips64)
+# MIPS do not know this defs option
+	LDFLAGS_DEFS_OPTION  = 
+endif
 LDFLAGS_COMMON  += $(LDFLAGS_DEFS_OPTION)
 
 #
@@ -269,7 +274,9 @@
 # -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
 # the library itself should not.
 #
-VM_NAME         = server
+#FIXME aoqi: server is not implemented.
+#VM_NAME         = server
+VM_NAME         = client
 JVMLIB          = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm
 JAVALIB         = -ljava $(JVMLIB)
 
--- a/jdk/make/common/Program.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/common/Program.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -85,7 +85,8 @@
 	endif
     endif
     ifeq ($(PLATFORM), linux)
-	LDFLAGS += -z origin
+# by aoqi
+#	LDFLAGS += -z origin
 	LDFLAGS += -Wl,--allow-shlib-undefined
 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
 	LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
--- a/jdk/make/common/shared/Compiler-gcc.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/common/shared/Compiler-gcc.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -58,17 +58,17 @@
 ifeq ($(PLATFORM), linux)
 
   # Settings specific to Linux
-  CC             = $(COMPILER_PATH)gcc
-  CPP            = $(COMPILER_PATH)gcc -E
+  CC             = $(COMPILER_PATH)gcc-4.2
+  CPP            = $(COMPILER_PATH)gcc-4.2 -E
   # statically link libstdc++ before C++ ABI is stablized on Linux
   STATIC_CXX     = true
   ifeq ($(STATIC_CXX),true)
     # g++ always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
     # We need to use gcc to statically link the C++ runtime. gcc and g++ use
     # the same subprocess to compile C++ files, so it is OK to build using gcc.
-    CXX            = $(COMPILER_PATH)gcc
+    CXX            = $(COMPILER_PATH)gcc-4.2
   else
-    CXX            = $(COMPILER_PATH)g++
+    CXX            = $(COMPILER_PATH)g++-4.2
   endif
   ifneq ("$(findstring sparc,$(ARCH))", "")
     # sparc or sparcv9
--- a/jdk/make/common/shared/Platform.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/common/shared/Platform.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -241,6 +241,11 @@
     LIBARCH = $(ARCH)
   endif
 
+	# Need to choose el or eb. Now simply set LIBARCH mipsel because Loongson is mipsel. FIXME aoqi
+  ifeq ($(ARCH), mips64)
+		LIBARCH = mipsel
+	endif
+
   # Value of Java os.arch property
   ARCHPROP  = $(LIBARCH)
 
--- a/jdk/make/java/instrument/Makefile	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/java/instrument/Makefile	Fri Oct 29 09:44:58 2010 +0800
@@ -109,7 +109,8 @@
     LDFLAGS += -R \$$ORIGIN/jli
   endif
   ifeq ($(PLATFORM), linux)
-    LDFLAGS += -z origin
+#by aoqi
+#    LDFLAGS += -z origin
     LDFLAGS += -Wl,--allow-shlib-undefined
     LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
   endif
--- a/jdk/make/java/redist/Makefile	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/java/redist/Makefile	Fri Oct 29 09:44:58 2010 +0800
@@ -38,7 +38,8 @@
 PRODUCT  = java
 include $(BUILDDIR)/common/Defs.gmk
 
-SERVER_LOCATION = server
+#FIXME aoqi: SERVER_LOCATION in this file is unused. 
+#SERVER_LOCATION = server
 CLIENT_LOCATION = client
 
 DB_SUFFIX = _db
@@ -67,8 +68,8 @@
 INTERNAL_IMPORT_LIST = $(LIBDIR)/classlist
 
 # List of files coming from outside this workspace
-IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
-              $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
+#IMPORT_LIST = $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME) \
+#              $(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt
 
 # INCLUDE_SA is false on platforms where SA is not supported.
 # On platforms where it is supported, we want to allow it to
@@ -84,6 +85,8 @@
 ifeq ($(SA_EXISTS), false)
   INCLUDE_SA := false
 endif
+#SA has not been implemented yet. FIXME aoqi
+INCLUDE_SA = false
 
 ifeq ($(INCLUDE_SA), true)
   IMPORT_LIST += $(LIBDIR)/sa-jdi.jar \
@@ -118,9 +121,9 @@
 
 # Get the hotspot .map and .pdb files for client and server
 IMPORT_LIST += \
-	$(LIBDIR)/$(JVMLIB_NAME) \
-	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
-	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
+	$(LIBDIR)/$(JVMLIB_NAME) 
+#	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME) \
+#	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME)
 
 # Hotspot client is only available on 32-bit builds
 ifeq ($(ARCH_DATA_MODEL), 32)
@@ -137,25 +140,25 @@
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMMAP_NAME)  $@
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
-	@$(prep-target)
-	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMMAP_NAME):
+#	@$(prep-target)
+#	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMMAP_NAME) $@
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMPDB_NAME):
 	@$(prep-target)
 	-$(CP) $(HOTSPOT_CLIENT_PATH)/$(JVMPDB_NAME)  $@
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
-	@$(prep-target)
-	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMPDB_NAME): 
+#	@$(prep-target)
+#	-$(CP) $(HOTSPOT_SERVER_PATH)/$(JVMPDB_NAME) $@
 
 #  Windows     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  Windows
 else # PLATFORM
 #  NOT Windows vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  NOT Windows
 
 IMPORT_LIST += \
-        $(LIB_LOCATION)/$(LIBJSIG_NAME) \
-	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
+        $(LIB_LOCATION)/$(LIBJSIG_NAME) 
+#	$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME)
 
 ifeq ($(PLATFORM), solaris)
   IMPORT_LIST += $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME)
@@ -198,11 +201,12 @@
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_NAME)
 	$(install-import-file)
 
-$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
+#$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_SERVER_PATH)/$(LIBJSIG_NAME)
+$(LIB_LOCATION)/$(LIBJSIG_NAME): $(HOTSPOT_CLIENT_PATH)/$(LIBJSIG_NAME)
 	$(install-import-file)
 
-$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME) \
-$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
+$(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME): 
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME):
 	@$(prep-target)
 	$(LN) -s ../$(LIBJSIG_NAME) $@
 
@@ -212,17 +216,17 @@
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_NAME)
 	$(install-import-file)
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
-	$(install-import-file)
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_NAME)
+#	$(install-import-file)
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
-	$(install-import-file)
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_NAME)
+#	$(install-import-file)
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
-	$(install-import-file)
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_NAME)
+#	$(install-import-file)
 
-$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
-	$(install-import-file)
+#$(LIB_LOCATION)/$(SERVER_LOCATION)/Xusage.txt : $(HOTSPOT_SERVER_PATH)/Xusage.txt
+#	$(install-import-file)
 
 $(LIB_LOCATION)/$(CLIENT_LOCATION)/Xusage.txt : $(HOTSPOT_CLIENT_PATH)/Xusage.txt
 	$(install-import-file)
--- a/jdk/make/javax/sound/SoundDefs.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/make/javax/sound/SoundDefs.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -71,6 +71,10 @@
   CPPFLAGS += -DX_ARCH=X_AMD64
 endif # ARCH amd64
 
+ifeq ($(ARCH), mips64)
+  CPPFLAGS += -DX_ARCH=X_MIPS64
+endif # ARCH amd64
+
 
 # files needed for MIDI i/o
 MIDIFILES_c = \
--- a/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	Sat Oct 30 17:47:17 2010 +0800
+++ b/jdk/src/share/native/com/sun/media/sound/SoundDefs.h	Fri Oct 29 09:44:58 2010 +0800
@@ -38,6 +38,7 @@
 #define X_SPARCV9       3
 #define X_IA64          4
 #define X_AMD64         5
+#define X_MIPS64        6
 
 // **********************************
 // Make sure you set X_PLATFORM and X_ARCH defines correctly.
--- a/make/hotspot-rules.gmk	Sat Oct 30 17:47:17 2010 +0800
+++ b/make/hotspot-rules.gmk	Fri Oct 29 09:44:58 2010 +0800
@@ -64,7 +64,7 @@
 # Basic hotspot build and export of it's files
 #
 
-HOTSPOT_TARGET = product1
+HOTSPOT_TARGET = all_product
 ifeq ($(DEBUG_NAME), debug)
   HOTSPOT_TARGET = all_debug
 endif