changeset 10533:85ac7a53d91d

- Dynamically link libjli for *BSD Reviewed By: Greg Lewis, Christos Zoulas
author kurt
date Mon, 18 May 2015 12:27:26 -0400
parents 7dc4b05dd9fd
children 56c12afbcc85
files make/CompileLaunchers.gmk make/lib/CoreLibraries.gmk make/lib/ServiceabilityLibraries.gmk
diffstat 3 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/make/CompileLaunchers.gmk	Sat May 16 12:18:42 2015 -0400
+++ b/make/CompileLaunchers.gmk	Mon May 18 12:27:26 2015 -0400
@@ -49,7 +49,7 @@
   ORIGIN_ROOT := /..
 endif
 
-ifneq ($(findstring $(OPENJDK_TARGET_OS), bsd macosx), )
+ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx), )
   ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
 else
   ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
@@ -89,11 +89,6 @@
 
   $1_LDFLAGS := $3
   $1_LDFLAGS_SUFFIX :=
-  ifeq ($(OPENJDK_TARGET_OS), bsd)
-    $1_LDFLAGS += -Wl,--whole-archive $(JDK_OUTPUTDIR)/objs/libjli_static.a \
-        -Wl,--no-whole-archive
-    $1_LDFLAGS_SUFFIX += -pthread
-  endif
 
   ifeq ($(OPENJDK_TARGET_OS), macosx)
     $1_PLIST_FILE := Info-cmdline.plist
@@ -181,6 +176,8 @@
           $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
       LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
           $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
+      LDFLAGS_bsd := -pthread \
+          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
       MAPFILE := $$($1_MAPFILE), \
       LDFLAGS_SUFFIX := $(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX), \
       LDFLAGS_SUFFIX_posix := $4, \
@@ -188,6 +185,7 @@
           $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5, \
       LDFLAGS_SUFFIX_linux := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
       LDFLAGS_SUFFIX_solaris := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
+      LDFLAGS_SUFFIX_bsd := -L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -pthread, \
       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR), \
       OUTPUT_DIR := $$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR), \
       PROGRAM := $1, \
@@ -203,7 +201,7 @@
 
   BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
 
-  ifneq (,$(filter $(OPENJDK_TARGET_OS), bsd macosx aix))
+  ifneq (,$(filter $(OPENJDK_TARGET_OS), macosx aix))
     $$(BUILD_LAUNCHER_$1): $(JDK_OUTPUTDIR)/objs/libjli_static.a
   endif
 
--- a/make/lib/CoreLibraries.gmk	Sat May 16 12:18:42 2015 -0400
+++ b/make/lib/CoreLibraries.gmk	Mon May 18 12:27:26 2015 -0400
@@ -466,7 +466,7 @@
 
   BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
 
-else ifneq ($(findstring $(OPENJDK_TARGET_OS), bsd macosx), )
+else ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx), )
   #
   # On BSD they do partial (incremental) linking of libjli_static.a
   # code it here...rather than add support to NativeCompilation
--- a/make/lib/ServiceabilityLibraries.gmk	Sat May 16 12:18:42 2015 -0400
+++ b/make/lib/ServiceabilityLibraries.gmk	Mon May 18 12:27:26 2015 -0400
@@ -263,8 +263,7 @@
         $(LIBINSTRUMENT_LDFLAGS), \
     LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
     LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
-    LDFLAGS_bsd := -Xlinker --whole-archive $(JDK_OUTPUTDIR)/objs/libjli_static.a \
-        -Xlinker --no-whole-archive, \
+    LDFLAGS_bsd := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
     LDFLAGS_macosx := -Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
         -framework Cocoa -framework Security -framework ApplicationServices, \
     LDFLAGS_SUFFIX := $(LIBINSTRUMENT_LDFLAGS_SUFFIX), \
@@ -281,7 +280,7 @@
     OBJECT_DIR := $(LIBINSTRUMENT_DIR), \
     DEBUG_SYMBOLS := true))
 
-ifneq (, $(findstring $(OPENJDK_TARGET_OS), bsd macosx windows aix))
+ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows aix))
   $(BUILD_LIBINSTRUMENT): $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
 else
   $(BUILD_LIBINSTRUMENT): $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)