Please review at your convenience. Issue: https://bugs.openjdk.java.net/browse/JDK-8140630 Patch: Included below
The change is to compile src/java.base/share/native/libjava/Bits.c only into libjava.so with normal optimization level (-O2) instead of high optimization level (-O3). The other objects in libjava are not affected. This is for 64-bit Linux only. With this patch applied, java/nio/Buffer/Basic.java now passes on all platforms and there is no crash. Thanks, Brian --- a/make/lib/CoreLibraries.gmk +++ b/make/lib/CoreLibraries.gmk @@ -139,6 +139,12 @@ endif endif +ifeq ($(OPENJDK_TARGET_OS), linux) + ifeq ($(OPENJDK_TARGET_CPU), x86_64) + BUILD_LIBJAVA_Bits.c_CFLAGS := $(C_O_FLAG_NORM) + endif +endif + $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \ LIBRARY := java, \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \