# HG changeset patch # User asaha # Date 1396458098 25200 # Node ID feeb67be58866a036bd1d244ceb69507636cba61 # Parent 065b9ded4bf2449fc89f9e5768468b1ae5d3bc1e# Parent 00b798f15cc63dcf408cfc7d7b182117f1a7df8b Merge diff -r 065b9ded4bf2 -r feeb67be5886 .hgtags --- a/.hgtags Mon Mar 31 14:06:57 2014 -0700 +++ b/.hgtags Wed Apr 02 10:01:38 2014 -0700 @@ -280,3 +280,4 @@ 69e0af208dad70fdef65a89ab2c4c468ed9e24b8 jdk8u20-b05 ae6a3aec6aa29509a0fd5f53709889b99b1e27da jdk8u20-b06 6403ef94cb0db32d9221a5e8f09f3664cd7744dc jdk8u20-b07 +b7750b6ee1578fd5b2b1f6758f905b332503d8ed jdk8u20-b08 diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/boot-jdk.m4 --- a/common/autoconf/boot-jdk.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/boot-jdk.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -316,7 +316,7 @@ # Minimum amount of heap memory. ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA]) - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + if test "x$OPENJDK_TARGET_OS" = "xmacosx" || test "x$OPENJDK_TARGET_CPU" = "xppc64" ; then # Why does macosx need more heap? Its the huge JDK batch. ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA]) else diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/build-aux/config.guess --- a/common/autoconf/build-aux/config.guess Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/build-aux/config.guess Wed Apr 02 10:01:38 2014 -0700 @@ -60,4 +60,20 @@ esac fi +# Test and fix architecture string on AIX +# On AIX 'config.guess' returns 'powerpc' as architecture but 'powerpc' is +# implicitely handled as 32-bit architecture in 'platform.m4' so we check +# for the kernel mode rewrite it to 'powerpc64' if we'Re running in 64-bit mode. +# The check could also be done with `/usr/sbin/prtconf | grep "Kernel Type" | grep "64-bit"` +echo $OUT | grep powerpc-ibm-aix > /dev/null 2> /dev/null +if test $? = 0; then + if [ -x /bin/getconf ] ; then + KERNEL_BITMODE=`getconf KERNEL_BITMODE` + if [ "$KERNEL_BITMODE" = "32" ]; then + KERNEL_BITMODE="" + fi + fi + OUT=powerpc$KERNEL_BITMODE`echo $OUT | sed -e 's/[^-]*//'` +fi + echo $OUT diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/build-performance.m4 --- a/common/autoconf/build-performance.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/build-performance.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -41,6 +41,9 @@ # Looks like a MacOSX system NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` FOUND_CORES=yes + elif test "x$OPENJDK_BUILD_OS" = xaix ; then + NUM_CORES=`/usr/sbin/prtconf | grep "^Number Of Processors" | awk '{ print [$]4 }'` + FOUND_CORES=yes elif test -n "$NUMBER_OF_PROCESSORS"; then # On windows, look in the env NUM_CORES=$NUMBER_OF_PROCESSORS @@ -68,8 +71,8 @@ MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` FOUND_MEM=yes elif test -x /usr/sbin/prtconf; then - # Looks like a Solaris system - MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'` + # Looks like a Solaris or AIX system + MEMORY_SIZE=`/usr/sbin/prtconf | grep "^Memory [[Ss]]ize" | awk '{ print [$]3 }'` FOUND_MEM=yes elif test -x /usr/sbin/system_profiler; then # Looks like a MacOSX system diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/configure.ac --- a/common/autoconf/configure.ac Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/configure.ac Wed Apr 02 10:01:38 2014 -0700 @@ -88,6 +88,7 @@ # These are needed to be able to create a configuration name (and thus the output directory) JDKOPT_SETUP_JDK_VARIANT +JDKOPT_SETUP_JVM_INTERPRETER JDKOPT_SETUP_JVM_VARIANTS JDKOPT_SETUP_DEBUG_LEVEL diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/help.m4 --- a/common/autoconf/help.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/help.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -52,8 +52,6 @@ pkgutil_help $MISSING_DEPENDENCY ;; pkgadd) pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; esac if test "x$PKGHANDLER_COMMAND" != x; then @@ -92,8 +90,6 @@ If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." fi ;; - * ) - break ;; esac } @@ -119,8 +115,6 @@ PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev libxt-dev" ;; ccache) PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; - * ) - break ;; esac } @@ -142,8 +136,6 @@ PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel" ;; ccache) PKGHANDLER_COMMAND="sudo yum install ccache" ;; - * ) - break ;; esac } diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/hotspot-spec.gmk.in --- a/common/autoconf/hotspot-spec.gmk.in Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/hotspot-spec.gmk.in Wed Apr 02 10:01:38 2014 -0700 @@ -91,6 +91,11 @@ ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR) ALT_EXPORT_PATH=$(HOTSPOT_DIST) +JVM_INTERPRETER:=@JVM_INTERPRETER@ +ifeq ($(JVM_INTERPRETER), cpp) + CC_INTERP=true +endif + HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@ # This is used from the libjvm build for C/C++ code. HOTSPOT_BUILD_JOBS:=$(JOBS) diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/jdk-options.m4 --- a/common/autoconf/jdk-options.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/jdk-options.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -51,6 +51,33 @@ AC_MSG_RESULT([$JDK_VARIANT]) ]) +AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER], +[ +############################################################################### +# +# Check which interpreter of the JVM we want to build. +# Currently we have: +# template: Template interpreter (the default) +# cpp : C++ interpreter +AC_MSG_CHECKING([which interpreter of the JVM to build]) +AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter], + [JVM interpreter to build (template, cpp) @<:@template@:>@])]) + +if test "x$with_jvm_interpreter" = x; then + with_jvm_interpreter="template" +fi + +JVM_INTERPRETER="$with_jvm_interpreter" + +if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then + AC_MSG_ERROR([The available JVM interpreters are: template, cpp]) +fi + +AC_SUBST(JVM_INTERPRETER) + +AC_MSG_RESULT([$with_jvm_interpreter]) +]) + AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS], [ @@ -65,19 +92,20 @@ # ie normal interpreter and C1, only the serial GC, kernel jvmti etc # zero: no machine code interpreter, no compiler # zeroshark: zero interpreter and shark/llvm compiler backend +# core: interpreter only, no compiler (only works on some platforms) AC_MSG_CHECKING([which variants of the JVM to build]) AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], - [JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark) @<:@server@:>@])]) + [JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])]) if test "x$with_jvm_variants" = x; then with_jvm_variants="server" fi JVM_VARIANTS=",$with_jvm_variants," - TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'` + TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'` if test "x$TEST_VARIANTS" != "x,"; then - AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark]) + AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core]) fi AC_MSG_RESULT([$with_jvm_variants]) @@ -87,6 +115,7 @@ JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'` JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'` JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'` + JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'` if test "x$JVM_VARIANT_CLIENT" = xtrue; then if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then @@ -106,7 +135,7 @@ # Replace the commas with AND for use in the build directory name. ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'` - COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'` + COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'` if test "x$COUNT_VARIANTS" != "x,1"; then BUILDING_MULTIPLE_JVM_VARIANTS=yes else @@ -120,6 +149,7 @@ AC_SUBST(JVM_VARIANT_KERNEL) AC_SUBST(JVM_VARIANT_ZERO) AC_SUBST(JVM_VARIANT_ZEROSHARK) + AC_SUBST(JVM_VARIANT_CORE) INCLUDE_SA=true if test "x$JVM_VARIANT_ZERO" = xtrue ; then @@ -128,6 +158,9 @@ if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then INCLUDE_SA=false fi + if test "x$VAR_CPU" = xppc64 ; then + INCLUDE_SA=false + fi AC_SUBST(INCLUDE_SA) if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then @@ -236,6 +269,10 @@ HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark " fi + if test "x$JVM_VARIANT_CORE" = xtrue; then + HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core " + fi + HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" # On Macosx universal binaries are produced, but they only contain diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/libraries.m4 --- a/common/autoconf/libraries.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/libraries.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -43,6 +43,14 @@ AC_MSG_RESULT([alsa pulse]) fi + if test "x$OPENJDK_TARGET_OS" = xaix; then + AC_MSG_CHECKING([what is not needed on AIX?]) + ALSA_NOT_NEEDED=yes + PULSE_NOT_NEEDED=yes + AC_MSG_RESULT([alsa pulse]) + fi + + if test "x$OPENJDK_TARGET_OS" = xwindows; then AC_MSG_CHECKING([what is not needed on Windows?]) CUPS_NOT_NEEDED=yes diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/platform.m4 --- a/common/autoconf/platform.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/platform.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -126,6 +126,11 @@ VAR_OS_API=winapi VAR_OS_ENV=windows.msys ;; + *aix*) + VAR_OS=aix + VAR_OS_API=posix + VAR_OS_ENV=aix + ;; *) AC_MSG_ERROR([unsupported operating system $1]) ;; @@ -432,9 +437,9 @@ # keep track of these additions in ADDED_CFLAGS etc. These # will later be checked to make sure only controlled additions # have been made to CFLAGS etc. - ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" - ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" - ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}" + ADDED_CFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" + ADDED_CXXFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" + ADDED_LDFLAGS=" ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" CFLAGS="${CFLAGS}${ADDED_CFLAGS}" CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}" @@ -454,8 +459,9 @@ # is made at runtime.) # - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Always specify -m flags on Solaris + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xaix; then + # Always specify -m flag on Solaris + # And -q on AIX because otherwise the compiler produces 32-bit objects by default PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS elif test "x$COMPILE_TYPE" = xreduced; then if test "x$OPENJDK_TARGET_OS" != xwindows; then @@ -477,19 +483,34 @@ AC_CHECK_SIZEOF([int *], [1111]) - if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then - # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html - SIZEOF_INT_P="$ac_cv_sizeof_int_p" - fi - - if test "x$SIZEOF_INT_P" = x; then + # AC_CHECK_SIZEOF defines 'ac_cv_sizeof_int_p' to hold the number of bytes used by an 'int*' + if test "x$ac_cv_sizeof_int_p" = x; then # The test failed, lets stick to the assumed value. AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.]) else - TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P` + TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then - AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) + # This situation may happen on 64-bit platforms where the compiler by default only generates 32-bit objects + # Let's try to implicitely set the compilers target architecture and retry the test + AC_MSG_NOTICE([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS).]) + AC_MSG_NOTICE([I'll retry after setting the platforms compiler target bits flag to ${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}]) + PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS + + # We have to unset 'ac_cv_sizeof_int_p' first, otherwise AC_CHECK_SIZEOF will use the previously cached value! + unset ac_cv_sizeof_int_p + # And we have to undef the definition of SIZEOF_INT_P in confdefs.h by the previous invocation of AC_CHECK_SIZEOF + cat >>confdefs.h <<_ACEOF +#undef SIZEOF_INT_P +_ACEOF + + AC_CHECK_SIZEOF([int *], [1111]) + + TESTED_TARGET_CPU_BITS=`expr 8 \* $ac_cv_sizeof_int_p` + + if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then + AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) + fi fi fi diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/spec.gmk.in Wed Apr 02 10:01:38 2014 -0700 @@ -208,6 +208,7 @@ JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@ JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@ JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@ +JVM_VARIANT_CORE:=@JVM_VARIANT_CORE@ # Universal binaries on macosx MACOSX_UNIVERSAL=@MACOSX_UNIVERSAL@ @@ -297,6 +298,8 @@ COMPILER_TYPE:=@COMPILER_TYPE@ COMPILER_NAME:=@COMPILER_NAME@ +# Option used to tell the compiler whether to create 32- or 64-bit executables +COMPILER_TARGET_BITS_FLAG:=@COMPILER_TARGET_BITS_FLAG@ COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@ CC_OUT_OPTION:=@CC_OUT_OPTION@ @@ -340,6 +343,11 @@ # The linker can be gcc or ld on posix systems, or link.exe on windows systems. LD:=@FIXPATH@ @LD@ +# The linker on older SuSE distros (e.g. on SLES 10) complains with: +# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable." +# if feeded with a version script which contains named tags. +USING_BROKEN_SUSE_LD:=@USING_BROKEN_SUSE_LD@ + # LDFLAGS used to link the jdk native libraries (C-code) LDFLAGS_JDKLIB:=@LDFLAGS_JDKLIB@ LDFLAGS_JDKLIB_SUFFIX:=@LDFLAGS_JDKLIB_SUFFIX@ diff -r 065b9ded4bf2 -r feeb67be5886 common/autoconf/toolchain.m4 --- a/common/autoconf/toolchain.m4 Mon Mar 31 14:06:57 2014 -0700 +++ b/common/autoconf/toolchain.m4 Wed Apr 02 10:01:38 2014 -0700 @@ -44,6 +44,15 @@ COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/p"` COMPILER_VENDOR="Sun Studio" fi + elif test "x$OPENJDK_TARGET_OS" = xaix; then + COMPILER_VERSION_TEST=`$COMPILER -qversion 2>&1 | $TAIL -n 1` + $ECHO $COMPILER_VERSION_TEST | $GREP "^Version: " > /dev/null + if test $? -ne 0; then + AC_MSG_ERROR([Failed to detect the compiler version of $COMPILER ....]) + else + COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n 's/Version: \([0-9][0-9]\.[0-9][0-9]*\).*/\1/p'` + COMPILER_VENDOR='IBM' + fi elif test "x$OPENJDK_TARGET_OS" = xwindows; then # First line typically looks something like: # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 @@ -137,10 +146,14 @@ AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) fi BASIC_FIXUP_EXECUTABLE($1) - AC_MSG_CHECKING([resolved symbolic links for $1]) TEST_COMPILER="[$]$1" - BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) - AC_MSG_RESULT([$TEST_COMPILER]) + # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links + # to 'xlc' but it is crucial that we invoke the compiler with the right name! + if test "x$OPENJDK_BUILD_OS" != xaix; then + AC_MSG_CHECKING([resolved symbolic links for $1]) + BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) + AC_MSG_RESULT([$TEST_COMPILER]) + fi AC_MSG_CHECKING([if $1 is disguised ccache]) COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` @@ -254,6 +267,9 @@ COMPILER_CHECK_LIST="cl" elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then COMPILER_CHECK_LIST="cc gcc" + elif test "x$OPENJDK_TARGET_OS" = "xaix"; then + # Do not probe for cc on AIX. + COMPILER_CHECK_LIST="xlc_r" else COMPILER_CHECK_LIST="gcc cc" fi @@ -262,6 +278,14 @@ # Now that we have resolved CC ourself, let autoconf have its go at it AC_PROG_CC([$CC]) + # Option used to tell the compiler whether to create 32- or 64-bit executables + # Notice that CC contains the full compiler path at this point. + case $CC in + *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";; + *) COMPILER_TARGET_BITS_FLAG="-m";; + esac + AC_SUBST(COMPILER_TARGET_BITS_FLAG) + ### Locate C++ compiler (CXX) if test "x$CXX" != x; then @@ -270,6 +294,9 @@ COMPILER_CHECK_LIST="cl" elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then COMPILER_CHECK_LIST="CC g++" + elif test "x$OPENJDK_TARGET_OS" = "xaix"; then + # Do not probe for CC on AIX . + COMPILER_CHECK_LIST="xlC_r" else COMPILER_CHECK_LIST="g++ CC" fi @@ -311,6 +338,8 @@ fi if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" + elif test "x$OPENJDK_TARGET_OS" = xaix; then + ARFLAGS="-X64" else ARFLAGS="" fi @@ -554,6 +583,29 @@ POST_STRIP_CMD="$STRIP -x" POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi + if test "x$OPENJDK_TARGET_OS" = xaix; then + COMPILER_NAME=xlc + PICFLAG="-qpic=large" + LIBRARY_PREFIX=lib + SHARED_LIBRARY='lib[$]1.so' + STATIC_LIBRARY='lib[$]1.a' + SHARED_LIBRARY_FLAGS="-qmkshrobj" + SHARED_LIBRARY_SUFFIX='.so' + STATIC_LIBRARY_SUFFIX='.a' + OBJ_SUFFIX='.o' + EXE_SUFFIX='' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='' + C_FLAG_REORDER='' + CXX_FLAG_REORDER='' + SET_SHARED_LIBRARY_ORIGIN='' + SET_EXECUTABLE_ORIGIN="" + CFLAGS_JDK="" + CXXFLAGS_JDK="" + CFLAGS_JDKLIB_EXTRA='' + POST_STRIP_CMD="$STRIP -X32_64" + POST_MCS_CMD="" + fi if test "x$OPENJDK_TARGET_OS" = xwindows; then # If it is not gcc, then assume it is the MS Visual Studio compiler COMPILER_NAME=cl @@ -730,6 +782,24 @@ CFLAGS_DEBUG_SYMBOLS="-g -xs" CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" + ;; + xlc ) + C_FLAG_DEPS="-qmakedep=gcc -MF" + CXX_FLAG_DEPS="-qmakedep=gcc -MF" + C_O_FLAG_HIGHEST="-O3" + C_O_FLAG_HI="-O3 -qstrict" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="" + CXX_O_FLAG_HIGHEST="-O3" + CXX_O_FLAG_HI="-O3 -qstrict" + CXX_O_FLAG_NORM="-O2" + CXX_O_FLAG_NONE="" + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" + LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" + CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" + ;; esac ;; CL ) @@ -840,6 +910,13 @@ LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" ;; + xlc ) + CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" + CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" + + LDFLAGS_JDK="$LDFLAGS_JDK" + LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK" + ;; cl ) CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ @@ -909,6 +986,9 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS" fi + if test "x$OPENJDK_TARGET_OS" = xaix; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DAIX -DPPC64" + fi if test "x$OPENJDK_TARGET_OS" = xmacosx; then CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" # Setting these parameters makes it an error to link to macosx APIs that are @@ -1076,20 +1156,38 @@ # ZERO_ARCHFLAG tells the compiler which mode to build for case "${OPENJDK_TARGET_CPU}" in s390) - ZERO_ARCHFLAG="-m31" + ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31" ;; *) - ZERO_ARCHFLAG="-m${OPENJDK_TARGET_CPU_BITS}" + ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" esac TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""]) AC_SUBST(ZERO_ARCHFLAG) - # Check that the compiler supports -mX flags + # Check that the compiler supports -mX (or -qX on AIX) flags # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does - TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([-m${OPENJDK_TARGET_CPU_BITS}], + TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) + + + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed in executable.' + USING_BROKEN_SUSE_LD=no + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$GCC" = xyes; then + AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables]) + echo "SUNWprivate_1.1 { local: *; };" > version-script.map + echo "int main() { }" > main.c + if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then + AC_MSG_RESULT(no) + USING_BROKEN_SUSE_LD=no + else + AC_MSG_RESULT(yes) + USING_BROKEN_SUSE_LD=yes + fi + rm -rf version-script.map main.c + fi + AC_SUBST(USING_BROKEN_SUSE_LD) ]) # Setup the JTREG paths diff -r 065b9ded4bf2 -r feeb67be5886 make/common/JavaCompilation.gmk --- a/make/common/JavaCompilation.gmk Mon Mar 31 14:06:57 2014 -0700 +++ b/make/common/JavaCompilation.gmk Wed Apr 02 10:01:38 2014 -0700 @@ -163,11 +163,12 @@ # The capture contents macro finds all files (matching the patterns, typically # .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar. + # NOTICE: please leave the parentheses space separated otherwise the AIX build will break! $1_CAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ + ( ( $(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \ $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ - $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES))) > \ - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + $(ECHO) $$(subst $$(src)/,,$$($1_EXTRA_FILES) ) ) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) ) # The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file. ifeq (,$$($1_SKIP_METAINF)) $1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS),($(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE)) @@ -176,19 +177,20 @@ # tells us what to remove from the jar-file. $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE)) # The update contents macro updates the jar file with the previously capture contents. - # xargs is used to trim the whitespace from the contents file, to see if it is empty. + # Use 'wc -w' to see if the contents file is empty. $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS), \ (cd $$(src) && \ - if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \ + if [ "`$(WC) -w _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \ $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \ fi) $$(NEWLINE)) # The s-variants of the above macros are used when the jar is created from scratch. + # NOTICE: please leave the parentheses space separated otherwise the AIX build will break! $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS), \ - (($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ + ( ( $(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ $$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/||g' && \ - $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES))) > \ - $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE)) + $$(subst $$(src)/,,$(ECHO) $$($1_EXTRA_FILES) ) ) > \ + $$(src)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) ) ifeq (,$$($1_SKIP_METAINF)) $1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS), \ diff -r 065b9ded4bf2 -r feeb67be5886 make/common/NativeCompilation.gmk --- a/make/common/NativeCompilation.gmk Mon Mar 31 14:06:57 2014 -0700 +++ b/make/common/NativeCompilation.gmk Wed Apr 02 10:01:38 2014 -0700 @@ -501,7 +501,7 @@ # Generating a static library, ie object file archive. $$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$(call ARCHIVING_MSG,$$($1_LIBRARY)) - $(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ + $(AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) endif