Skip to content
Snippets Groups Projects
Commit 65ebfaf0 authored by Michal Gorny's avatar Michal Gorny
Browse files

[lldb] [test] Do not link -ldl on NetBSD

Fix the load_* using test Makefiles not to link -ldl on NetBSD.
There is no such a library on NetBSD, and dlopen() is available
without a library.  Quoting the manpage:

    (These functions are not in a library.  They are included in every
    dynamically linked program automatically.)

To resolve this portably, introduce a new USE_LIBDL option.  If it set
to 1, Makefile.rules automatically appends -ldl on platforms needing it.

Differential Revision: https://reviews.llvm.org/D58517

llvm-svn: 354617
parent 1abe05c0
No related branches found
No related tags found
No related merge requests found
...@@ -2,8 +2,9 @@ LEVEL := ../../make ...@@ -2,8 +2,9 @@ LEVEL := ../../make
LIB_PREFIX := loadunload_ LIB_PREFIX := loadunload_
LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl LD_EXTRAS := -L. -l$(LIB_PREFIX)d
CXX_SOURCES := main.cpp CXX_SOURCES := main.cpp
USE_LIBDL := 1
include $(LEVEL)/Makefile.rules include $(LEVEL)/Makefile.rules
......
LEVEL := ../../make LEVEL := ../../make
CXX_SOURCES := main.cpp CXX_SOURCES := main.cpp
LD_EXTRAS := -ldl USE_LIBDL := 1
include $(LEVEL)/Makefile.rules include $(LEVEL)/Makefile.rules
......
...@@ -414,6 +414,15 @@ ifeq (1,$(USE_LIBCPP)) ...@@ -414,6 +414,15 @@ ifeq (1,$(USE_LIBCPP))
endif endif
endif endif
#----------------------------------------------------------------------
# Additional system libraries
#----------------------------------------------------------------------
ifeq (1,$(USE_LIBDL))
ifneq ($(OS),NetBSD)
LDFLAGS += -ldl
endif
endif
#---------------------------------------------------------------------- #----------------------------------------------------------------------
# dylib settings # dylib settings
#---------------------------------------------------------------------- #----------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment