From a4a00d16198fe57897b4304bc186e4af198246c1 Mon Sep 17 00:00:00 2001
From: Ilya Verbin <iverbin@tarantool.org>
Date: Fri, 16 Jun 2023 19:01:12 +0300
Subject: [PATCH] build: remove dependencies on libgomp

OpenMP is no longer used since commit 4f617b702f0f ("box: introduce
memtx_sort_threads config parameter"). All dependencies on libgomp
should be removed.

Follow-up #7689

NO_DOC=build
NO_TEST=build
---
 apk/APKBUILD                                             | 2 +-
 .../unreleased/gh-7689-remove-dependencies-on-libgomp.md | 3 +++
 cmake/BuildMisc.cmake                                    | 9 ---------
 debian/control                                           | 2 +-
 4 files changed, 5 insertions(+), 11 deletions(-)
 create mode 100644 changelogs/unreleased/gh-7689-remove-dependencies-on-libgomp.md

diff --git a/apk/APKBUILD b/apk/APKBUILD
index b6dd5b32e3..8a020c54b4 100644
--- a/apk/APKBUILD
+++ b/apk/APKBUILD
@@ -8,7 +8,7 @@ arch="all"
 source=""
 giturl="https://github.com/tarantool/tarantool.git"
 url="https://github.com/tarantool/tarantool"
-depends="g++ libstdc++ readline openssl yaml lz4 binutils ncurses libgomp lua tar zip zlib libunwind icu ca-certificates"
+depends="g++ libstdc++ readline openssl yaml lz4 binutils ncurses lua tar zip zlib libunwind icu ca-certificates"
 makedepends="gcc cmake file readline-dev openssl-dev yaml-dev bsd-compat-headers lz4-dev zlib-dev binutils-dev ncurses-dev lua-dev musl-dev make git libunwind-dev autoconf automake libtool linux-headers icu-dev"
 
 subpackages="$pkgname-dev $pkgname-dbg $pkgname-doc"
diff --git a/changelogs/unreleased/gh-7689-remove-dependencies-on-libgomp.md b/changelogs/unreleased/gh-7689-remove-dependencies-on-libgomp.md
new file mode 100644
index 0000000000..3e80233fe0
--- /dev/null
+++ b/changelogs/unreleased/gh-7689-remove-dependencies-on-libgomp.md
@@ -0,0 +1,3 @@
+## feature/build
+
+* Tarantool does not depend on libgomp anymore (gh-7689).
diff --git a/cmake/BuildMisc.cmake b/cmake/BuildMisc.cmake
index e6905204de..e2e921c9ff 100644
--- a/cmake/BuildMisc.cmake
+++ b/cmake/BuildMisc.cmake
@@ -28,14 +28,5 @@ macro(libmisc_build)
     add_library(misc STATIC ${misc_src})
     set_target_properties(misc PROPERTIES COMPILE_FLAGS "${DEPENDENCY_CFLAGS}")
 
-    if (HAVE_OPENMP)
-        if(BUILD_STATIC)
-            set(GOMP_LIBRARY libgomp.a)
-        else()
-            set(GOMP_LIBRARY gomp)
-        endif()
-        target_link_libraries(misc ${GOMP_LIBRARY} pthread ${CMAKE_DL_LIBS})
-    endif()
-
     unset(misc_src)
 endmacro(libmisc_build)
diff --git a/debian/control b/debian/control
index cad7071a36..06d8330f1a 100644
--- a/debian/control
+++ b/debian/control
@@ -72,7 +72,7 @@ Description: Tarantool in-memory database - common files
 Package: tarantool
 Architecture: i386 amd64 armhf arm64
 Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}, netbase, libgomp1,
+Depends: ${shlibs:Depends}, ${misc:Depends}, netbase,
   openssl, tarantool-common (>= 2.2.1), tzdata,
 # libcurl dependencies (except ones we have already)
  zlib1g
-- 
GitLab