File: link-libatomic-check-gcc.patch

package info (click to toggle)
clasp 3.3.5-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,716 kB
  • sloc: cpp: 69,712; ansic: 207; xml: 182; sh: 92; makefile: 28
file content (28 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Thomas Krennwallner <tkren@kr.tuwien.ac.at>
Date: Fri, 13 Mar 2020 06:15:35 -0400
Subject: check for libatomic when compiling with gcc

Last-Update: 2020-03-13
Forwarded: no

clasp requires c++11 threads with 64bit __atomic_exchange, we need to
link with libatomic on armel, powerpc, powerpcspe, m68k, mips, mipsel,
and sh4, see also https://gcc.gnu.org/wiki/Atomic and
https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac53787..4195551 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ if (CLASP_BUILD_WITH_THREADS)
 	find_package(Threads REQUIRED)
 
 	# Add libatomic if necessary
-	if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_USE_PTHREADS_INIT)
+	if (CMAKE_USE_PTHREADS_INIT)
 		include (CheckCXXSourceCompiles)
 		set (OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
 		set (OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})