From 0f50681b8cce89ce9f3a983e73fba31ab1858f06 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Wed, 23 Aug 2023 04:51:06 +0100 Subject: [PATCH 1/6] 8281096: Flags introduced by configure script are not passed to ADLC build --- hotspot/make/aix/makefiles/adlc.make | 5 +++++ hotspot/make/bsd/makefiles/adlc.make | 5 +++++ hotspot/make/linux/makefiles/adlc.make | 5 +++++ hotspot/make/solaris/makefiles/adlc.make | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/hotspot/make/aix/makefiles/adlc.make b/hotspot/make/aix/makefiles/adlc.make index 8407fd8f55a..6d4721d08d3 100644 --- a/hotspot/make/aix/makefiles/adlc.make +++ b/hotspot/make/aix/makefiles/adlc.make @@ -69,6 +69,11 @@ CXXFLAGS += -DASSERT CFLAGS_WARN = -w CFLAGS += $(CFLAGS_WARN) +# Extra flags from gnumake's invocation or environment +CFLAGS += $(EXTRA_CFLAGS) +LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) +ASFLAGS += $(EXTRA_ASFLAGS) + OBJECTNAMES = \ adlparse.o \ archDesc.o \ diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make index e37e60ca97b..c4ee762aaf7 100644 --- a/hotspot/make/bsd/makefiles/adlc.make +++ b/hotspot/make/bsd/makefiles/adlc.make @@ -71,6 +71,11 @@ ifneq ($(COMPILER_WARNINGS_FATAL),false) endif CFLAGS += $(CFLAGS_WARN) +# Extra flags from gnumake's invocation or environment +CFLAGS += $(EXTRA_CFLAGS) +LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) +ASFLAGS += $(EXTRA_ASFLAGS) + OBJECTNAMES = \ adlparse.o \ archDesc.o \ diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index 92b8b9b3911..b5657fe1598 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -69,6 +69,11 @@ CXXFLAGS += -DASSERT CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) CFLAGS += $(CFLAGS_WARN) +# Extra flags from gnumake's invocation or environment +CFLAGS += $(EXTRA_CFLAGS) +LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) +ASFLAGS += $(EXTRA_ASFLAGS) + OBJECTNAMES = \ adlparse.o \ archDesc.o \ diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index ef87d3e7d85..0d2b810da8a 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -83,6 +83,10 @@ ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 513), 1) endif CFLAGS += $(CFLAGS_WARN) +# Extra flags from gnumake's invocation or environment +CFLAGS += $(EXTRA_CFLAGS) +ASFLAGS += $(EXTRA_ASFLAGS) + ifeq ("${Platform_compiler}", "sparcWorks") # Enable the following CFLAGS addition if you need to compare the # built ELF objects. From d1c15a5592d8616e267f7f2ccf0c1366ad4c6ba3 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Wed, 24 Jan 2024 01:34:34 +0000 Subject: [PATCH 2/6] Temporarily enable debug logging for cross-compile build --- .github/workflows/submit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index b0a4e7b952e..ad148aa3237 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -452,7 +452,7 @@ jobs: working-directory: jdk - name: Build - run: make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot hotspot + run: make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot LOG_LEVEL=debug hotspot working-directory: jdk linux_x86_build: From 20afddf94cb7f9fd9a3093ce0cb0468261199252 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sat, 17 Feb 2024 18:05:26 +0000 Subject: [PATCH 3/6] Print the spec.gmk and hotspot-spec.gmk files --- .github/workflows/submit.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index ad148aa3237..02c2589219e 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -175,7 +175,10 @@ jobs: working-directory: jdk - name: Build - run: make CONF_NAME=linux-x64 LOG_LEVEL=debug images + run: | + cat spec.gmk + cat hotspot-spec.gmk + make CONF_NAME=linux-x64 LOG_LEVEL=debug images working-directory: jdk - name: Pack artifacts From 22f17651cf27ac03f6701e8b0694df22397c13b0 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sat, 17 Feb 2024 18:54:34 +0000 Subject: [PATCH 4/6] Fix whitespace in yaml file --- .github/workflows/submit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 02c2589219e..0742346c62b 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -176,9 +176,9 @@ jobs: - name: Build run: | - cat spec.gmk - cat hotspot-spec.gmk - make CONF_NAME=linux-x64 LOG_LEVEL=debug images + cat spec.gmk + cat hotspot-spec.gmk + make CONF_NAME=linux-x64 LOG_LEVEL=debug images working-directory: jdk - name: Pack artifacts From 4e1e56135554b359340fd96d85cf80d2473b0ec3 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Sat, 17 Feb 2024 20:25:39 +0000 Subject: [PATCH 5/6] Print spec files in right workflow and use path to build directory --- .github/workflows/submit.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 0742346c62b..7cac4179ce3 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -175,10 +175,7 @@ jobs: working-directory: jdk - name: Build - run: | - cat spec.gmk - cat hotspot-spec.gmk - make CONF_NAME=linux-x64 LOG_LEVEL=debug images + run: make CONF_NAME=linux-x64 LOG_LEVEL=debug images working-directory: jdk - name: Pack artifacts @@ -455,7 +452,10 @@ jobs: working-directory: jdk - name: Build - run: make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot LOG_LEVEL=debug hotspot + run: | + cat build/linux-${{ matrix.gnu-arch }}-hotspot/spec.gmk + cat build/linux-${{ matrix.gnu-arch }}-hotspot/hotspot-spec.gmk + make CONF_NAME=linux-${{ matrix.gnu-arch }}-hotspot LOG_LEVEL=debug hotspot working-directory: jdk linux_x86_build: From 123e74d7fb64dbf973a18156931fa69e5b4055be Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Wed, 22 May 2024 22:21:52 +0100 Subject: [PATCH 6/6] Separate host and target compiler flags --- common/autoconf/flags.m4 | 44 +++-- common/autoconf/generated-configure.sh | 205 ++++++++++++----------- common/autoconf/hotspot-spec.gmk.in | 18 +- hotspot/make/aix/makefiles/adlc.make | 6 +- hotspot/make/bsd/makefiles/adlc.make | 6 +- hotspot/make/linux/makefiles/adlc.make | 6 +- hotspot/make/solaris/makefiles/adlc.make | 4 +- 7 files changed, 158 insertions(+), 131 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 73b2e76511e..113bf367e23 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -139,9 +139,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS], SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\"" fi # Propagate the sysroot args to hotspot - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" + LEGACY_HOST_CFLAGS="$LEGACY_EXTRA_CFLAGS" + LEGACY_HOST_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS" + LEGACY_HOST_LDFLAGS="$LEGACY_EXTRA_LDFLAGS" + LEGACY_TARGET_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS" + LEGACY_TARGET_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS" + LEGACY_TARGET_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" fi AC_SUBST(SYSROOT_CFLAGS) AC_SUBST(SYSROOT_LDFLAGS) @@ -431,11 +434,14 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" elif test "x$TOOLCHAIN_TYPE" = xgcc; then - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector" + LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS -fstack-protector" + LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS -fstack-protector" + LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS -fstack-protector" + LEGACY_TARGET_CXXFLAGS="$LEGACY_TARGET_CXXFLAGS -fstack-protector" if test "x$OPENJDK_TARGET_OS" != xmacosx; then LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro" + LEGACY_HOST_LDFLAGS="$LEGACY_HOST_LDFLAGS -Wl,-z,relro" + LEGACY_TARGET_LDFLAGS="$LEGACY_TARGET_LDFLAGS -Wl,-z,relro" fi $2CXXSTD_CXXFLAG="-std=gnu++98" FLAGS_CXX_COMPILER_CHECK_ARGUMENTS([[$]$2CXXSTD_CXXFLAG -Werror], @@ -479,15 +485,23 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" # Hotspot needs these set in their legacy form - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags" - LEGACY_EXTRA_ASFLAGS="$with_extra_asflags" - - AC_SUBST(LEGACY_EXTRA_CFLAGS) - AC_SUBST(LEGACY_EXTRA_CXXFLAGS) - AC_SUBST(LEGACY_EXTRA_LDFLAGS) - AC_SUBST(LEGACY_EXTRA_ASFLAGS) + LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS $with_extra_cflags" + LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS $with_extra_cflags" + LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS $with_extra_cxxflags" + LEGACY_TARGET_CXXFLAGS="$LEGACY_TARGET_CXXFLAGS $with_extra_cxxflags" + LEGACY_HOST_LDFLAGS="$LEGACY_HOST_LDFLAGS $with_extra_ldflags" + LEGACY_TARGET_LDFLAGS="$LEGACY_TARGET_LDFLAGS $with_extra_ldflags" + LEGACY_HOST_ASFLAGS="$with_extra_asflags" + LEGACY_TARGET_ASFLAGS="$with_extra_asflags" + + AC_SUBST(LEGACY_HOST_CFLAGS) + AC_SUBST(LEGACY_HOST_CXXFLAGS) + AC_SUBST(LEGACY_HOST_LDFLAGS) + AC_SUBST(LEGACY_HOST_ASFLAGS) + AC_SUBST(LEGACY_TARGET_CFLAGS) + AC_SUBST(LEGACY_TARGET_CXXFLAGS) + AC_SUBST(LEGACY_TARGET_LDFLAGS) + AC_SUBST(LEGACY_TARGET_ASFLAGS) ############################################################################### # diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 6f17436eff3..ad3f7f232ea 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -691,10 +691,14 @@ FDLIBM_CFLAGS USE_FORMAT_OVERFLOW NO_LIFETIME_DSE_CFLAG NO_DELETE_NULL_POINTER_CHECKS_CFLAG -LEGACY_EXTRA_ASFLAGS -LEGACY_EXTRA_LDFLAGS -LEGACY_EXTRA_CXXFLAGS -LEGACY_EXTRA_CFLAGS +LEGACY_TARGET_ASFLAGS +LEGACY_TARGET_LDFLAGS +LEGACY_TARGET_CXXFLAGS +LEGACY_TARGET_CFLAGS +LEGACY_HOST_ASFLAGS +LEGACY_HOST_LDFLAGS +LEGACY_HOST_CXXFLAGS +LEGACY_HOST_CFLAGS CXXSTD_CXXFLAG CXX_O_FLAG_NONE CXX_O_FLAG_NORM @@ -1017,7 +1021,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1263,7 +1266,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1516,15 +1518,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1662,7 +1655,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1815,7 +1808,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2574,7 +2566,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2591,7 +2583,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then : /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2618,7 +2610,7 @@ else /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2635,7 +2627,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then : /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2670,7 +2662,7 @@ while test "x$ac_lo" != "x$ac_hi"; do /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2695,12 +2687,12 @@ esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include #include int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2807,7 +2799,7 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. + which can conflict with char $2 (void); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -2825,7 +2817,7 @@ else #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -2834,7 +2826,7 @@ choke me #endif int -main () +main (void) { return $2 (); ; @@ -4440,7 +4432,7 @@ VS_TOOLSET_SUPPORTED_2022=true #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1705630975 +DATE_WHEN_GENERATED=1716396030 ############################################################################### # @@ -28934,7 +28926,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -29074,7 +29066,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -29138,7 +29130,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -29189,7 +29181,7 @@ else /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -29230,7 +29222,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -29245,7 +29237,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -29261,7 +29253,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -29310,9 +29302,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -29347,7 +29337,7 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i int argc; char **argv; int -main () +main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; @@ -30680,7 +30670,7 @@ else /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -30721,7 +30711,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -30736,7 +30726,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -30752,7 +30742,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -33265,7 +33255,7 @@ else /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -33306,7 +33296,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -33321,7 +33311,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -33337,7 +33327,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -41854,9 +41844,12 @@ $as_echo "$tool_specified" >&6; } SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\"" fi # Propagate the sysroot args to hotspot - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" + LEGACY_HOST_CFLAGS="$LEGACY_EXTRA_CFLAGS" + LEGACY_HOST_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS" + LEGACY_HOST_LDFLAGS="$LEGACY_EXTRA_LDFLAGS" + LEGACY_TARGET_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS" + LEGACY_TARGET_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS" + LEGACY_TARGET_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS" fi @@ -41880,7 +41873,7 @@ else #include int -main () +main (void) { ; @@ -41950,7 +41943,7 @@ else #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main () +main (void) { int i; for (i = 0; i < 256; i++) @@ -42248,7 +42241,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -42268,7 +42261,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -42294,7 +42287,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -42311,7 +42304,7 @@ if ac_fn_cxx_try_compile "$LINENO"; then : #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -42353,7 +42346,7 @@ short int ascii_mm[] = extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; @@ -42379,7 +42372,7 @@ else /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -42678,11 +42671,14 @@ $as_echo "$ac_cv_c_bigendian" >&6; } CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" elif test "x$TOOLCHAIN_TYPE" = xgcc; then - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS -fstack-protector" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS -fstack-protector" + LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS -fstack-protector" + LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS -fstack-protector" + LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS -fstack-protector" + LEGACY_TARGET_CXXFLAGS="$LEGACY_TARGET_CXXFLAGS -fstack-protector" if test "x$OPENJDK_TARGET_OS" != xmacosx; then LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,relro" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS -Wl,-z,relro" + LEGACY_HOST_LDFLAGS="$LEGACY_HOST_LDFLAGS -Wl,-z,relro" + LEGACY_TARGET_LDFLAGS="$LEGACY_TARGET_LDFLAGS -Wl,-z,relro" fi CXXSTD_CXXFLAG="-std=gnu++98" @@ -42783,10 +42779,18 @@ fi LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" # Hotspot needs these set in their legacy form - LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags" - LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags" - LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags" - LEGACY_EXTRA_ASFLAGS="$with_extra_asflags" + LEGACY_HOST_CFLAGS="$LEGACY_HOST_CFLAGS $with_extra_cflags" + LEGACY_TARGET_CFLAGS="$LEGACY_TARGET_CFLAGS $with_extra_cflags" + LEGACY_HOST_CXXFLAGS="$LEGACY_HOST_CXXFLAGS $with_extra_cxxflags" + LEGACY_TARGET_CXXFLAGS="$LEGACY_TARGET_CXXFLAGS $with_extra_cxxflags" + LEGACY_HOST_LDFLAGS="$LEGACY_HOST_LDFLAGS $with_extra_ldflags" + LEGACY_TARGET_LDFLAGS="$LEGACY_TARGET_LDFLAGS $with_extra_ldflags" + LEGACY_HOST_ASFLAGS="$with_extra_asflags" + LEGACY_TARGET_ASFLAGS="$with_extra_asflags" + + + + @@ -44211,7 +44215,7 @@ if test "$ac_x_libraries" = no; then /* end confdefs.h. */ #include int -main () +main (void) { XrmInitialize () ; @@ -44297,7 +44301,7 @@ $as_echo_n "checking whether -R must be followed by a space... " >&6; } /* end confdefs.h. */ int -main () +main (void) { ; @@ -44314,7 +44318,7 @@ else /* end confdefs.h. */ int -main () +main (void) { ; @@ -44358,9 +44362,9 @@ rm -f core conftest.err conftest.$ac_objext \ #ifdef __cplusplus extern "C" #endif -char XOpenDisplay (); +char XOpenDisplay (void); int -main () +main (void) { return XOpenDisplay (); ; @@ -44386,9 +44390,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char dnet_ntoa (void); int -main () +main (void) { return dnet_ntoa (); ; @@ -44427,9 +44431,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char dnet_ntoa (void); int -main () +main (void) { return dnet_ntoa (); ; @@ -44487,9 +44491,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; @@ -44528,9 +44532,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gethostbyname (void); int -main () +main (void) { return gethostbyname (); ; @@ -44584,9 +44588,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char connect (); +char connect (void); int -main () +main (void) { return connect (); ; @@ -44633,9 +44637,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char remove (); +char remove (void); int -main () +main (void) { return remove (); ; @@ -44682,9 +44686,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char shmat (); +char shmat (void); int -main () +main (void) { return shmat (); ; @@ -44734,9 +44738,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char IceConnectionNumber (); +char IceConnectionNumber (void); int -main () +main (void) { return IceConnectionNumber (); ; @@ -49700,7 +49704,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext int -main () +main (void) { return main (); ; @@ -49790,9 +49794,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char DGifGetCode (); +char DGifGetCode (void); int -main () +main (void) { return DGifGetCode (); ; @@ -49856,9 +49860,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char compress (); +char compress (void); int -main () +main (void) { return compress (); ; @@ -49942,7 +49946,7 @@ $as_echo "system not found" >&6; } /* end confdefs.h. */ #include int -main () +main (void) { return (int)altzone; ; @@ -49983,9 +49987,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char cos (); +char cos (void); int -main () +main (void) { return cos (); ; @@ -50042,9 +50046,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; @@ -50112,7 +50116,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { return 0; ; @@ -50154,7 +50158,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { return 0; ; @@ -55945,7 +55949,7 @@ $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; /* end confdefs.h. */ int -main () +main (void) { ; @@ -57458,3 +57462,4 @@ fi printf "\n" fi fi + diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index b2c8fc0e009..3f86751d2bd 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -111,11 +111,19 @@ LD:=@HOTSPOT_LD@ MT:=@HOTSPOT_MT@ RC:=@HOTSPOT_RC@ -EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ - $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) -EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ -EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@ -EXTRA_ASFLAGS=@LEGACY_EXTRA_ASFLAGS@ +# Retain EXTRA_{CFLAGS,CXXFLAGS,LDFLAGS,ASFLAGS} for the target flags to +# maintain compatibility with the existing Makefiles +EXTRA_CFLAGS=@LEGACY_TARGET_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ + $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) +EXTRA_CXXFLAGS=@LEGACY_TARGET_CXXFLAGS@ +EXTRA_LDFLAGS=@LEGACY_TARGET_LDFLAGS@ +EXTRA_ASFLAGS=@LEGACY_TARGET_ASFLAGS@ +# Define an equivalent set for the host flags (i.e. without sysroot options) +HOST_CFLAGS=@LEGACY_HOST_CFLAGS@ $(NO_DELETE_NULL_POINTER_CHECKS_CFLAG) \ + $(NO_LIFETIME_DSE_CFLAG) $(CXXSTD_CXXFLAG) +HOST_CXXFLAGS=@LEGACY_HOST_CXXFLAGS@ +HOST_LDFLAGS=@LEGACY_HOST_LDFLAGS@ +HOST_ASFLAGS=@LEGACY_HOST_ASFLAGS@ USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@ USE_FORMAT_OVERFLOW=@USE_FORMAT_OVERFLOW@ diff --git a/hotspot/make/aix/makefiles/adlc.make b/hotspot/make/aix/makefiles/adlc.make index 6d4721d08d3..607a8f2b257 100644 --- a/hotspot/make/aix/makefiles/adlc.make +++ b/hotspot/make/aix/makefiles/adlc.make @@ -70,9 +70,9 @@ CFLAGS_WARN = -w CFLAGS += $(CFLAGS_WARN) # Extra flags from gnumake's invocation or environment -CFLAGS += $(EXTRA_CFLAGS) -LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) -ASFLAGS += $(EXTRA_ASFLAGS) +CFLAGS += $(HOST_CFLAGS) +LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS) +ASFLAGS += $(HOST_ASFLAGS) OBJECTNAMES = \ adlparse.o \ diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make index c4ee762aaf7..88f61fbd419 100644 --- a/hotspot/make/bsd/makefiles/adlc.make +++ b/hotspot/make/bsd/makefiles/adlc.make @@ -72,9 +72,9 @@ endif CFLAGS += $(CFLAGS_WARN) # Extra flags from gnumake's invocation or environment -CFLAGS += $(EXTRA_CFLAGS) -LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) -ASFLAGS += $(EXTRA_ASFLAGS) +CFLAGS += $(HOST_CFLAGS) +LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS) +ASFLAGS += $(HOST_ASFLAGS) OBJECTNAMES = \ adlparse.o \ diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index b5657fe1598..a01aa1aaac7 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -70,9 +70,9 @@ CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) CFLAGS += $(CFLAGS_WARN) # Extra flags from gnumake's invocation or environment -CFLAGS += $(EXTRA_CFLAGS) -LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS) -ASFLAGS += $(EXTRA_ASFLAGS) +CFLAGS += $(HOST_CFLAGS) +LFLAGS += $(HOST_CFLAGS) $(HOST_LDFLAGS) +ASFLAGS += $(HOST_ASFLAGS) OBJECTNAMES = \ adlparse.o \ diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index 0d2b810da8a..9ab746b9c79 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -84,8 +84,8 @@ endif CFLAGS += $(CFLAGS_WARN) # Extra flags from gnumake's invocation or environment -CFLAGS += $(EXTRA_CFLAGS) -ASFLAGS += $(EXTRA_ASFLAGS) +CFLAGS += $(HOST_CFLAGS) +ASFLAGS += $(HOST_ASFLAGS) ifeq ("${Platform_compiler}", "sparcWorks") # Enable the following CFLAGS addition if you need to compare the