diff options
author | Michal Gorny <mgorny@gentoo.org> | 2019-02-21 20:28:21 +0000 |
---|---|---|
committer | Michal Gorny <mgorny@gentoo.org> | 2019-02-21 20:28:21 +0000 |
commit | 65ebfaf0bee85a563b3f88da9ba1108cc3b032fd (patch) | |
tree | 0affaf981f7b53e706a26d7afe0e36b57382c993 /lldb/packages/Python/lldbsuite/test | |
parent | 1abe05c0dd2c27f7fe9d1554816c5b239153662c (diff) | |
download | bcm5719-llvm-65ebfaf0bee85a563b3f88da9ba1108cc3b032fd.tar.gz bcm5719-llvm-65ebfaf0bee85a563b3f88da9ba1108cc3b032fd.zip |
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
3 files changed, 12 insertions, 2 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile index 0dd9eb41a40..6574478c8f4 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile +++ b/lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile @@ -2,8 +2,9 @@ LEVEL := ../../make LIB_PREFIX := loadunload_ -LD_EXTRAS := -L. -l$(LIB_PREFIX)d -ldl +LD_EXTRAS := -L. -l$(LIB_PREFIX)d CXX_SOURCES := main.cpp +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile b/lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile index c4c3cfe3c18..0b7e6687030 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile +++ b/lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile @@ -1,7 +1,7 @@ LEVEL := ../../make CXX_SOURCES := main.cpp -LD_EXTRAS := -ldl +USE_LIBDL := 1 include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 6d1ca51d0f3..378f5af3c5f 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -415,6 +415,15 @@ ifeq (1,$(USE_LIBCPP)) endif #---------------------------------------------------------------------- +# Additional system libraries +#---------------------------------------------------------------------- +ifeq (1,$(USE_LIBDL)) + ifneq ($(OS),NetBSD) + LDFLAGS += -ldl + endif +endif + +#---------------------------------------------------------------------- # dylib settings #---------------------------------------------------------------------- ifneq "$(strip $(DYLIB_C_SOURCES))" "" |