Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/files/7.0.1/, sys-devel/clang/
Date: Thu, 03 Jan 2019 18:37:26
Message-Id: 1546540632.1393d91fc66fd5afad091e408fbadf5bab514678.mgorny@gentoo
1 commit: 1393d91fc66fd5afad091e408fbadf5bab514678
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 3 18:36:29 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 3 18:37:12 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1393d91f
7
8 sys-devel/clang: Backport atomic detection fix
9
10 Closes: https://bugs.gentoo.org/667016
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 sys-devel/clang/clang-7.0.1.ebuild | 4 +++
14 ...x-detecting-atomics-in-stand-alone-builds.patch | 38 ++++++++++++++++++++++
15 2 files changed, 42 insertions(+)
16
17 diff --git a/sys-devel/clang/clang-7.0.1.ebuild b/sys-devel/clang/clang-7.0.1.ebuild
18 index 628a17f3f48..e48ada0998b 100644
19 --- a/sys-devel/clang/clang-7.0.1.ebuild
20 +++ b/sys-devel/clang/clang-7.0.1.ebuild
21 @@ -71,6 +71,10 @@ CMAKE_BUILD_TYPE=RelWithDebInfo
22 PATCHES=(
23 # add Prefix include paths for Darwin
24 "${FILESDIR}"/6.0.1/darwin_prefix-include-paths.patch
25 +
26 + # fix detecting atomics library in clangd
27 + # https://bugs.gentoo.org/667016
28 + "${FILESDIR}"/7.0.1/0001-clangd-Fix-detecting-atomics-in-stand-alone-builds.patch
29 )
30
31 # Multilib notes:
32
33 diff --git a/sys-devel/clang/files/7.0.1/0001-clangd-Fix-detecting-atomics-in-stand-alone-builds.patch b/sys-devel/clang/files/7.0.1/0001-clangd-Fix-detecting-atomics-in-stand-alone-builds.patch
34 new file mode 100644
35 index 00000000000..151c2b5e8e8
36 --- /dev/null
37 +++ b/sys-devel/clang/files/7.0.1/0001-clangd-Fix-detecting-atomics-in-stand-alone-builds.patch
38 @@ -0,0 +1,38 @@
39 +From 74aa5bb20b3d8e1ed2b590053fdd665e9dde8462 Mon Sep 17 00:00:00 2001
40 +From: Michal Gorny <mgorny@g.o>
41 +Date: Thu, 3 Jan 2019 16:43:27 +0000
42 +Subject: [PATCH] [clangd] Fix detecting atomics in stand-alone builds
43 +
44 +Include CheckAtomic CMake module from LLVM in order to detect support
45 +for atomics when building stand-alone. Otherwise,
46 +the HAVE_CXX_ATOMICS64_WITHOUT_LIB variable is undefined and clangd
47 +wrongly attempts to link -latomic on systems not using the library.
48 +
49 +Original bug report: https://bugs.gentoo.org/667016
50 +
51 +Differential Revision: https://reviews.llvm.org/D56061
52 +
53 +git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@350329 91177308-0d34-0410-b5e6-96231b3b80d8
54 +---
55 + clangd/CMakeLists.txt | 5 +++++
56 + 1 file changed, 5 insertions(+)
57 +
58 +diff --git a/clangd/CMakeLists.txt b/clangd/CMakeLists.txt
59 +index 39467bd5..251ee7fc 100644
60 +--- a/tools/extra/clangd/CMakeLists.txt
61 ++++ b/tools/extra/clangd/CMakeLists.txt
62 +@@ -2,6 +2,11 @@ set(LLVM_LINK_COMPONENTS
63 + Support
64 + )
65 +
66 ++if(CLANG_BUILT_STANDALONE)
67 ++ # needed to get HAVE_CXX_ATOMICS64_WITHOUT_LIB defined
68 ++ include(CheckAtomic)
69 ++endif()
70 ++
71 + set(CLANGD_ATOMIC_LIB "")
72 + if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
73 + list(APPEND CLANGD_ATOMIC_LIB "atomic")
74 +--
75 +2.20.1
76 +