From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 13A79469710 for ; Tue, 26 May 2020 18:18:12 +0300 (MSK) Received: by mail-lj1-f170.google.com with SMTP id z6so24937542ljm.13 for ; Tue, 26 May 2020 08:18:12 -0700 (PDT) From: HustonMmmavr Date: Tue, 26 May 2020 18:17:47 +0300 Message-Id: <20200526151747.93659-1-huston.mavr@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] static build: fix build on ubuntu List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, alexander.turenko@tarantool.org Fixed static build with '-DBUILD_STATIC=ON' option: * Added cmake option CMAKE_DL_LIBS to icu library for test/unit tests binaries builds at file: cmake/FindICU.cmake due to fail: [ 84%] Linking CXX executable vy_point_lookup.test /usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dl_open_62': putil.cpp:(.text+0x1a22): undefined reference to `dlopen' /usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dlsym_func_62': putil.cpp:(.text+0x1a7d): undefined reference to `dlsym' /usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dl_close_62': putil.cpp:(.text+0x1a61): undefined reference to `dlclose' collect2: error: ld returned 1 exit status * Added cmake option CMAKE_DL_LIBS to gomp library for test/unit tests binaries builds at file: cmake/BuildMisc.cmake due to fail: [ 91%] Linking CXX executable bps_tree.test /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.a(target.o): In function `gomp_target_init': (.text+0x8b): undefined reference to `dlopen' (.text+0xa2): undefined reference to `dlsym' (.text+0xd9): undefined reference to `dlclose' (.text+0x29b): undefined reference to `dlsym' (.text+0x2a8): undefined reference to `dlerror' (.text+0x2d0): undefined reference to `dlsym' (.text+0x2e9): undefined reference to `dlsym' (.text+0x300): undefined reference to `dlsym' (.text+0x317): undefined reference to `dlsym' (.text+0x330): undefined reference to `dlsym' /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.a(target.o):(.text+0x34d): more undefined references to `dlsym' follow /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.a(target.o): In function `gomp_target_init': (.text+0x9cc): undefined reference to `dlerror' collect2: error: ld returned 1 exit status Close #5024 --- Issue: https://github.com/tarantool/tarantool/issues/5024 Branch: https://github.com/tarantool/tarantool/tree/HustonMmmavr/gh-5024-static-build-ubuntu cmake/BuildMisc.cmake | 2 +- cmake/FindICU.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/BuildMisc.cmake b/cmake/BuildMisc.cmake index b4a3ca1fc..7b11acb11 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) + target_link_libraries(misc ${GOMP_LIBRARY} pthread ${CMAKE_DL_LIBS}) endif() unset(misc_src) diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake index 26f0683f3..5bad41c70 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}) +set(ICU_LIBRARIES ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_UC} ${ICU_LIBRARY_DATA} ${CMAKE_DL_LIBS}) mark_as_advanced(ICU_INCLUDE_DIR ICU_INCLUDE_DIRS ICU_LIBRARY_I18N ICU_LIBRARY_UC ICU_LIBRARIES) -- 2.26.2