Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org
Cc: o.piskunov@tarantool.org
Subject: [Tarantool-patches] [PATCH 03/11] build: skip linking with -ldl on OpenBSD
Date: Tue, 12 May 2020 15:32:18 +0300	[thread overview]
Message-ID: <abcd8aca10c6aab86dbdaa530ec98d86b16096d9.1589284160.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1589284160.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

OpenBSD includes DL library in a base system

Part of #4967
---
 cmake/BuildMisc.cmake    |  2 +-
 cmake/FindCURL.cmake     |  2 +-
 cmake/FindICU.cmake      |  2 +-
 src/CMakeLists.txt       |  8 +++++---
 test/unit/CMakeLists.txt | 16 ++++++++++------
 5 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/cmake/BuildMisc.cmake b/cmake/BuildMisc.cmake
index 0c571f326..b4a3ca1fc 100644
--- a/cmake/BuildMisc.cmake
+++ b/cmake/BuildMisc.cmake
@@ -39,7 +39,7 @@ macro(libmisc_build)
         else()
             set(GOMP_LIBRARY gomp)
         endif()
-        target_link_libraries(misc ${GOMP_LIBRARY} pthread dl)
+        target_link_libraries(misc ${GOMP_LIBRARY} pthread)
     endif()
 
     unset(misc_src)
diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake
index 6193a58ad..fa20717aa 100644
--- a/cmake/FindCURL.cmake
+++ b/cmake/FindCURL.cmake
@@ -35,7 +35,7 @@ set(DL_LIB_NAME dl)
 find_library(Z_LIBRARY NAMES ${Z_LIB_NAME})
 find_library(NGHTTP2_LIBRARY NAMES ${NGHTTP2_LIB_NAME})
 find_library(PTHREAD_LIBRARY NAMES ${PTHREAD_LIB_NAME})
-find_library(DL_LIBRARY NAMES ${DL_LIB_NAME})
+#find_library(DL_LIBRARY NAMES ${DL_LIB_NAME})
 
 if(DEFINED CURL_ROOT)
     set(CURL_FIND_OPTS NO_CMAKE NO_CMAKE_SYSTEM_PATH)
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake
index 2bb9a5d59..26f0683f3 100644
--- a/cmake/FindICU.cmake
+++ b/cmake/FindICU.cmake
@@ -50,7 +50,7 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ICU
     REQUIRED_VARS ICU_INCLUDE_DIR ICU_LIBRARY_I18N ICU_LIBRARY_UC)
 set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
-set(ICU_LIBRARIES ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_UC} ${ICU_LIBRARY_DATA} dl)
+set(ICU_LIBRARIES ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_UC} ${ICU_LIBRARY_DATA})
 mark_as_advanced(ICU_INCLUDE_DIR ICU_INCLUDE_DIRS
         ICU_LIBRARY_I18N ICU_LIBRARY_UC ICU_LIBRARIES)
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2b5ea1b87..79a1b45cc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -71,9 +71,11 @@ set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${lua_sources})
 #
 # Always links pthread and dl dynamically.
 set(generic_libraries pthread)
-find_library(DL_LIBRARY NAMES dl)
-if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
-    set(generic_libraries ${generic_libraries} dl)
+if(NOT TARGET_OS_OPENBSD)
+    find_library(DL_LIBRARY NAMES dl)
+    if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
+        set(generic_libraries ${generic_libraries} dl)
+    endif()
 endif()
 
 add_library(stat STATIC rmean.c latency.c histogram.c)
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 84eb066bd..3bdfc6bb1 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -5,6 +5,10 @@ endif()
 file(GLOB all_sources *.c *.cc)
 set_source_files_compile_flags(${all_sources})
 
+if(NOT TARGET_OS_OPENBSD)
+    set(LIB_DL "dl")
+endif()
+
 include_directories(${PROJECT_SOURCE_DIR}/src)
 include_directories(${PROJECT_BINARY_DIR}/src)
 include_directories(${PROJECT_SOURCE_DIR}/src/box)
@@ -161,7 +165,7 @@ target_link_libraries(luaT_tuple_new.test unit box server core misc
 add_executable(luaL_iterator.test luaL_iterator.c)
 target_link_libraries(luaL_iterator.test unit server coll core misc
     ${CURL_LIBRARIES} ${LIBYAML_LIBRARIES} ${READLINE_LIBRARIES}
-    ${ICU_LIBRARIES} ${LUAJIT_LIBRARIES} dl)
+    ${ICU_LIBRARIES} ${LUAJIT_LIBRARIES} ${LIB_DL})
 
 add_executable(say.test say.c)
 target_link_libraries(say.test core unit)
@@ -176,7 +180,7 @@ set(ITERATOR_TEST_SOURCES
 set(ITERATOR_TEST_LIBS core tuple xrow unit)
 
 add_executable(vy_mem.test vy_mem.c ${ITERATOR_TEST_SOURCES})
-target_link_libraries(vy_mem.test ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_mem.test ${ITERATOR_TEST_LIBS} ${LIB_DL})
 
 add_executable(vy_point_lookup.test
     vy_point_lookup.c
@@ -198,7 +202,7 @@ add_executable(vy_point_lookup.test
     ${PROJECT_SOURCE_DIR}/src/box/schema_def.c
     ${PROJECT_SOURCE_DIR}/src/box/identifier.c
 )
-target_link_libraries(vy_point_lookup.test core tuple xrow xlog unit dl)
+target_link_libraries(vy_point_lookup.test core tuple xrow xlog unit ${LIB_DL})
 
 add_executable(column_mask.test
     column_mask.c)
@@ -211,13 +215,13 @@ add_executable(vy_write_iterator.test
     ${PROJECT_SOURCE_DIR}/src/box/vy_write_iterator.c
     ${ITERATOR_TEST_SOURCES}
 )
-target_link_libraries(vy_write_iterator.test xlog ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_write_iterator.test xlog ${ITERATOR_TEST_LIBS} ${LIB_DL})
 
 add_executable(vy_cache.test vy_cache.c ${ITERATOR_TEST_SOURCES})
-target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS} ${LIB_DL})
 
 add_executable(coll.test coll.cpp)
-target_link_libraries(coll.test coll unit misc dl)
+target_link_libraries(coll.test coll unit misc ${LIB_DL})
 
 add_executable(tuple_bigref.test tuple_bigref.c)
 target_link_libraries(tuple_bigref.test tuple unit)
-- 
2.23.0

  parent reply	other threads:[~2020-05-12 12:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 01/11] build: introduce openbsd build target sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 02/11] build: test pthread_stackseg_np() on OpenBSD sergeyb
2020-05-12 12:32 ` sergeyb [this message]
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 04/11] Fix building of tt_pthread_attr_getstack() " sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 05/11] sql: use mremap() " sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 06/11] Include libgen.h when building " sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 07/11] say: fix compilation " sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 08/11] test: mute broken tests " sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 09/11] Add README.OpenBSD sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 10/11] Mention OpenBSD as supported platorm sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 11/11][small] Add MAP_STACK to mmap() flags sergeyb
2020-05-18 18:22 ` [Tarantool-patches] [PATCH 00/11] Add OpenBSD support Cyrill Gorcunov
2020-05-20  6:41 ` Kirill Yukhin
2020-05-20 12:23   ` Sergey Bronnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abcd8aca10c6aab86dbdaa530ec98d86b16096d9.1589284160.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=o.piskunov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 03/11] build: skip linking with -ldl on OpenBSD' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox