8075140: Solaris build of native libraries not consistently using EXTRA_CFLAGS and EXTRA_LDFLAGS
Reviewed-by: ihse, tbell, dholmes
--- a/hotspot/make/solaris/makefiles/dtrace.make Wed Mar 18 10:22:24 2015 +0100
+++ b/hotspot/make/solaris/makefiles/dtrace.make Wed Mar 18 12:02:44 2015 +0100
@@ -130,8 +130,9 @@
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo $(LOG_INFO) Making $@
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
- $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
- $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
+ $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. $(EXTRA_CFLAGS) \
+ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c \
+ $(EXTRA_LDFLAGS) -lc -lthread -ldoor
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
@@ -216,8 +217,9 @@
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
@echo $(LOG_INFO) Making $@
- $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
- $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
+ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. $(EXTRA_CFLAGS) \
+ $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c \
+ $(EXTRA_LDFLAGS) -lc -lthread -ldoor
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
--- a/hotspot/make/solaris/makefiles/jsig.make Wed Mar 18 10:22:24 2015 +0100
+++ b/hotspot/make/solaris/makefiles/jsig.make Wed Mar 18 12:02:44 2015 +0100
@@ -50,7 +50,9 @@
$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
@echo $(LOG_INFO) Making signal interposition lib...
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
- $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
+ $(EXTRA_CFLAGS) \
+ $(LFLAGS_JSIG) $(EXTRA_LDFLAGS) \
+ -o $@ $(JSIGSRCDIR)/jsig.c -ldl
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
--- a/hotspot/make/solaris/makefiles/saproc.make Wed Mar 18 10:22:24 2015 +0100
+++ b/hotspot/make/solaris/makefiles/saproc.make Wed Mar 18 12:02:44 2015 +0100
@@ -89,6 +89,17 @@
# when actually building on Nevada-B158 or earlier:
#SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
+$(SADISOBJ): $(SADISSRCFILES)
+ $(QUIETLY) $(CC) \
+ $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ -I$(SASRCDIR) \
+ -I$(GENERATED) \
+ -I$(BOOT_JAVA_HOME)/include \
+ -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
+ $(SOLARIS_11_B159_OR_LATER) \
+ $(EXTRA_CFLAGS) \
+ $(SADISSRCFILES) \
+ -c -o $(SADISOBJ)
$(LIBSAPROC): $(SASRCFILES) $(SADISOBJ) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
@@ -103,23 +114,13 @@
-I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SOLARIS_11_B159_OR_LATER) \
+ $(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS) \
+ $(SADISOBJ) \
$(SASRCFILES) \
- $(SADISOBJ) \
$(SA_LFLAGS) \
-o $@ \
-ldl -ldemangle -lthread -lc
-$(SADISOBJ): $(SADISSRCFILES)
- $(QUIETLY) $(CC) \
- $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
- -I$(SASRCDIR) \
- -I$(GENERATED) \
- -I$(BOOT_JAVA_HOME)/include \
- -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
- $(SOLARIS_11_B159_OR_LATER) \
- $(SADISSRCFILES) \
- -c -o $(SADISOBJ)
-
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
--- a/hotspot/make/solaris/makefiles/vm.make Wed Mar 18 10:22:24 2015 +0100
+++ b/hotspot/make/solaris/makefiles/vm.make Wed Mar 18 12:02:44 2015 +0100
@@ -288,6 +288,8 @@
endif
endif
+LFLAGS_VM += $(EXTRA_LDFLAGS)
+
ifdef USE_GCC
LINK_VM = $(LINK_LIB.CC)
else