diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index 9d7fa90e021..2191a7ae93e 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -386,17 +386,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS], IF_FALSE: [FDLIBM_CFLAGS=""]) fi AC_SUBST(FDLIBM_CFLAGS) - - # Tests are only ever compiled for TARGET - CFLAGS_TESTLIB="$CFLAGS_JDKLIB" - CXXFLAGS_TESTLIB="$CXXFLAGS_JDKLIB" - CFLAGS_TESTEXE="$CFLAGS_JDKEXE" - CXXFLAGS_TESTEXE="$CXXFLAGS_JDKEXE" - - AC_SUBST(CFLAGS_TESTLIB) - AC_SUBST(CFLAGS_TESTEXE) - AC_SUBST(CXXFLAGS_TESTLIB) - AC_SUBST(CXXFLAGS_TESTEXE) ]) ################################################################################ diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4 index 56186730d03..2e8d2a4cc4c 100644 --- a/make/autoconf/flags-ldflags.m4 +++ b/make/autoconf/flags-ldflags.m4 @@ -51,9 +51,7 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS], FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_]) - LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB" - LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE ${TARGET_LDFLAGS_JDK_LIBPATH}" - AC_SUBST(LDFLAGS_TESTLIB) + LDFLAGS_TESTEXE="${TARGET_LDFLAGS_JDK_LIBPATH}" AC_SUBST(LDFLAGS_TESTEXE) ]) diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index e6ee25299c9..58291090903 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -488,11 +488,6 @@ LDCXX:=@FIXPATH@ @LDCXX@ LIBCXX:=@LIBCXX@ # Compiler and linker flags used when building native tests -CFLAGS_TESTLIB:=@CFLAGS_TESTLIB@ -CXXFLAGS_TESTLIB:=@CXXFLAGS_TESTLIB@ -CFLAGS_TESTEXE:=@CFLAGS_TESTEXE@ -CXXFLAGS_TESTEXE:=@CXXFLAGS_TESTEXE@ -LDFLAGS_TESTLIB:=@LDFLAGS_TESTLIB@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@ # BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the diff --git a/make/common/TestFilesCompilation.gmk b/make/common/TestFilesCompilation.gmk index fece956f334..596b83eff2d 100644 --- a/make/common/TestFilesCompilation.gmk +++ b/make/common/TestFilesCompilation.gmk @@ -60,14 +60,16 @@ define SetupTestFilesCompilationBody ifeq ($$($1_TYPE), LIBRARY) $1_PREFIX = lib $1_OUTPUT_SUBDIR := lib - $1_CFLAGS += $(CFLAGS_TESTLIB) - $1_LDFLAGS := $(LDFLAGS_TESTLIB) $(call SET_SHARED_LIBRARY_ORIGIN) + $1_BASE_CFLAGS := $(CFLAGS_JDKLIB) + $1_BASE_CXXFLAGS := $(CXXFLAGS_JDKLIB) + $1_LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN) $1_COMPILATION_TYPE := LIBRARY else ifeq ($$($1_TYPE), PROGRAM) $1_PREFIX = exe $1_OUTPUT_SUBDIR := bin - $1_CFLAGS += $(CFLAGS_TESTEXE) - $1_LDFLAGS := $(LDFLAGS_TESTEXE) + $1_BASE_CFLAGS := $(CFLAGS_JDKEXE) + $1_BASE_CXXFLAGS := $(CXXFLAGS_JDKEXE) + $1_LDFLAGS := $(LDFLAGS_JDKEXE) $(LDFLAGS_TESTEXE) $1_COMPILATION_TYPE := EXECUTABLE else $$(error Unknown type: $$($1_TYPE)) @@ -92,8 +94,11 @@ define SetupTestFilesCompilationBody INCLUDE_FILES := $$(notdir $$(file)), \ OBJECT_DIR := $$($1_OUTPUT_DIR)/support/$$(name), \ OUTPUT_DIR := $$($1_OUTPUT_DIR)/$$($1_OUTPUT_SUBDIR), \ - CFLAGS := $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ + CFLAGS := $$($1_BASE_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ + CXXFLAGS := $$($1_BASE_CXXFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \ LDFLAGS := $$($1_LDFLAGS) $$($1_LDFLAGS_$$(name)), \ + DISABLED_WARNINGS_CXX_solstudio := wvarhidenmem, \ + DISABLED_WARNINGS_CXX_gcc := format, \ LIBS := $$($1_LIBS_$$(name)), \ TOOLCHAIN := $(if $$(filter %.cpp, $$(file)), TOOLCHAIN_LINK_CXX, TOOLCHAIN_DEFAULT), \ OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \