[tarantool-patches] Re: [PATCH] Fix libgomp linking for static build
Kirill Yukhin
kyukhin at tarantool.org
Mon Sep 10 10:05:01 MSK 2018
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()
More information about the Tarantool-patches
mailing list