8210931: JLI and launchers normalization and cleanup

Reviewed-by: alanb, erikj
This commit is contained in:
Magnus Ihse Bursie 2018-09-20 21:05:00 +02:00
parent 4c400d2372
commit aa16ed8006
8 changed files with 26 additions and 77 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2018, 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
@ -65,13 +65,13 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@
$(LN) -s ../Home/lib/libjli.dylib $@
$(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@
$(LN) -s ../Home/lib/libjli.dylib $@
$(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \

View File

@ -38,7 +38,6 @@ JAVA_RC_FLAGS += -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
$(eval $(call SetupBuildLauncher, java, \
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
LDFLAGS_solaris := -R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR), \
LIBS_windows := user32.lib comctl32.lib, \
EXTRA_RC_FLAGS := $(JAVA_RC_FLAGS), \
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/java_objs, \
@ -55,7 +54,6 @@ TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/java.base/java$(EXE_SUFFIX)
ifeq ($(OPENJDK_TARGET_OS), windows)
$(eval $(call SetupBuildLauncher, javaw, \
CFLAGS := -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS -DENABLE_ARG_FILES, \
LIBS_windows := user32.lib comctl32.lib, \
EXTRA_RC_FLAGS := $(JAVA_RC_FLAGS), \
VERSION_INFO_RESOURCE := $(JAVA_VERSION_INFO_RESOURCE), \
))

View File

@ -31,5 +31,4 @@ $(eval $(call SetupBuildLauncher, jconsole, \
--add-modules ALL-DEFAULT \
-Djconsole.showOutputViewer, \
CFLAGS_windows := -DJAVAW, \
LIBS_windows := user32.lib, \
))

View File

@ -25,15 +25,6 @@
include JdkNativeCompilation.gmk
ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,/../lib/jli)
# Applications expect to be able to link against libjawt without invoking
# System.loadLibrary("jawt") first. This was the behaviour described in the
# devloper documentation of JAWT and what worked with OpenJDK6.
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,/../lib)
endif
# Tell the compiler not to export any functions unless declared so in
# the source code. On Windows, this is the default and cannot be changed.
# On Mac, we have always exported all symbols, probably due to oversight
@ -86,8 +77,6 @@ JAVA_MANIFEST := $(TOPDIR)/src/java.base/windows/native/launcher/java.manifest
# compile time defines exceeding Visual Studio 2013 limitations.
# CFLAGS Additional CFLAGS
# CFLAGS_windows Additional CFLAGS_windows
# LIBS_unix Additional LIBS_unix
# LIBS_windows Additional LIBS_windows
# LDFLAGS_solaris Additional LDFLAGS_solaris
# RC_FLAGS Additional RC_FLAGS
# MACOSX_SIGNED On macosx, sign this binary
@ -119,7 +108,6 @@ define SetupBuildLauncherBody
$$(addprefix -J, $$($1_JAVA_ARGS)) $$($1_LAUNCHER_CLASS), "$$a"$(COMMA) )) }'
$1_CFLAGS += -DJAVA_ARGS=$$($1_JAVA_ARGS_STR)
$1_LIBS :=
ifeq ($(OPENJDK_TARGET_OS), macosx)
ifeq ($$($1_MACOSX_SIGNED), true)
$1_PLIST_FILE := Info-privileged.plist
@ -128,8 +116,8 @@ define SetupBuildLauncherBody
$1_PLIST_FILE := Info-cmdline.plist
endif
$1_LDFLAGS += -Wl,-all_load \
-sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
$1_LDFLAGS += -sectcreate __TEXT __info_plist $(MACOSX_PLIST_DIR)/$$($1_PLIST_FILE)
ifeq ($(STATIC_BUILD), true)
$1_LDFLAGS += -exported_symbols_list \
$(SUPPORT_OUTPUTDIR)/build-static/exported.symbols
@ -143,13 +131,6 @@ define SetupBuildLauncherBody
-framework SystemConfiguration \
-lstdc++ -liconv
endif
$1_LIBS += -framework Cocoa -framework Security \
-framework ApplicationServices
endif
ifeq ($(OPENJDK_TARGET_OS), aix)
$1_LDFLAGS += -L$(SUPPORT_OUTPUTDIR)/native/java.base
$1_LIBS += -ljli_static
endif
ifeq ($(USE_EXTERNAL_LIBZ), true)
@ -172,22 +153,23 @@ define SetupBuildLauncherBody
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
CFLAGS_windows := $$($1_CFLAGS_windows), \
LDFLAGS := $$(LDFLAGS_JDKEXE) \
$$(ORIGIN_ARG) \
$$(call SET_EXECUTABLE_ORIGIN) \
$$($1_LDFLAGS), \
LDFLAGS_linux := \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_macosx := \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
-L$(call FindLibDirForModule, java.base), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
-L$(call FindLibDirForModule, java.base), \
LDFLAGS_solaris := $$(call SET_EXECUTABLE_ORIGIN,/../lib) \
-L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
LIBS_unix := $$($1_LIBS_unix), \
LIBS_linux := -lpthread -ljli $(LIBDL), \
LIBS_macosx := -ljli, \
LIBS_linux := -ljli -lpthread $(LIBDL), \
LIBS_macosx := -ljli -framework Cocoa -framework Security \
-framework ApplicationServices, \
LIBS_solaris := -ljli -lthread $(LIBDL), \
LIBS_aix := -ljli_static, \
LIBS_windows := $$($1_WINDOWS_JLI_LIB) \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib advapi32.lib \
$$($1_LIBS_windows), \
$(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib, \
OUTPUT_DIR := $$($1_OUTPUT_DIR), \
VERSIONINFO_RESOURCE := $$($1_VERSION_INFO_RESOURCE), \
EXTRA_RC_FLAGS := $$($1_EXTRA_RC_FLAGS), \

View File

@ -180,39 +180,16 @@ TARGETS += $(BUILD_LIBJIMAGE)
##########################################################################################
ifeq ($(call check-jvm-variant, zero), true)
ERGO_FAMILY := zero
else
ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
ERGO_FAMILY := i586
else
ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
endif
endif
LIBJLI_ALL_ERGO := $(wildcard $(addsuffix /ergo_*.c, $(LIBJLI_SRC_DIRS)))
LIBJLI_EXCLUDE_ERGO := $(filter-out %/ergo_$(ERGO_FAMILY).c, $(LIBJLI_ALL_ERGO))
# If all specialized ergo files are excluded, use generic ergo
ifeq ($(LIBJLI_ALL_ERGO), $(LIBJLI_EXCLUDE_ERGO))
LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
endif
LIBJLI_EXCLUDE_FILES += $(notdir $(LIBJLI_EXCLUDE_ERGO))
ifeq ($(OPENJDK_TARGET_OS), macosx)
LIBJLI_EXCLUDE_FILES += java_md_solinux.c ergo.c ergo_i586.c
BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
LIBJLI_EXCLUDE_FILES += java_md_solinux.c
endif
ifeq ($(OPENJDK_TARGET_OS), windows)
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
# Supply the name of the C runtime lib.
LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
ifneq ($(MSVCP_DLL), )
LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
endif
else
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
endif
LIBJLI_CFLAGS += $(LIBZ_CFLAGS)
@ -231,7 +208,7 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
NAME := jli, \
OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
EXCLUDE_FILES := $(LIBJLI_EXCLUDE_FILES), \
EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
OPTIMIZATION := HIGH, \
@ -241,8 +218,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
E_STATEMENT_NOT_REACHED, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
LIBS_solaris := $(LIBDL), \

View File

@ -172,7 +172,7 @@ endif
ifeq ($(STATIC_BUILD), true)
JAVA_BASE_EXPORT_SYMBOLS_SRC := \
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jli/$(LIBRARY_PREFIX)jli.symbols \
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)jli.symbols \
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)java.symbols \
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)net.symbols \
$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$(LIBRARY_PREFIX)nio.symbols \
@ -205,4 +205,4 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
DEST := $(call FindLibDirForModule, $(MODULE)), \
))
TARGETS += $(COPY_TZMAPPINGS)
endif
endif

View File

@ -46,12 +46,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
$(LIBINSTRUMENT_LDFLAGS), \
LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_linux := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_solaris := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_macosx := -L$(call FindLibDirForModule, java.base), \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LIBS := $(JDKLIB_LIBS), \
LIBS_unix := -ljava -ljvm $(LIBZ_LIBS), \
@ -66,10 +63,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
ifeq ($(OPENJDK_TARGET_OS), aix)
$(BUILD_LIBINSTRUMENT): $(call FindStaticLib, java.base, jli_static)
else ifeq ($(OPENJDK_TARGET_OS), windows)
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
else
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli, /jli)
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, jli)
endif
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java)