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/4.0.0/, sys-devel/clang/, ...
Date: Mon, 06 Mar 2017 22:18:49
Message-Id: 1488838695.4a73d12677b93bcdf102699a5f9a1b375df28fda.mgorny@gentoo
1 commit: 4a73d12677b93bcdf102699a5f9a1b375df28fda
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 6 19:08:21 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 6 22:18:15 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a73d126
7
8 sys-devel/clang: Bump to 4.0.0rc3, fix extra tool tests
9
10 sys-devel/clang/Manifest | 6 +-
11 ...ang-4.0.0_rc2.ebuild => clang-4.0.0_rc3.ebuild} | 11 ++-
12 ...rrect-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch | 87 ++++++++++++++++++++++
13 ...st-dependencies-when-using-installed-tool.patch | 48 ++++++++++++
14 ...ang-library-dir-in-LD_LIBRARY_PATH-For-st.patch | 83 +++++++++++++++++++++
15 5 files changed, 230 insertions(+), 5 deletions(-)
16
17 diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
18 index 1f2b36a057c..f329143463c 100644
19 --- a/sys-devel/clang/Manifest
20 +++ b/sys-devel/clang/Manifest
21 @@ -1,3 +1,3 @@
22 -DIST cfe-4.0.0rc2.src.tar.xz 10898628 SHA256 76d6c9b7f388a93a0303dbbac0e42b183b242f822b65eb44064679e7c36aa5dc SHA512 d1015c636a77233bf8c7df28ad71c734cf4755ca5564d4de1fb2574ffb942dfb69e528316e94da54397383a9dca558b0474bd4c599086e8c63abd3de1ce2bb94 WHIRLPOOL 72e76dd862b209dcc18d232b2d723ea19c9aafd1c8ab2db5e23985aaabe382782d598ec6fd58f8209a6b579c35caa1050330474b112ecb32ac5d4eac53e3373d
23 -DIST clang-tools-extra-4.0.0rc2.src.tar.xz 583208 SHA256 1f682bd28714cf95b3e5fa6e638276973442fed349acd8a38a08f15bca9efb7a SHA512 90b1d025c5aed9ebeb9d0c73e18f7734f151cd8637be5f9fd70a14953a73df134baa192ef76d049ac04b121cf2e32cecce311d145e275cd33fc1e7ebf999aad3 WHIRLPOOL 19cf25f96ddc486470cc5d85a28c8abae32ecc50e76e18c936aa2145922d3c075ffa0a105a02422cb59cb91aead5e8b962778b344de926b4089647e9c96544f5
24 -DIST llvm-4.0.0rc2.src.tar.xz 21005416 SHA256 2257faed3795fedfc509d6dd5905be158231c508c6fcaaa02e4a09c5e8dadbe1 SHA512 537356226123b8c9454ec3dfc3adbfb13cfa4bd35f530b85f2b3242391ea1fbd9abf65dfbb62db533e6eae4c9049bb260fb21dccfeb7e355306f4621d35474b7 WHIRLPOOL d79f343ca00c60dd49a3ada4808e779c45210ab03e365e614563b54879ac72b7e80b4022641db10ad2075a0d417ba7c182f9d3abf8c6b012622c0d1541a7dc69
25 +DIST cfe-4.0.0rc3.src.tar.xz 10901068 SHA256 974f47d91d97cebadceb33f7a966d1c158f57ffd012a300fd3d96f817ef64dd3 SHA512 6427c90516c80d4ce83861ae2eb22635f38818e4f35441292375b4867abb82c48371ddf0afe9daec3b96f5f5ee1b5eced0e246eb878ef703454b92e6e2f62541 WHIRLPOOL 0608db76025fb81fc5db4e68c5b1c92dda4f82d7cf1518a38ec35cf40d4990314117b7ece0aa2e37badbfa964ba5c9b08664534bec5839cf3d1c965ac672dd30
26 +DIST clang-tools-extra-4.0.0rc3.src.tar.xz 583064 SHA256 08cf8e27775617f703983fa641be89538bbd7f9da0b53c4aa8bbb8c10f282cb1 SHA512 c6699cee2a4cbc7487bcf76092756939dd39a2c6de6b86e946e63f146c83af727bab0c3d5d148c5d437dea87bec25acc3db8c0c00f048187a6029b10725757e3 WHIRLPOOL 0fa3d18c099d1ff6710136dd0c7b598e230be09b5ec8dc6a8a157704eb3a0e124fe1dac5bbd6772fff52716bf5cec38c1f314cf96e71413c4f8c3d4c3d8188cf
27 +DIST llvm-4.0.0rc3.src.tar.xz 21013952 SHA256 6727c98f436581adc6b8f9c2ad055d8e27832f60a127e97b3451eba85ef28345 SHA512 a64eaf59388be6641b6d654ceddd63232f83ad50226204255a0c9bcc3d1b36470f7acbf43615b2bd9758cd6077f55fc6155803a12947e1bd2be5661e1ff07e4a WHIRLPOOL 7aef4913c8a33ff0e35670063cb26ddd5d7b72cb08c699116dd93c72f25b6b75187bdf6bfd63b3d3b5c964c118c2db71893024524b864412f4f8daa594be7faa
28
29 diff --git a/sys-devel/clang/clang-4.0.0_rc2.ebuild b/sys-devel/clang/clang-4.0.0_rc3.ebuild
30 similarity index 94%
31 rename from sys-devel/clang/clang-4.0.0_rc2.ebuild
32 rename to sys-devel/clang/clang-4.0.0_rc3.ebuild
33 index 25f3a68147e..7911a8235f0 100644
34 --- a/sys-devel/clang/clang-4.0.0_rc2.ebuild
35 +++ b/sys-devel/clang/clang-4.0.0_rc3.ebuild
36 @@ -126,8 +126,15 @@ src_prepare() {
37 # fix stand-alone doc build
38 eapply "${FILESDIR}"/9999/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
39
40 - # kill extraneous deps
41 - sed -i -e '/FileCheck/d' tools/extra/test/CMakeLists.txt || die
42 + # fix value of ATOMIC_*_LOCK_FREE
43 + # (backport, temporary reverted upstream because of FreeBSD issues)
44 + eapply "${FILESDIR}"/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
45 +
46 + cd tools/extra || die
47 + # fix stand-alone test build for extra tools
48 + eapply "${FILESDIR}"/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
49 + eapply "${FILESDIR}"/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
50 + cd - >/dev/null || die
51
52 # User patches
53 eapply_user
54
55 diff --git a/sys-devel/clang/files/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch b/sys-devel/clang/files/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
56 new file mode 100644
57 index 00000000000..f52d445eb05
58 --- /dev/null
59 +++ b/sys-devel/clang/files/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
60 @@ -0,0 +1,87 @@
61 +From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001
62 +From: Michal Gorny <mgorny@g.o>
63 +Date: Mon, 9 Jan 2017 20:54:20 +0000
64 +Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match
65 + builtin
66 +
67 +Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not
68 +to rely on the ABI alignment of types. Instead, just assume all those
69 +types are aligned correctly by default since clang uses safe alignment
70 +for _Atomic types even if the underlying types are aligned to a lower
71 +boundary by default.
72 +
73 +For example, the 'long long' and 'double' types on x86 are aligned to
74 +32-bit boundary by default. However, '_Atomic long long' and '_Atomic
75 +double' are aligned to 64-bit boundary, therefore satisfying
76 +the requirements of lock-free atomic operations.
77 +
78 +This fixes PR #19355 by correcting the value of
79 +__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing
80 +the assumption made in libc++ tests. This also fixes PR #30581 by
81 +applying a consistent logic between the functions used to implement
82 +both interfaces.
83 +
84 +Differential Revision: https://reviews.llvm.org/D28213
85 +
86 +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8
87 +---
88 + lib/Frontend/InitPreprocessor.cpp | 10 ++++------
89 + test/Sema/atomic-ops.c | 4 ----
90 + 2 files changed, 4 insertions(+), 10 deletions(-)
91 +
92 +diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
93 +index 17603ada11..4502c92499 100644
94 +--- a/lib/Frontend/InitPreprocessor.cpp
95 ++++ b/lib/Frontend/InitPreprocessor.cpp
96 +@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,
97 +
98 + /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with
99 + /// the specified properties.
100 +-static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,
101 +- unsigned InlineWidth) {
102 ++static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) {
103 + // Fully-aligned, power-of-2 sizes no larger than the inline
104 + // width will be inlined as lock-free operations.
105 +- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
106 +- TypeWidth <= InlineWidth)
107 ++ // Note: we do not need to check alignment since _Atomic(T) is always
108 ++ // appropriately-aligned in clang.
109 ++ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth)
110 + return "2"; // "always lock free"
111 + // We cannot be certain what operations the lib calls might be
112 + // able to implement as lock-free on future processors.
113 +@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
114 + #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \
115 + Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \
116 + getLockFreeValue(TI.get##Type##Width(), \
117 +- TI.get##Type##Align(), \
118 + InlineWidthBits));
119 + DEFINE_LOCK_FREE_MACRO(BOOL, Bool);
120 + DEFINE_LOCK_FREE_MACRO(CHAR, Char);
121 +@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
122 + DEFINE_LOCK_FREE_MACRO(LLONG, LongLong);
123 + Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
124 + getLockFreeValue(TI.getPointerWidth(0),
125 +- TI.getPointerAlign(0),
126 + InlineWidthBits));
127 + #undef DEFINE_LOCK_FREE_MACRO
128 + }
129 +diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c
130 +index 8ebf3eaed4..d3ebdf67db 100644
131 +--- a/test/Sema/atomic-ops.c
132 ++++ b/test/Sema/atomic-ops.c
133 +@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, "");
134 + _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
135 + _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
136 + _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
137 +-#ifdef __i386__
138 +-_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
139 +-#else
140 + _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");
141 +-#endif
142 + _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, "");
143 +
144 + _Static_assert(__c11_atomic_is_lock_free(1), "");
145 +--
146 +2.12.0
147 +
148
149 diff --git a/sys-devel/clang/files/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch b/sys-devel/clang/files/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
150 new file mode 100644
151 index 00000000000..3779bc62031
152 --- /dev/null
153 +++ b/sys-devel/clang/files/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
154 @@ -0,0 +1,48 @@
155 +From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001
156 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
157 +Date: Fri, 10 Feb 2017 22:44:53 +0100
158 +Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools
159 +
160 +Use the LLVM_UTILS_PROVIDED variable to determine whether test tool
161 +dependencies should be exposed for clang-tools-extra tests. If clang is
162 +being built stand-alone and LLVM test tools (FileCheck, count and not)
163 +are installed, the top-level CMakeLists.txt of clang sets this variable
164 +to indicate that they will not be built as a part of this build,
165 +and therefore no dependencies should be emitted for them. This fixes
166 +the dependency errors when building clang stand-alone with tests
167 +enabled.
168 +---
169 + test/CMakeLists.txt | 10 +++++++---
170 + 1 file changed, 7 insertions(+), 3 deletions(-)
171 +
172 +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
173 +index a852ef60..c26bd5c4 100644
174 +--- a/test/CMakeLists.txt
175 ++++ b/test/CMakeLists.txt
176 +@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG)
177 + endif()
178 +
179 + set(CLANG_TOOLS_TEST_DEPS
180 +- # Base line deps.
181 +- FileCheck count not
182 +-
183 + # clang-tidy tests require it.
184 + clang-headers
185 +
186 +@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS
187 + ExtraToolsUnitTests
188 + )
189 +
190 ++if(NOT LLVM_UTILS_PROVIDED)
191 ++ list(APPEND CLANG_TOOLS_TEST_DEPS
192 ++ # Base line deps.
193 ++ FileCheck count not
194 ++ )
195 ++endif()
196 ++
197 + add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
198 + ${CMAKE_CURRENT_BINARY_DIR}
199 + DEPENDS ${CLANG_TOOLS_TEST_DEPS}
200 +--
201 +2.12.0
202 +
203
204 diff --git a/sys-devel/clang/files/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch b/sys-devel/clang/files/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
205 new file mode 100644
206 index 00000000000..22f6d5685f3
207 --- /dev/null
208 +++ b/sys-devel/clang/files/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
209 @@ -0,0 +1,83 @@
210 +From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001
211 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
212 +Date: Sun, 19 Feb 2017 12:13:04 +0100
213 +Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For
214 + stand-alone build
215 +
216 +Prepend the clang library directory (determined using SHLIBDIR, alike
217 +in clang) to the LD_LIBRARY_PATH to ensure that just-built clang
218 +libraries will be used instead of a previous installed version.
219 +
220 +When a stand-alone build is performed, LLVM_LIBS_DIR contains the path
221 +to installed LLVM library directory. The same directory frequently
222 +contains a previously installed version of clang. SHLIBDIR, on the other
223 +hand, is always the build-tree directory, and therefore contains
224 +the freshly built clang libraries.
225 +
226 +In a non-stand-alone build, both paths will be the same and therefore
227 +including them both will not cause any issues.
228 +---
229 + test/Unit/lit.cfg | 9 ++++++---
230 + test/lit.cfg | 5 ++++-
231 + test/lit.site.cfg.in | 1 +
232 + 3 files changed, 11 insertions(+), 4 deletions(-)
233 +
234 +diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
235 +index ff70123c..3a1da187 100644
236 +--- a/test/Unit/lit.cfg
237 ++++ b/test/Unit/lit.cfg
238 +@@ -41,14 +41,17 @@ elif platform.system() == 'Windows':
239 + shlibpath_var = 'PATH'
240 +
241 + # Point the dynamic loader at dynamic libraries in 'lib'.
242 ++shlibdir = getattr(config, 'shlibdir', None)
243 ++if not shlibdir:
244 ++ lit_config.fatal('No shlibdir set!')
245 + llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
246 + if not llvm_libs_dir:
247 + lit_config.fatal('No LLVM libs dir set!')
248 +-shlibpath = os.path.pathsep.join((llvm_libs_dir,
249 ++shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir,
250 + config.environment.get(shlibpath_var,'')))
251 +
252 + # Win32 seeks DLLs along %PATH%.
253 +-if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
254 +- shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
255 ++if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir):
256 ++ shlibpath = os.path.pathsep.join((shlibdir, shlibpath))
257 +
258 + config.environment[shlibpath_var] = shlibpath
259 +diff --git a/test/lit.cfg b/test/lit.cfg
260 +index bb592936..0e7de849 100644
261 +--- a/test/lit.cfg
262 ++++ b/test/lit.cfg
263 +@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None:
264 + clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
265 + config.environment['PATH'] = path
266 +
267 ++ clang_libs_dir = getattr(config, 'clang_libs_dir', None)
268 ++ if not clang_libs_dir:
269 ++ lit_config.fatal('No Clang libs dir set!')
270 + llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
271 + if not llvm_libs_dir:
272 + lit_config.fatal('No LLVM libs dir set!')
273 +- path = os.path.pathsep.join((llvm_libs_dir,
274 ++ path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir,
275 + config.environment.get('LD_LIBRARY_PATH','')))
276 + config.environment['LD_LIBRARY_PATH'] = path
277 +
278 +diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
279 +index dfd0164c..f310b59a 100644
280 +--- a/test/lit.site.cfg.in
281 ++++ b/test/lit.site.cfg.in
282 +@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
283 + config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
284 + config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
285 + config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
286 ++config.clang_libs_dir = "@SHLIBDIR@"
287 + config.python_executable = "@PYTHON_EXECUTABLE@"
288 + config.target_triple = "@TARGET_TRIPLE@"
289 +
290 +--
291 +2.12.0
292 +