--- ./openjdk/jdk/make/common/Defs-linux.gmk.orig
+++ ./openjdk/jdk/make/common/Defs-linux.gmk
@@ -248,7 +248,9 @@
 #
 LDFLAGS_OPT     = -Xlinker -O1
 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
+ifdef LIBRARY
 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
+endif
 
 #
 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always