8055141: Catch linker errors earlier in the JVM build by not allowing unresolved externals
authormgerdin
Thu, 25 Sep 2014 10:01:53 +0200
changeset 26851 f64f39a7ec7c
parent 26850 515ff48cf5f0
child 26852 07ce0e66e6ea
8055141: Catch linker errors earlier in the JVM build by not allowing unresolved externals Reviewed-by: erikj, ehelin, dholmes
hotspot/make/bsd/makefiles/vm.make
hotspot/make/linux/makefiles/vm.make
hotspot/make/solaris/makefiles/vm.make
--- a/hotspot/make/bsd/makefiles/vm.make	Wed Sep 24 11:00:12 2014 +0200
+++ b/hotspot/make/bsd/makefiles/vm.make	Thu Sep 25 10:01:53 2014 +0200
@@ -272,6 +272,8 @@
     LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.
     LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/..
     LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F)
+  else
+    LFLAGS_VM                += -Wl,-z,defs
   endif
 
   # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
--- a/hotspot/make/linux/makefiles/vm.make	Wed Sep 24 11:00:12 2014 +0200
+++ b/hotspot/make/linux/makefiles/vm.make	Thu Sep 25 10:01:53 2014 +0200
@@ -268,6 +268,7 @@
   LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
   LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
   LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
+  LFLAGS_VM                += -Wl,-z,defs
 
   # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
   # get around library dependency and compatibility issues. Must use gcc not
--- a/hotspot/make/solaris/makefiles/vm.make	Wed Sep 24 11:00:12 2014 +0200
+++ b/hotspot/make/solaris/makefiles/vm.make	Thu Sep 25 10:01:53 2014 +0200
@@ -130,7 +130,7 @@
 # Not sure what the 'designed for' comment is referring too above.
 #   The order may not be too significant anymore, but I have placed this
 #   older libm before libCrun, just to make sure it's found and used first.
-LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
+LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle -lnsl
 else
 ifeq ($(COMPILER_REV_NUMERIC), 502)
 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
@@ -284,6 +284,7 @@
   LIBJVM_MAPFILE$(LDNOMAP) = mapfile_extended
   LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
   LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
+  LFLAGS_VM                += -Wl,-z,defs
 ifndef USE_GCC
   LIBS_VM                  = $(LIBS)
 else