diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk index 90796dd0f1e..73f3edff8a0 100644 --- a/jdk/make/CompileDemos.gmk +++ b/jdk/make/CompileDemos.gmk @@ -309,7 +309,7 @@ define SetupBuildJvmtiDemoBody ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX) # For C++, we also need some special treatment. - $1_LDFLAGS := $(LDFLAGS_CXX_JDK) + $1_LDFLAGS := $$(LDFLAGS_CXX_JDK) $1_LIBS := $(LIBCXX) ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) @@ -324,9 +324,9 @@ define SetupBuildJvmtiDemoBody OPTIMIZATION := LOW, \ CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \ CXXFLAGS := $$($1_CXXFLAGS), \ - LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)) \ + LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)) \ $$($1_LDFLAGS), \ - LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \ + LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \ LIBS := $$($1_LIBS), \ LIBS_solaris := -lc, \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ diff --git a/jdk/make/launcher/Launcher-java.base.gmk b/jdk/make/launcher/Launcher-java.base.gmk index abe829ad4d3..4214de4ec22 100644 --- a/jdk/make/launcher/Launcher-java.base.gmk +++ b/jdk/make/launcher/Launcher-java.base.gmk @@ -127,8 +127,7 @@ ifneq ($(BUILD_JEXEC_SRC), ) $(BUILD_JEXEC_INC), \ CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC, \ - LDFLAGS := $(LDFLAGS_JDKEXE) \ - $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \ + LDFLAGS := $(LDFLAGS_JDKEXE), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \ OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \ DEBUG_SYMBOLS := true, \ diff --git a/jdk/make/launcher/Launcher-jdk.pack200.gmk b/jdk/make/launcher/Launcher-jdk.pack200.gmk index a5506b5fc16..55c03865f71 100644 --- a/jdk/make/launcher/Launcher-jdk.pack200.gmk +++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk @@ -89,7 +89,6 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \ MAPFILE := $(UNPACK_MAPFILE),\ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \ - $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \ LIBS_solaris := -lc, \ diff --git a/jdk/make/launcher/LauncherCommon.gmk b/jdk/make/launcher/LauncherCommon.gmk index 4d8dff00433..aeee54a2d0a 100644 --- a/jdk/make/launcher/LauncherCommon.gmk +++ b/jdk/make/launcher/LauncherCommon.gmk @@ -25,6 +25,12 @@ include NativeCompilation.gmk +# SetupNativeCompilation now supports debug symbols on macosx for hotspot. +# Disable it here for the jdk binaries until we decide to enable them. +ifeq ($(OPENJDK_TARGET_OS), macosx) + ENABLE_DEBUG_SYMBOLS := false +endif + # Prepare the find cache. $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher)) @@ -180,15 +186,12 @@ define SetupBuildLauncherBody CFLAGS_linux := -fPIC, \ CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \ CFLAGS_windows := $$($1_CFLAGS_windows), \ - LDFLAGS := $(LDFLAGS_JDKEXE) \ + LDFLAGS := $$(LDFLAGS_JDKEXE) \ $$(ORIGIN_ARG) \ $$($1_LDFLAGS), \ LDFLAGS_linux := \ - $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \ -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \ - LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \ LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \ - $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \ -L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \ MAPFILE := $$($1_MAPFILE), \ LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \ diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index af85b7e0566..08cd4d774ab 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -683,7 +683,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ WARNINGS_AS_ERRORS_gcc := false, \ WARNINGS_AS_ERRORS_solstudio := false, \ MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ - LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ + LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \ LDFLAGS_macosx := -undefined dynamic_lookup, \ @@ -799,7 +799,7 @@ else # OPENJDK_TARGET_OS not windows LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \ - LDFLAGS_macosx := -Xlinker -rpath -Xlinker @loader_path, \ + LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \ LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \ LIBS_solaris := $(X_LIBS) -lXrender, \ LIBS_macosx := -framework Cocoa, \ @@ -1034,7 +1034,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx) -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN) \ - -Xlinker -rpath -Xlinker @loader_path \ + -Wl$(COMMA)-rpath$(COMMA)@loader_path \ -L$(INSTALL_LIBRARIES_HERE), \ LIBS := -lawt -losxapp -lawt_lwawt \ -framework Cocoa \ diff --git a/jdk/make/lib/Lib-java.instrument.gmk b/jdk/make/lib/Lib-java.instrument.gmk index 76ff764ed36..834cdc2850d 100644 --- a/jdk/make/lib/Lib-java.instrument.gmk +++ b/jdk/make/lib/Lib-java.instrument.gmk @@ -65,7 +65,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ -L$(call FindLibDirForModule, java.base)/jli, \ LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \ -L$(call FindLibDirForModule, java.base)/jli, \ - LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \ + LDFLAGS_macosx := -Wl$(COMMA)-all_load, \ LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \ LDFLAGS_windows := -export:Agent_OnAttach, \ LIBS := $(JDKLIB_LIBS), \ @@ -74,7 +74,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \ LIBS_solaris := -ljli $(LIBDL), \ LIBS_aix := -liconv -ljli_static $(LIBDL), \ LIBS_macosx := -liconv -framework Cocoa -framework Security \ - -framework ApplicationServices, \ + -framework ApplicationServices \ + $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \ LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \ $(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \ VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk index d1bfc4ed3a5..68bdcc0a414 100644 --- a/jdk/make/lib/LibCommon.gmk +++ b/jdk/make/lib/LibCommon.gmk @@ -46,6 +46,12 @@ else endif endif +# SetupNativeCompilation now supports debug symbols on macosx for hotspot. +# Disable it here for the jdk libraries until we decide to enable them. +ifeq ($(OPENJDK_TARGET_OS), macosx) + ENABLE_DEBUG_SYMBOLS := false +endif + ################################################################################ # Find the default set of src dirs for a native library. # Param 1 - module name