From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3C1922A1C2 for ; Mon, 10 Sep 2018 03:05:04 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rlg3yTael5tn for ; Mon, 10 Sep 2018 03:05:04 -0400 (EDT) Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id F148D2A1BE for ; Mon, 10 Sep 2018 03:05:03 -0400 (EDT) Date: Mon, 10 Sep 2018 10:05:01 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] Fix libgomp linking for static build Message-ID: <20180910070501.ngpvgefyh5cwwgaf@tarantool.org> References: <20180906175907.dom562rutbpalfnl@tarantool.org> <672863676de78877643103e1b57820578eb21fa6.1536312243.git.kyukhin@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <672863676de78877643103e1b57820578eb21fa6.1536312243.git.kyukhin@tarantool.org> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: alexander.turenko@tarantool.org Cc: tarantool-patches@freelists.org Hello, On 07 сен 12:17, Kirill Yukhin wrote: > Since addition of -fopenmp to compiler also means > addition of -lgomp to the link stage, pass -fno-openmp > to the linking stage in case of static build. In that > case OMP functions are statically linked into libmisc. > > Also, emit error if trying to perform static build using > clang. > --- > Branch: https://github.com/tarantool/tarantool/commits/kyukhin/gh-xxxx-fix-gomp-in-static-build > Issue: n/a I've checked in updated patch into 1.10 branch. As per review, iteratove patch below was applied. -- Regards, Kirill Yukhin 2 files changed, 7 insertions(+), 7 deletions(-) cmake/compiler.cmake | 12 ++++++------ src/CMakeLists.txt | 2 +- modified cmake/compiler.cmake @@ -25,17 +25,17 @@ endif() if (CMAKE_COMPILER_IS_GNUCC) # cmake 2.8.9 and earlier doesn't support CMAKE_CXX_COMPILER_VERSION if (NOT CMAKE_CXX_COMPILER_VERSION) - execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion - OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion + OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) endif() if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5) - message(FATAL_ERROR " - Your GCC version is ${CMAKE_CXX_COMPILER_VERSION}, please update - ") + message(FATAL_ERROR " + Your GCC version is ${CMAKE_CXX_COMPILER_VERSION}, please update + ") endif() else() if (BUILD_STATIC) - message(FATAL_ERROR "Static build is supported for GCC only") + message(FATAL_ERROR "Static build is supported for GCC only") endif() endif() modified src/CMakeLists.txt @@ -283,7 +283,7 @@ if(BUILD_STATIC) # against DSO version of libgomp, which implied by -fopenmp set (common_libraries ${common_libraries} "libgomp.a") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-openmp") - endif () + endif() endif()