提交 84574c3d 编写于 作者: M martin

6960394: Stop linking with -lnsl on Linux

Summary: Define LIBNSL (like LIBSOCKET), non-empty only on Solaris
Reviewed-by: ohair
上级 1714ddb6
...@@ -311,6 +311,7 @@ override LIBCXX = -lstdc++ ...@@ -311,6 +311,7 @@ override LIBCXX = -lstdc++
endif endif
override LIBPOSIX4 = override LIBPOSIX4 =
override LIBSOCKET = override LIBSOCKET =
override LIBNSL =
override LIBTHREAD = override LIBTHREAD =
override MOOT_PRIORITIES = true override MOOT_PRIORITIES = true
override NO_INTERRUPTIBLE_IO = true override NO_INTERRUPTIBLE_IO = true
......
...@@ -658,6 +658,9 @@ LIBM = /usr/lib$(ISA_DIR)/libm.so.1 ...@@ -658,6 +658,9 @@ LIBM = /usr/lib$(ISA_DIR)/libm.so.1
# Socket library # Socket library
LIBSOCKET = -lsocket LIBSOCKET = -lsocket
# Network Services library
LIBNSL = -lnsl
# GLOBAL_KPIC: If set means all libraries are PIC, position independent code # GLOBAL_KPIC: If set means all libraries are PIC, position independent code
# EXCEPT for select compiles # EXCEPT for select compiles
# If a .o file is compiled non-PIC then it should be forced # If a .o file is compiled non-PIC then it should be forced
......
...@@ -86,5 +86,5 @@ endif ...@@ -86,5 +86,5 @@ endif
# Things that must be linked in. # Things that must be linked in.
# #
ifneq ($(PLATFORM), windows) ifneq ($(PLATFORM), windows)
OTHER_LDLIBS += $(LIBSOCKET) -lnsl $(LIBM) -ldl OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBM) -ldl
endif endif
...@@ -204,7 +204,7 @@ ifeq ($(PLATFORM),windows) ...@@ -204,7 +204,7 @@ ifeq ($(PLATFORM),windows)
OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \ OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
-libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
else else
OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) -lnsl -ldl \ OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH) -L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
endif endif
......
...@@ -84,7 +84,7 @@ OTHER_INCLUDES = -I$(SRCDIR) \ ...@@ -84,7 +84,7 @@ OTHER_INCLUDES = -I$(SRCDIR) \
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
OTHER_LDLIBS += wsock32.lib winmm.lib OTHER_LDLIBS += wsock32.lib winmm.lib
else else
OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
endif endif
# #
......
...@@ -96,7 +96,7 @@ include $(BUILDDIR)/common/Library.gmk ...@@ -96,7 +96,7 @@ include $(BUILDDIR)/common/Library.gmk
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
OTHER_LDLIBS = ws2_32.lib $(JVMLIB) OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
else else
OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB) OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
OTHER_LDLIBS += -lpthread OTHER_LDLIBS += -lpthread
......
...@@ -38,11 +38,11 @@ FILES_m = mapfile-vers ...@@ -38,11 +38,11 @@ FILES_m = mapfile-vers
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread
endif endif
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
OTHER_LDLIBS += -lnsl $(LIBSOCKET) OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET)
endif endif
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
......
...@@ -39,10 +39,10 @@ ifeq ($(PLATFORM), windows) ...@@ -39,10 +39,10 @@ ifeq ($(PLATFORM), windows)
EXTRA_LIBS += wsock32.lib winmm.lib EXTRA_LIBS += wsock32.lib winmm.lib
endif endif
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
endif endif
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl -lpthread OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -lpthread
endif endif
# #
......
...@@ -132,7 +132,7 @@ ifeq ($(OSNAME), linux) ...@@ -132,7 +132,7 @@ ifeq ($(OSNAME), linux)
LIBRARY=lib$(LIBNAME).so LIBRARY=lib$(LIBNAME).so
LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
# Libraries we are dependent on # Libraries we are dependent on
LIBRARIES= -lnsl -ldl -lc LIBRARIES= -ldl -lc
# Building a shared library # Building a shared library
LINK_SHARED=$(LINK.c) -shared -o $@ LINK_SHARED=$(LINK.c) -shared -o $@
endif endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册