From 2011115a3ec220b69d4cfc715869dff26d4e350a Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 22 Feb 2016 11:22:55 +0100 Subject: [PATCH 1/3] 8150203: Incremental update from build-infra project Reviewed-by: erikj --- common/autoconf/flags.m4 | 1 + common/autoconf/generated-configure.sh | 16 +++++++++++----- common/autoconf/libraries.m4 | 14 +++++++++----- common/autoconf/spec.gmk.in | 2 ++ make/Init.gmk | 3 +++ make/common/NativeCompilation.gmk | 9 ++++++--- 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index c949c93c5cf..1cc71d47058 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -891,6 +891,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], AC_SUBST(JDKLIB_LIBS) AC_SUBST(JDKEXE_LIBS) AC_SUBST(LDFLAGS_CXX_JDK) + AC_SUBST(LDFLAGS_HASH_STYLE) LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 20d766e7d4e..839422ccb9c 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -701,6 +701,7 @@ COMPILER_SUPPORTS_TARGET_BITS_FLAG ZERO_ARCHFLAG LDFLAGS_TESTEXE LDFLAGS_TESTLIB +LDFLAGS_HASH_STYLE LDFLAGS_CXX_JDK JDKEXE_LIBS JDKLIB_LIBS @@ -4230,7 +4231,7 @@ pkgadd_help() { # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, 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 @@ -4860,7 +4861,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1455271513 +DATE_WHEN_GENERATED=1456136545 ############################################################################### # @@ -46881,6 +46882,7 @@ $as_echo "$supports" >&6; } + LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE" @@ -58630,7 +58632,8 @@ fi # Setup libm (the maths library) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 + if test "x$OPENJDK_TARGET_OS" != "xwindows"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 @@ -58675,12 +58678,15 @@ _ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5 $as_echo "$as_me: Maths library was not found" >&6;} fi - LIBM=-lm + LIBM="-lm" + else + LIBM="" + fi # Setup libdl (for dynamic library loading) diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 7bae405555e..a6a8bd4f19b 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2016, 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 @@ -160,10 +160,14 @@ AC_DEFUN_ONCE([LIB_SETUP_LLVM], AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], [ # Setup libm (the maths library) - AC_CHECK_LIB(m, cos, [], [ - AC_MSG_NOTICE([Maths library was not found]) - ]) - LIBM=-lm + if test "x$OPENJDK_TARGET_OS" != "xwindows"; then + AC_CHECK_LIB(m, cos, [], [ + AC_MSG_NOTICE([Maths library was not found]) + ]) + LIBM="-lm" + else + LIBM="" + fi AC_SUBST(LIBM) # Setup libdl (for dynamic library loading) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 2a6c872cf27..1b178681404 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -351,6 +351,8 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@ CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@ CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@ +LDFLAGS_HASH_STYLE := @LDFLAGS_HASH_STYLE@ + CXX:=@FIXPATH@ @CCACHE@ @ICECC@ @CXX@ CPP:=@FIXPATH@ @CPP@ diff --git a/make/Init.gmk b/make/Init.gmk index 4ed492c68fc..ee67aeaa65f 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -154,6 +154,9 @@ ifeq ($(HAS_SPEC),) # Do nothing endif + # Do not let make delete spec files even if aborted while doing a reconfigure + .PRECIOUS: $(SPECS) + # Unless reconfigure is explicitely called, let all main targets depend on # the spec files to be up to date. ifeq ($(findstring reconfigure, $(INIT_TARGETS)), ) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 53637fcb953..f16a85182c8 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -651,12 +651,15 @@ define SetupNativeCompilationBody $$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES_VARDEPS_FILE) $$(call LogInfo, Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))) + $$(call MakeDir, $$(@D) $$($1_OBJECT_DIR)) $$(call ExecuteWithLog, $$@, \ $$($1_RC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) $(CC_OUT_OPTION)$$@ \ $$($1_VERSIONINFO_RESOURCE)) # Windows RC compiler does not support -showIncludes, so we mis-use CL for this. - $$($1_CC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \ - $(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || true ; \ + $$(call ExecuteWithLog, $$($1_RES_DEP).obj, \ + $$($1_CC) $$($1_RC_FLAGS) $$($1_SYSROOT_CFLAGS) -showIncludes -nologo -TC \ + $(CC_OUT_OPTION)$$($1_RES_DEP).obj -P -Fi$$($1_RES_DEP).pp \ + $$($1_VERSIONINFO_RESOURCE)) > $$($1_RES_DEP).raw 2>&1 || true ; \ $(ECHO) $$($1_RES): \\ > $$($1_RES_DEP) ; \ $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw >> $$($1_RES_DEP) ; \ $(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEP) > $$($1_RES_DEP_TARGETS) @@ -670,7 +673,7 @@ define SetupNativeCompilationBody $1_REAL_MAPFILE := $$($1_OBJECT_DIR)/mapfile $$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER) - $$(MKDIR) -p $$(@D) + $$(call MakeDir, $$(@D)) $$(CP) $$($1_MAPFILE) $$@.tmp $$(SED) -e 's=OUTPUTDIR=$$($1_OBJECT_DIR)=' $$($1_REORDER) >> $$@.tmp $$(MV) $$@.tmp $$@ From 4b8c19d6b707315811bd697f2221dccb6c494d63 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Mon, 22 Feb 2016 11:27:09 +0100 Subject: [PATCH 2/3] 8150197: Integrate AIX fixes from build-infra Reviewed-by: erikj --- common/autoconf/flags.m4 | 24 ++++++++++++++++++++--- common/autoconf/generated-configure.sh | 27 ++++++++++++++++++++++---- common/autoconf/spec.gmk.in | 4 ++++ make/common/NativeCompilation.gmk | 5 +++++ 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 1cc71d47058..6b08cbb0a4f 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -123,12 +123,16 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], [ # COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler + # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder + # commands produced by the link step (currently AIX only) if test "x$TOOLCHAIN_TYPE" = xxlc; then COMPILER_TARGET_BITS_FLAG="-q" COMPILER_COMMAND_FILE_FLAG="-f" + COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" else COMPILER_TARGET_BITS_FLAG="-m" COMPILER_COMMAND_FILE_FLAG="@" + COMPILER_BINDCMD_FILE_FLAG="" # The solstudio linker does not support @-files. if test "x$TOOLCHAIN_TYPE" = xsolstudio; then @@ -152,6 +156,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], fi AC_SUBST(COMPILER_TARGET_BITS_FLAG) AC_SUBST(COMPILER_COMMAND_FILE_FLAG) + AC_SUBST(COMPILER_BINDCMD_FILE_FLAG) # FIXME: figure out if we should select AR flags depending on OS or toolchain. if test "x$OPENJDK_TARGET_OS" = xmacosx; then @@ -294,10 +299,23 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], SET_SHARED_LIBRARY_NAME='-h [$]1' SET_SHARED_LIBRARY_MAPFILE='-M[$]1' elif test "x$TOOLCHAIN_TYPE" = xxlc; then - PICFLAG="-qpic=large" + # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only + # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker + # will have to patch this single instruction with a call to some out-of-order code which + # does the load from the TOC. This is of course slow. But in that case we also would have + # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. + # With 'qpic=large' the compiler will by default generate a two-instruction sequence which + # can be patched directly by the linker and does not require a jump to out-of-order code. + # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' + # instead. This creates a distinct TOC for every compilation unit (and thus requires two + # loads for accessing a global variable). But there are rumors that this may be seen as a + # 'performance feature' because of improved code locality of the symbols used in a + # compilation unit. + PICFLAG="-qpic" + JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" C_FLAG_REORDER='' CXX_FLAG_REORDER='' - SHARED_LIBRARY_FLAGS="-qmkshrobj" + SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" SET_EXECUTABLE_ORIGIN="" SET_SHARED_LIBRARY_ORIGIN='' SET_SHARED_LIBRARY_NAME='' @@ -835,7 +853,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], LDFLAGS_CXX_SOLSTUDIO="-norunpath" LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" elif test "x$TOOLCHAIN_TYPE" = xxlc; then - LDFLAGS_XLC="-brtl -bnolibpath -bexpall -bernotok" + LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC" fi diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 839422ccb9c..7a9d7900667 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -744,6 +744,7 @@ EXE_OUT_OPTION CC_OUT_OPTION STRIPFLAGS ARFLAGS +COMPILER_BINDCMD_FILE_FLAG COMPILER_COMMAND_FILE_FLAG COMPILER_TARGET_BITS_FLAG JT_HOME @@ -4861,7 +4862,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1456136545 +DATE_WHEN_GENERATED=1456136781 ############################################################################### # @@ -45392,12 +45393,16 @@ $as_echo "$tool_specified" >&6; } # COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler + # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder + # commands produced by the link step (currently AIX only) if test "x$TOOLCHAIN_TYPE" = xxlc; then COMPILER_TARGET_BITS_FLAG="-q" COMPILER_COMMAND_FILE_FLAG="-f" + COMPILER_BINDCMD_FILE_FLAG="-bloadmap:" else COMPILER_TARGET_BITS_FLAG="-m" COMPILER_COMMAND_FILE_FLAG="@" + COMPILER_BINDCMD_FILE_FLAG="" # The solstudio linker does not support @-files. if test "x$TOOLCHAIN_TYPE" = xsolstudio; then @@ -45425,6 +45430,7 @@ $as_echo "no" >&6; } + # FIXME: figure out if we should select AR flags depending on OS or toolchain. if test "x$OPENJDK_TARGET_OS" = xmacosx; then ARFLAGS="-r" @@ -46199,10 +46205,23 @@ $as_echo "$ac_cv_c_bigendian" >&6; } SET_SHARED_LIBRARY_NAME='-h $1' SET_SHARED_LIBRARY_MAPFILE='-M$1' elif test "x$TOOLCHAIN_TYPE" = xxlc; then - PICFLAG="-qpic=large" + # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only + # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker + # will have to patch this single instruction with a call to some out-of-order code which + # does the load from the TOC. This is of course slow. But in that case we also would have + # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. + # With 'qpic=large' the compiler will by default generate a two-instruction sequence which + # can be patched directly by the linker and does not require a jump to out-of-order code. + # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' + # instead. This creates a distinct TOC for every compilation unit (and thus requires two + # loads for accessing a global variable). But there are rumors that this may be seen as a + # 'performance feature' because of improved code locality of the symbols used in a + # compilation unit. + PICFLAG="-qpic" + JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" C_FLAG_REORDER='' CXX_FLAG_REORDER='' - SHARED_LIBRARY_FLAGS="-qmkshrobj" + SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" SET_EXECUTABLE_ORIGIN="" SET_SHARED_LIBRARY_ORIGIN='' SET_SHARED_LIBRARY_NAME='' @@ -46825,7 +46844,7 @@ $as_echo "$supports" >&6; } LDFLAGS_CXX_SOLSTUDIO="-norunpath" LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib" elif test "x$TOOLCHAIN_TYPE" = xxlc; then - LDFLAGS_XLC="-brtl -bnolibpath -bexpall -bernotok" + LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok" LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC" fi diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 1b178681404..d8322ebce9c 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -314,6 +314,10 @@ COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@ # Option used to pass a command file to the compiler COMPILER_COMMAND_FILE_FLAG:=@COMPILER_COMMAND_FILE_FLAG@ +# Option for specifying a file which saves the binder commands +# produced by the link step (for debugging, currently AIX only) +COMPILER_BINDCMD_FILE_FLAG:=@COMPILER_BINDCMD_FILE_FLAG@ + CC_OUT_OPTION:=@CC_OUT_OPTION@ EXE_OUT_OPTION:=@EXE_OUT_OPTION@ LD_OUT_OPTION:=@LD_OUT_OPTION@ diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index f16a85182c8..ffae49df541 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -771,6 +771,11 @@ define SetupNativeCompilationBody $1_EXTRA_LDFLAGS += "-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib" endif + # Create loadmap on AIX. Helps in diagnosing some problems. + ifneq ($(COMPILER_BINDCMD_FILE_FLAG),) + $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap + endif + $1_EXTRA_LIBS += $(GLOBAL_LIBS) $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ From 4513cbc5745bde2e7bef4a68bf22c3e8f872365d Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 23 Feb 2016 21:43:59 +0100 Subject: [PATCH 3/3] 8150257: Remove softfloat lib support Reviewed-by: dholmes, erikj --- make/common/NativeCompilation.gmk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index ffae49df541..f675790efc6 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -776,8 +776,6 @@ define SetupNativeCompilationBody $1_EXTRA_LDFLAGS += $(COMPILER_BINDCMD_FILE_FLAG)$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).loadmap endif - $1_EXTRA_LIBS += $(GLOBAL_LIBS) - $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_CREATE_DEBUGINFO_CMDS) \ $$($1_STRIP_CMD) @@ -854,8 +852,6 @@ define SetupNativeCompilationBody ifneq (,$$($1_PROGRAM)) # A executable binary has been specified, setup the target for it. - $1_EXTRA_LIBS += $(GLOBAL_LIBS) - $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \ $$($1_LIBS) $$($1_EXTRA_LIBS) $$($1_MT) \ $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION) \