Skip to content

Commit

Permalink
Add OpenSSL related settings to CUSTOM_COMPILER_ENV_VARS
Browse files Browse the repository at this point in the history
- Add `OPENSSL_DIR`, `OPENSSL_CFLAGS`, `OPENSSL_LIBS`,
  and `OPENSSL_BUNDLE_LIB_PATH` to `CUSTOM_COMPILER_ENV_VARS`.
- Bundle libssl if `--with-openssl=fetched --enable-openssl-bundling`
  is set. It is required by JITaaS.

Issue eclipse-openj9/openj9#5720

Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
  • Loading branch information
a7ehuo committed Nov 20, 2019
1 parent 49d2632 commit 8a98fd7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,21 @@ endif
ifneq (,$(OPENJ9_DEVELOPER_DIR))
CUSTOM_COMPILER_ENV_VARS += DEVELOPER_DIR="$(OPENJ9_DEVELOPER_DIR)"
endif
ifneq (,$(OPENSSL_CFLAGS))
CUSTOM_COMPILER_ENV_VARS += OPENSSL_CFLAGS="$(OPENSSL_CFLAGS)"

ifneq (,$(OPENSSL_DIR))
CUSTOM_COMPILER_ENV_VARS += OPENSSL_DIR="$(OPENSSL_DIR)"
endif

ifneq (,$(OPENSSL_LIBS))
CUSTOM_COMPILER_ENV_VARS += OPENSSL_LIBS="$(OPENSSL_LIBS)"
endif

ifneq (,$(OPENSSL_BUNDLE_LIB_PATH))
CUSTOM_COMPILER_ENV_VARS += OPENSSL_BUNDLE_LIB_PATH="$(OPENSSL_BUNDLE_LIB_PATH)"
endif
endif

generate-j9-version-headers :
@$(ECHO) Ensuring version information is up-to-date
Expand Down
20 changes: 20 additions & 0 deletions jdk/make/CopyFiles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,26 @@ ifneq ($(OPENSSL_BUNDLE_LIB_PATH), )

COPY_FILES += $(OPENSSL_TARGET_LIB)
endif

# To bundle first search for libssl 1.1.x library, if not found, search for 1.0.x
ifeq ($(OPENJDK_TARGET_OS), linux)
OPENSSL_SSL_LIB_NAME = libssl.so.1.1
ifeq ("$(wildcard $(OPENSSL_BUNDLE_LIB_PATH)/$(OPENSSL_SSL_LIB_NAME))", "")
OPENSSL_SSL_LIB_NAME = libssl.so.1.0.0
ifeq ("$(wildcard $(OPENSSL_BUNDLE_LIB_PATH)/$(OPENSSL_SSL_LIB_NAME))", "")
OPENSSL_SSL_LIB_NAME =
endif
endif
endif

ifneq ($(OPENSSL_SSL_LIB_NAME), )
OPENSSL_SSL_TARGET_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(OPENSSL_SSL_LIB_NAME)

$(OPENSSL_SSL_TARGET_LIB): $(OPENSSL_BUNDLE_LIB_PATH)/$(OPENSSL_SSL_LIB_NAME)
$(CP) $(OPENSSL_BUNDLE_LIB_PATH)/$(OPENSSL_SSL_LIB_NAME) $@

COPY_FILES += $(OPENSSL_SSL_TARGET_LIB)
endif
endif

##########################################################################################
Expand Down
1 change: 1 addition & 0 deletions jdk/make/closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -659,4 +659,5 @@ AC_DEFUN([CONFIGURE_OPENSSL],
AC_SUBST(WITH_OPENSSL)
AC_SUBST(BUILD_OPENSSL)
AC_SUBST(OPENSSL_CFLAGS)
AC_SUBST(OPENSSL_LIBS)
])
1 change: 1 addition & 0 deletions jdk/make/closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ BUILD_OPENSSL := @BUILD_OPENSSL@
OPENSSL_CFLAGS := @OPENSSL_CFLAGS@
OPENSSL_BUNDLE_LIB_PATH := @OPENSSL_BUNDLE_LIB_PATH@
WITH_OPENSSL := @WITH_OPENSSL@
OPENSSL_LIBS := @OPENSSL_LIBS@

## DDR
OPENJ9_ENABLE_DDR := @OPENJ9_ENABLE_DDR@
Expand Down

0 comments on commit 8a98fd7

Please sign in to comment.