Author: mgorny
Date: Thu Feb 21 12:28:21 2019
New Revision: 354617

URL: http://llvm.org/viewvc/llvm-project?rev=354617&view=rev
Log:
[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

Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
    lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile?rev=354617&r1=354616&r2=354617&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile 
Thu Feb 21 12:28:21 2019
@@ -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
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile?rev=354617&r1=354616&r2=354617&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
 Thu Feb 21 12:28:21 2019
@@ -1,7 +1,7 @@
 LEVEL := ../../make
 
 CXX_SOURCES := main.cpp
-LD_EXTRAS := -ldl
+USE_LIBDL := 1
 
 include $(LEVEL)/Makefile.rules
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=354617&r1=354616&r2=354617&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Thu Feb 21 
12:28:21 2019
@@ -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))" ""


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to