changeset 3767:54d8193f177b

7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code Summary: Cross-compilation support Reviewed-by: ohair, andrew
author dholmes
date Wed, 16 Mar 2011 18:54:50 -0400
parents 05911dc54a67
children df9991dc1f0d
files make/common/Defs-linux.gmk make/common/Defs.gmk make/common/Program.gmk make/common/shared/Defs-linux.gmk make/common/shared/Defs-solaris.gmk make/common/shared/Defs-utils.gmk make/common/shared/Defs-versions.gmk make/common/shared/Platform.gmk make/common/shared/Sanity-Settings.gmk make/common/shared/Sanity.gmk make/java/instrument/Makefile make/java/nio/Makefile make/javax/sound/SoundDefs.gmk make/sun/jdbc/Makefile make/tools/Makefile src/share/native/com/sun/media/sound/SoundDefs.h src/share/native/java/lang/fdlibm/include/fdlibm.h
diffstat 17 files changed, 184 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Defs-linux.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/Defs-linux.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -107,6 +107,8 @@
 LDFLAGS_COMMON_sparcv9  += -m64 -mcpu=v9
 CFLAGS_REQUIRED_sparc   += -m32 -mcpu=v9
 LDFLAGS_COMMON_sparc    += -m32 -mcpu=v9
+CFLAGS_REQUIRED_arm     += -fsigned-char -D_LITTLE_ENDIAN
+CFLAGS_REQUIRED_ppc     += -fsigned-char -D_BIG_ENDIAN
 ifeq ($(ZERO_BUILD), true)
   CFLAGS_REQUIRED       =  $(ZERO_ARCHFLAG)
   ifeq ($(ZERO_ENDIANNESS), little)
@@ -143,11 +145,9 @@
 #
 # Misc compiler options
 #
-ifeq ($(ARCH),ppc)
-  CFLAGS_COMMON   = -fsigned-char
-else # ARCH
+ifneq ($(ARCH),ppc)
   CFLAGS_COMMON   = -fno-strict-aliasing
-endif # ARCH
+endif 
 PIC_CODE_LARGE = -fPIC
 PIC_CODE_SMALL = -fpic
 GLOBAL_KPIC = $(PIC_CODE_LARGE)
@@ -219,8 +219,19 @@
   #   The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
   #   Try: 'readelf -d lib*.so' to see these settings in a library.
   #
-  LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
-  LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
+  Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
+  Z_ORIGIN_FLAG/i586  = -Xlinker -z -Xlinker origin
+  Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin 
+  Z_ORIGIN_FLAG/ia64  = -Xlinker -z -Xlinker origin
+  Z_ORIGIN_FLAG/arm   = 
+  Z_ORIGIN_FLAG/ppc   =
+  Z_ORIGIN_FLAG/zero  = -Xlinker -z -Xlinker origin
+
+  LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
+
+  LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
+  LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
+
 endif
 
 EXTRA_LIBS += -lc
@@ -315,7 +326,6 @@
 override LIBTHREAD               =
 override MOOT_PRIORITIES         = true
 override NO_INTERRUPTIBLE_IO     = true
-override OPENWIN_HOME            = /usr/X11R6
 ifeq ($(ARCH), amd64)
 override OPENWIN_LIB             = $(OPENWIN_HOME)/lib64
 else
@@ -359,3 +369,9 @@
   INCLUDE_SA = true
 endif
 
+ifdef CROSS_COMPILE_ARCH
+  # X11 headers are not under /usr/include
+  OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
+  OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
+  OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
+endif
--- a/make/common/Defs.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/Defs.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -115,11 +115,36 @@
 
 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
 
+#
+# Cross-compilation Settings
+#
+ifdef CROSS_COMPILE_ARCH
+  # Can't run the tools we just built
+  USE_ONLY_BOOTDIR_TOOLS = true
+
+  # When cross-compiling CC generates code for the target, but
+  # some parts of the build generate C code that has to be compiled
+  # and executed on the build host - HOST_CC is the 'local' compiler.
+  # For linux the default is /usr/bin/gcc; other platforms need to
+  # set it explicitly
+  ifeq ($(PLATFORM), linux)
+    ifndef HOST_CC
+      HOST_CC = $(USRBIN_PATH)gcc
+    endif
+  endif
+else
+  # Must set HOST_CC if not already set
+  ifndef HOST_CC
+    HOST_CC = $(CC)
+  endif
+endif
+
 # Reset the VM name for client-only builds
 ifdef BUILD_CLIENT_ONLY
   VM_NAME = client
 endif
 
+
 #
 # Freetype logic is applicable to OpenJDK only
 #
@@ -339,8 +364,7 @@
 
 INCLUDES = -I. -I$(CLASSHDRDIR) \
 	$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
-OTHER_CPPFLAGS = $(INCLUDES)
-
+OTHER_CPPFLAGS += $(INCLUDES)
 
 #
 # vpaths.  These are the default locations searched for source files.
@@ -471,9 +495,11 @@
 #
 # Tool flags
 #
+# EXTRA_CFLAGS are used to define cross-compilation options
+#
 ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
-CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS)
-CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
+CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
+CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
 CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
 		  $(DEFINES) $(OPTIONS:%=-D%)
 LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
--- a/make/common/Program.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/Program.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -83,7 +83,7 @@
 	endif
     endif
     ifeq ($(PLATFORM), linux)
-	LDFLAGS += -Wl,-z -Wl,origin
+	LDFLAGS += $(LDFLAG_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/make/common/shared/Defs-linux.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Defs-linux.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -102,6 +102,14 @@
   COMPILER_PATH  =/usr/bin/
 endif
 
+# OPENWIN_HOME: path to where the X11 environment is installed.
+#  NOTE: Must end with / so that it could be empty, allowing PATH usage.
+ifneq ($(ALT_OPENWIN_HOME),)
+  OPENWIN_HOME :=$(call PrefixPath,$(ALT_OPENWIN_HOME))
+else
+  OPENWIN_HOME  =/usr/X11R6/
+endif
+
 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
 #  NOTE: Must end with / so that it could be empty, allowing PATH usage.
 ifneq "$(origin ALT_DEVTOOLS_PATH)" "undefined"
@@ -181,6 +189,7 @@
 
 # Macro to check it's input file for banned dependencies and verify the
 #   binary built properly. Relies on process exit code.
+ifndef CROSS_COMPILE_ARCH
 define binary_file_verification # binary_file
 ( \
   $(ECHO) "Checking for mapfile use in: $1" && \
@@ -193,4 +202,10 @@
   ( $(READELF) -d $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
 )
 endef
-
+else
+define binary_file_verification 
+( \
+  $(ECHO) "Skipping binary file verification for cross-compile build" \
+)
+endef
+endif
\ No newline at end of file
--- a/make/common/shared/Defs-solaris.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Defs-solaris.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -190,6 +190,7 @@
 
 # Macro to check it's input file for banned dependencies and verify the
 #   binary built properly. Relies on process exit code.
+ifndef CROSS_COMPILE_ARCH
 define binary_file_verification # binary_file
 ( \
   $(ECHO) "Checking for mapfile use in: $1" && \
@@ -202,4 +203,10 @@
   ( $(DUMP) -L -v $1 | $(EGREP) 'NEEDED|RUNPATH|RPATH' ) \
 )
 endef
-
+else
+define binary_file_verification 
+( \
+  $(ECHO) "Skipping binary file verification for cross-compile build" \
+)
+endef
+endif
\ No newline at end of file
--- a/make/common/shared/Defs-utils.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Defs-utils.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -68,9 +68,23 @@
 endif
 
 # Utilities
+ifdef CROSS_COMPILE_ARCH
+  AR             = $(COMPILER_PATH)ar
+  AS             = $(COMPILER_PATH)as
+  LD             = $(COMPILER_PATH)ld
+  MCS            = $(COMPILER_PATH)mcs
+  NM             = $(COMPILER_PATH)nm
+  STRIP          = $(COMPILER_PATH)strip
+else
+  AR             = $(UTILS_CCS_BIN_PATH)ar
+  AS             = $(UTILS_CCS_BIN_PATH)as
+  LD             = $(UTILS_CCS_BIN_PATH)ld
+  MCS            = $(UTILS_CCS_BIN_PATH)mcs
+  NM             = $(UTILS_CCS_BIN_PATH)nm
+  STRIP          = $(UTILS_CCS_BIN_PATH)strip
+endif
+
 ADB            = $(UTILS_COMMAND_PATH)adb
-AR             = $(UTILS_CCS_BIN_PATH)ar
-AS             = $(UTILS_CCS_BIN_PATH)as
 BASENAME       = $(UTILS_COMMAND_PATH)basename
 BZIP2          = $(UTILS_COMMAND_PATH)bzip2
 CAT            = $(UTILS_COMMAND_PATH)cat
@@ -99,19 +113,16 @@
 ID             = $(UTILS_COMMAND_PATH)id
 ISAINFO        = $(UTILS_COMMAND_PATH)isainfo
 KSH            = $(UTILS_COMMAND_PATH)ksh
-LD             = $(UTILS_CCS_BIN_PATH)ld
 LDD            = $(UTILS_USR_BIN_PATH)ldd
 LEX            = $(UTILS_CCS_BIN_PATH)lex
 LN             = $(UTILS_COMMAND_PATH)ln
 LS             = $(UTILS_COMMAND_PATH)ls
-MCS            = $(UTILS_CCS_BIN_PATH)mcs
 M4             = $(UTILS_CCS_BIN_PATH)m4
 MKDIR          = $(UTILS_COMMAND_PATH)mkdir
 MKSINFO        = $(UTILS_COMMAND_PATH)mksinfo
 MSGFMT         = $(UTILS_USR_BIN_PATH)msgfmt
 MV             = $(UTILS_COMMAND_PATH)mv
 NAWK           = $(UTILS_USR_BIN_PATH)nawk
-NM             = $(UTILS_CCS_BIN_PATH)nm
 PKGMK          = $(UTILS_COMMAND_PATH)pkgmk
 PRINTF         = $(UTILS_USR_BIN_PATH)printf
 PWD            = $(UTILS_COMMAND_PATH)pwd
@@ -123,7 +134,6 @@
 SH             = $(UTILS_COMMAND_PATH)sh
 SHOWREV        = $(UTILS_USR_BIN_PATH)showrev
 SORT           = $(UTILS_COMMAND_PATH)sort
-STRIP          = $(UTILS_CCS_BIN_PATH)strip
 TAIL           = $(UTILS_USR_BIN_PATH)tail
 TAR            = $(UTILS_COMMAND_PATH)tar
 TEST           = $(UTILS_USR_BIN_PATH)test
@@ -186,14 +196,16 @@
   # Intrinsic unix command, with backslash-escaped character interpretation
   ECHO           = /bin/echo -e
   # These are really in UTILS_USR_BIN_PATH on Linux
-  AR             = $(UTILS_USR_BIN_PATH)ar
-  AS             = $(UTILS_USR_BIN_PATH)as
-  LD             = $(UTILS_USR_BIN_PATH)ld
+  ifndef CROSS_COMPILE_ARCH
+    AR             = $(UTILS_USR_BIN_PATH)ar
+    AS             = $(UTILS_USR_BIN_PATH)as
+    LD             = $(UTILS_USR_BIN_PATH)ld
+    MCS            = $(UTILS_USR_BIN_PATH)mcs
+    NM             = $(UTILS_USR_BIN_PATH)nm
+    STRIP          = $(UTILS_USR_BIN_PATH)strip
+  endif
   LEX            = $(UTILS_USR_BIN_PATH)lex
-  MCS            = $(UTILS_USR_BIN_PATH)mcs
   M4             = $(UTILS_USR_BIN_PATH)m4
-  NM             = $(UTILS_USR_BIN_PATH)nm
-  STRIP          = $(UTILS_USR_BIN_PATH)strip
   YACC           = $(UTILS_USR_BIN_PATH)yacc
 endif
 
--- a/make/common/shared/Defs-versions.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Defs-versions.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -138,11 +138,15 @@
   endif
   REQUIRED_COMPILER_NAME      = Sun Studio 12 Update 1
   REQUIRED_COMPILER_VERSION   = SS12u1
-  ifeq ($(CC_VERSION),sun)
-    REQUIRED_CC_VER           = 5.10
-  endif
-  ifeq ($(CC_VERSION),gcc)
-    REQUIRED_CC_VER           = 3.4.3
+  # Cross-compilation compiler versions are target specific
+  # so don't set a required version if cross-compiling
+  ifndef CROSS_COMPILE_ARCH
+    ifeq ($(CC_VERSION),sun)
+      REQUIRED_CC_VER           = 5.10
+    endif
+    ifeq ($(CC_VERSION),gcc)
+      REQUIRED_CC_VER           = 3.4.3
+    endif
   endif
   REQUIRED_GCC_VER            = 2.95.2
 endif
@@ -158,11 +162,15 @@
   REQUIRED_COMPILER_NAME      = GCC4
   REQUIRED_COMPILER_VERSION   = GCC4
   REQUIRED_GCC_VER            = 2.95
-  ifeq ($(CC_VERSION),gcc)
-    REQUIRED_CC_VER           = 4.3.0
-  endif
-  ifeq ($(CC_VERSION),sun)
-    REQUIRED_CC_VER           = 5.10
+  # Cross-compilation compiler versions are target specific
+  # so don't set a required version if cross-compiling
+  ifndef CROSS_COMPILE_ARCH
+    ifeq ($(CC_VERSION),gcc)
+      REQUIRED_CC_VER           = 4.3.0
+    endif
+    ifeq ($(CC_VERSION),sun)
+      REQUIRED_CC_VER           = 5.10
+    endif
   endif
 endif
 
--- a/make/common/shared/Platform.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Platform.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -155,7 +155,11 @@
 ifeq ($(SYSTEM_UNAME), Linux)
   PLATFORM = linux
   # Arch and OS name/version
-  mach := $(shell uname -m)
+  ifdef CROSS_COMPILE_ARCH
+    mach := $(CROSS_COMPILE_ARCH)
+  else
+    mach := $(shell uname -m)
+  endif
   archExpr = case "$(mach)" in \
                 i[3-9]86) \
                     echo i586 \
@@ -192,11 +196,13 @@
       ARCH=sparcv9
     endif
   else
-    # i586 is 32-bit, amd64 is 64-bit
+    # Most archs are 32-bit
     ifndef ARCH_DATA_MODEL
-      ifeq ($(ARCH), i586)
-        ARCH_DATA_MODEL=32
-      else
+      ARCH_DATA_MODEL=32
+      ifeq ($(ARCH), amd64)
+        ARCH_DATA_MODEL=64
+      endif
+      ifeq ($(ARCH), ia64)
         ARCH_DATA_MODEL=64
       endif
     endif
--- a/make/common/shared/Sanity-Settings.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Sanity-Settings.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -104,7 +104,11 @@
 endif
 ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
 ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
-ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
+ifdef REQUIRED_CC_VER
+  ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
+else
+  ALL_SETTINGS+=$(call addOptionalSetting,CC_VER)
+endif
 ifeq ($(PLATFORM),solaris)
   ifeq ($(ARCH_DATA_MODEL), 32)
     ifndef OPENJDK
--- a/make/common/shared/Sanity.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/common/shared/Sanity.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -817,23 +817,26 @@
 ######################################################
 
 ifdef OPENJDK
-
-# The freetypecheck Makefile prints out "Failed" if not good enough
-$(TEMPDIR)/freetypeinfo: FRC
+  ifndef CROSS_COMPILE_ARCH
+    # The freetypecheck Makefile prints out "Failed" if not good enough
+    $(TEMPDIR)/freetypeinfo: FRC
 	@$(prep-target)
 	@(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
 	    $(ECHO) "Failed to build freetypecheck." ) > $@
 
-sane-freetype: $(TEMPDIR)/freetypeinfo
+    sane-freetype: $(TEMPDIR)/freetypeinfo
 	@if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
 	  $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
 	          " or higher is required. \n" \
 		  "`$(CAT) $<`  \n" >> $(ERROR_FILE) ; \
 	fi
-
+  else
+    #do nothing  (cross-compiling)
+    sane-freetype: 
+  endif
 else
-#do nothing  (not OpenJDK)
-sane-freetype: 
+  #do nothing  (not OpenJDK)
+  sane-freetype: 
 endif
 
 ######################################################
@@ -1343,13 +1346,16 @@
 ######################################################
 # Check the compiler version(s)
 ######################################################
-CC_CHECK  :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
+ifdef REQUIRED_CC_VER
+  CC_CHECK  :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
+endif
 sane-compiler: sane-link
+ifdef REQUIRED_CC_VER
 	@if [ "$(CC_CHECK)" = "missing" ]; then \
 	  $(ECHO) "ERROR: The Compiler version is undefined. \n" \
 	    "" >> $(ERROR_FILE) ; \
 	fi
-ifndef OPENJDK
+  ifndef OPENJDK
 	@if [ "$(CC_CHECK)" != "same" ]; then \
 	      $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(REQUIRED_COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
 	      "      Specifically the $(REQUIRED_COMPILER_NAME) compiler. \n " \
@@ -1358,6 +1364,7 @@
 	      "          $(COMPILER_PATH) \n" \
 	      "" >> $(WARNING_FILE) ; \
          fi
+  endif
 endif
 
 ######################################################
--- a/make/java/instrument/Makefile	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/java/instrument/Makefile	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,7 @@
     LDFLAGS += -R \$$ORIGIN/jli
   endif
   ifeq ($(PLATFORM), linux)
-    LDFLAGS += -Wl,-z -Wl,origin
+    LDFLAGS += $(LDFLAG_Z_ORIGIN)
     LDFLAGS += -Wl,--allow-shlib-undefined
     LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/jli
   endif
--- a/make/java/nio/Makefile	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/java/nio/Makefile	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -820,7 +820,7 @@
 
 $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
 	$(prep-target)
-	($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
+	($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
 	   -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
 
 $(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
@@ -851,7 +851,7 @@
 
 $(GENUC_EXE) : $(GENUC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
+	$(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
 
 $(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
 	$(prep-target)
@@ -867,7 +867,7 @@
 
 $(GENSC_EXE) : $(GENSC_SRC)
 	$(prep-target)
-	$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
+	$(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
 
 $(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
 	$(prep-target)
--- a/make/javax/sound/SoundDefs.gmk	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/javax/sound/SoundDefs.gmk	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,15 @@
   ifeq ($(ARCH), amd64)
     CPPFLAGS += -DX_ARCH=X_AMD64
   endif # ARCH amd64
+
+  ifeq ($(ARCH), arm)
+    CPPFLAGS += -DX_ARCH=X_ARM
+  endif # ARCH arm
+
+  ifeq ($(ARCH), ppc)
+    CPPFLAGS += -DX_ARCH=X_PPC
+  endif # ARCH ppc
+
 endif
 
 
--- a/make/sun/jdbc/Makefile	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/sun/jdbc/Makefile	Wed Mar 16 18:54:50 2011 -0400
@@ -61,7 +61,7 @@
   #    ODBC_LIBRARY_LOCATION, and delete the variable assignments below.
   #
   # Tell linker to ignore missing externals when building this shared library.
-  LDFLAGS_DEFS_OPTION = -z nodefs
+  LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker nodefs
   # Define a place to create the fake libraries and their names.
   ODBC_LIBRARY_LOCATION = $(TEMPDIR)
   ODBC_FAKE_LIBRARIES = $(ODBC_LIBRARY_LOCATION)/libodbcinst.so $(ODBC_LIBRARY_LOCATION)/libodbc.so
--- a/make/tools/Makefile	Wed Mar 16 12:16:00 2011 -0700
+++ b/make/tools/Makefile	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 BUILDDIR = ..
 include $(BUILDDIR)/common/Defs.gmk
 
+# Note: freetypecheck is built by Sanity.gmk if needed
 SUBDIRS =                   \
   addjsum                   \
   buildmetaindex            \
@@ -38,7 +39,6 @@
   compile_properties        \
   dir_diff                  \
   dtdbuilder                \
-  freetypecheck             \
   generate_break_iterator   \
   GenerateCharacter         \
   generatecurrencydata      \
--- a/src/share/native/com/sun/media/sound/SoundDefs.h	Wed Mar 16 12:16:00 2011 -0700
+++ b/src/share/native/com/sun/media/sound/SoundDefs.h	Wed Mar 16 18:54:50 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,8 @@
 #define X_IA64          4
 #define X_AMD64         5
 #define X_ZERO          6
+#define X_ARM           7
+#define X_PPC           8
 
 // **********************************
 // Make sure you set X_PLATFORM and X_ARCH defines correctly.
--- a/src/share/native/java/lang/fdlibm/include/fdlibm.h	Wed Mar 16 12:16:00 2011 -0700
+++ b/src/share/native/java/lang/fdlibm/include/fdlibm.h	Wed Mar 16 18:54:50 2011 -0400
@@ -1,6 +1,6 @@
 
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,8 @@
 
 #ifdef __NEWVALID       /* special setup for Sun test regime */
 #if defined(i386) || defined(i486) || \
-        defined(intel) || defined(x86) || \
-        defined(i86pc) || defined(_M_IA64) || defined(ia64)
+    defined(intel) || defined(x86) || defined(arm) || \
+    defined(i86pc) || defined(_M_IA64) || defined(ia64)
 #define _LITTLE_ENDIAN
 #endif
 #endif