changeset 2722:e7d58c18c5ec

. Use $(LIBDL) throughout the JDK make infrastructure instead of explicitly using -ldl. This allows us to remove a number of BSD specific changes.
author Greg Lewis <glewis@eyesbeyond.com>
date Fri, 06 Aug 2010 21:56:03 -0700
parents a051f054b87a
children dd3f3fe67bc5
files make/com/sun/nio/sctp/Makefile make/java/instrument/Makefile make/java/jli/Makefile make/java/net/Makefile make/java/nio/Makefile make/jpda/back/Makefile make/mkdemo/jvmti/hprof/Makefile make/sun/awt/Makefile make/sun/awt/mawt.gmk make/sun/image/generic/Makefile make/sun/image/vis/Makefile make/sun/jdga/Makefile make/sun/security/ec/Makefile make/sun/security/jgss/wrapper/Makefile make/sun/security/krb5/Makefile make/sun/security/pkcs11/Makefile make/sun/security/smartcardio/Makefile make/sun/tracing/dtrace/Makefile make/tools/reorder/Makefile
diffstat 19 files changed, 33 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/make/com/sun/nio/sctp/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/com/sun/nio/sctp/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -60,17 +60,10 @@
   -I$(PLATFORM_SRC)/native/java/net \
   -I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
 
+OTHER_LDLIBS += $(LIBSOCKET) -L$(LIBDIR)/$(LIBARCH) -lnet -lnio
 ifeq ($(PLATFORM), linux)
 COMPILER_WARNINGS_FATAL=true
-#OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
-OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -lnio -lnet -lpthread -ldl
-endif
-ifeq ($(PLATFORM), solaris)
-#LIBSCTP = -lsctp
-OTHER_LDLIBS += $(LIBSOCKET) -L$(LIBDIR)/$(LIBARCH) -lnet -lnio
-endif # PLATFORM
-ifeq ($(PLATFORM), bsd)
-OTHER_LDLIBS += $(LIBSOCKET) -L$(LIBDIR)/$(LIBARCH) -lnet -lnio
+OTHER_LDLIBS += -lpthread $(LIBDL)
 endif
 
 else # windows
--- a/make/java/instrument/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/java/instrument/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -125,7 +125,7 @@
 else
   LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
   OTHER_LDLIBS += -ljli
-  OTHER_LDLIBS += -ldl 
+  OTHER_LDLIBS += $(LIBDL)
   ifeq ($(PLATFORM), solaris)
     LDFLAGS += -R \$$ORIGIN/jli
   endif
--- a/make/java/jli/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/java/jli/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -105,12 +105,10 @@
 ifneq ($(PLATFORM), windows)	# UNIX systems
         LD_RUNPATH_EXTRAS += ..
 	LIB_LOCATION = $(LIBDIR)/$(LIBARCH)/jli
-ifneq ($(PLATFORM), bsd)	# other UNIX systems
 	# Note: its important to keep this order meaning -lc is the
 	# last library otherwise it could cause compatibility issues
 	# by pulling in SUNW_private symbols from libc
-	LDLIBS = -ldl -lc
-endif # !bsd
+	LDLIBS = $(LIBDL) -lc
 ifeq ($(USE_PTHREADS),true)
 	LDLIBS += -lpthread
 endif # USE_PTHREADS 
--- a/make/java/net/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/java/net/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -102,7 +102,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
 else
-  OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
+  OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) $(LIBDL) $(JVMLIB)
 endif
 ifeq ($(PLATFORM), linux)
   OTHER_LDLIBS += -lpthread
--- a/make/java/nio/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/java/nio/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -359,16 +359,17 @@
      $(OBJDIR)/../../../../sun/java.net/net/$(OBJDIRNAME)/net.lib \
      $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/io_util.obj \
      $(OBJDIR)/../../../java.lang/java/$(OBJDIRNAME)/FileDescriptor_md.obj
-endif
+else
+ifeq ($(PLATFORM), solaris)
+OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 $(LIBDL)
+endif # solaris
+OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet
 ifeq ($(PLATFORM), linux)
-OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
+OTHER_LDLIBS += -lpthread $(LIBDL)
 endif
 ifeq ($(PLATFORM), bsd)
-OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -pthread
+OTHER_LDLIBS += -pthread
 endif
-ifeq ($(PLATFORM), solaris)
-OTHER_LDLIBS += $(JVMLIB) $(LIBSOCKET) -lposix4 -ldl \
-		-L$(LIBDIR)/$(LIBARCH) -ljava -lnet
 endif # PLATFORM
 
 #
--- a/make/jpda/back/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/jpda/back/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -50,9 +50,7 @@
                  -I$(GENNATIVESRCDIR)/jdwp
 
 ifneq ($(PLATFORM), windows)
-ifneq ($(PLATFORM), bsd)
-  OTHER_LDLIBS += -ldl
-endif # PLATFORM
+  OTHER_LDLIBS += $(LIBDL)
 endif # PLATFORM
 
 #
--- a/make/mkdemo/jvmti/hprof/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/mkdemo/jvmti/hprof/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -37,12 +37,11 @@
 
 ifeq ($(PLATFORM), windows)
   EXTRA_LIBS += wsock32.lib winmm.lib
+else
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBDL)
+ifeq ($(PLATFORM), linux)
+  OTHER_LDLIBS += -lpthread
 endif
-ifeq ($(PLATFORM), solaris)
-  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
-endif
-ifeq ($(PLATFORM), linux)
-  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -lpthread
 endif
 
 #
--- a/make/sun/awt/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/awt/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -94,7 +94,7 @@
 ifeq  ($(PLATFORM), solaris)
 FILES_c = $(FILES_2D_c)
 FILES_c += awt_LoadLibrary.c
-OTHER_LDLIBS = $(JVMLIB) $(LIBM) -ldl
+OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL)
 ifeq ($(CC_VER), 5.8)
   ifndef REMOVE_ALL_WORKAROUNDS
     ifeq ($(ARCH_FAMILY), i586)
@@ -121,7 +121,7 @@
 FILES_c = $(FILES_2D_c)
 FILES_c += awt_LoadLibrary.c
 OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
-OTHER_LDLIBS = $(JVMLIB) $(LIBM) -ldl
+OTHER_LDLIBS = $(JVMLIB) $(LIBM) $(LIBDL)
 endif
 
 ifeq  ($(PLATFORM), bsd)
--- a/make/sun/awt/mawt.gmk	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/awt/mawt.gmk	Fri Aug 06 21:56:03 2010 -0700
@@ -180,11 +180,7 @@
 # !HEADLESS
 
 OTHER_LDLIBS += $(JVMLIB) $(LIBCXX) \
-                -lawt $(LIBM)
-
-ifneq ($(PLATFORM), bsd)
-OTHER_LDLIBS += -ldl
-endif
+                -lawt $(LIBM) $(LIBDL)
 
 #
 # Sun CC with -Xa misdefines __STDC__ to 0 (zero).
--- a/make/sun/image/generic/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/image/generic/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -69,9 +69,5 @@
             -I$(PLATFORM_SRC)/native/$(PKGDIR)/medialib 
 
 OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES
-OTHER_LDLIBS = $(LIBM)
-ifneq ($(PLATFORM), bsd)
-OTHER_LDLIBS += -ldl
-endif
+OTHER_LDLIBS = $(LIBM) $(LIBDL)
 
-
--- a/make/sun/image/vis/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/image/vis/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -69,5 +69,5 @@
 CFLAGS += $(CFLAGS_$(ARCH)) $(INLINE) -I$(PLATFORM_SRC)/native/sun/awt/medialib -I$(SHARE_SRC)/native/sun/awt/medialib
 
 OTHER_CFLAGS += -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES
-OTHER_LDLIBS = $(LIBM) -ldl
+OTHER_LDLIBS = $(LIBM) $(LIBDL)
 
--- a/make/sun/jdga/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/jdga/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -56,7 +56,7 @@
 vpath %.c   $(PLATFORM_SRC)/native/$(PKGDIR)
 
 ifneq ($(PLATFORM), windows)
-  LDLIBS =  -ldga -lX11 -ldl -lc
+  LDLIBS =  -ldga -lX11 $(LIBDL) -lc
 
   CPPFLAGS += \
 	-I$(SHARE_SRC)/javavm/export \
--- a/make/sun/security/ec/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/security/ec/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -193,11 +193,7 @@
   ifeq ($(PLATFORM), windows)
     OTHER_LDLIBS += $(JVMLIB)
   else
-    ifeq ($(PLATFORM), bsd)
-      OTHER_LDLIBS = $(JVMLIB) $(LIBCXX)
-    else
-      OTHER_LDLIBS = -ldl $(JVMLIB) $(LIBCXX)
-    endif
+    OTHER_LDLIBS = $(LIBDL) $(JVMLIB) $(LIBCXX)
   endif
 
   include $(BUILDDIR)/common/Mapfile-vers.gmk
--- a/make/sun/security/jgss/wrapper/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/security/jgss/wrapper/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -72,10 +72,6 @@
 #
 # Libraries to link
 #
-ifneq (,$(findstring $(PLATFORM), linux solaris))
-  OTHER_LDLIBS = -ldl $(JVMLIB)
+ifeq ($(PLATFORM), windows)
+OTHER_LDLIBS = $(LIBDL) $(JVMLIB)
 endif
-
-ifeq ($(PLATFORM), bsd)
-  OTHER_LDLIBS = $(JVMLIB)
-endif
--- a/make/sun/security/krb5/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/security/krb5/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -76,7 +76,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS = $(JVMLIB)
 else
-  OTHER_LDLIBS = -ldl $(JVMLIB)
+  OTHER_LDLIBS = $(LIBDL) $(JVMLIB)
 endif
 
 build:
--- a/make/sun/security/pkcs11/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/security/pkcs11/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -157,10 +157,10 @@
 #
 # Libraries to link
 #
-ifneq (,$(findstring $(PLATFORM), windows bsd))
+ifneq ($(PLATFORM), windows)
   OTHER_LDLIBS = $(JVMLIB)
 else
-  OTHER_LDLIBS = -ldl $(JVMLIB)
+  OTHER_LDLIBS = $(LIBDL) $(JVMLIB)
 endif
 
 # Other config files
--- a/make/sun/security/smartcardio/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/security/smartcardio/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -76,10 +76,6 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS = $(JVMLIB) winscard.lib
 else
-  ifeq ($(PLATFORM), bsd)
-    OTHER_LDLIBS = $(JVMLIB)
-  else
-    OTHER_LDLIBS = -ldl $(JVMLIB)
-  endif
+  OTHER_LDLIBS = $(LIBDL) $(JVMLIB)
   OTHER_CFLAGS = -D__sun_jdk
 endif
--- a/make/sun/tracing/dtrace/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/sun/tracing/dtrace/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -56,7 +56,7 @@
 FILES_export = $(FILES_java)
 
 ifeq ($(PLATFORM), linux)
-OTHER_LDLIBS += -ldl
+OTHER_LDLIBS += $(LIBDL)
 endif
 
 #
--- a/make/tools/reorder/Makefile	Tue Aug 03 05:28:51 2010 -0700
+++ b/make/tools/reorder/Makefile	Fri Aug 06 21:56:03 2010 -0700
@@ -187,11 +187,11 @@
 
 # This library 'libmcount.so' also used by hotspot reordering.
 $(OBJDIR)/libmcount.so : $(MCOUNT_OBJ)
-	$(CC) -G -mt -zdefs -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
+	$(CC) -G -mt -zdefs -o $@ $^ $(LIBDL) -lelf $(EXTRA_LIBS)
 
 # This library 'libmcount.so' also used by hotspot reordering.
 $(OBJDIR)/remove_mcount : remove_mcount.c
-	$(CC) -g -o $@ $^ -ldl -lelf $(EXTRA_LIBS)
+	$(CC) -g -o $@ $^ $(LIBDL) -lelf $(EXTRA_LIBS)
 
 
 # Reorder libraries.