diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-03-06 20:08:21 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-03-06 23:18:15 +0100 |
commit | 4a73d12677b93bcdf102699a5f9a1b375df28fda (patch) | |
tree | 8660aa7e5a923dc3c9d2bcda8b816cd11c1b661c /sys-devel/clang | |
parent | sys-devel/lld: Bump to 4.0.0rc3, fix tests (diff) | |
download | gentoo-4a73d12677b93bcdf102699a5f9a1b375df28fda.tar.gz gentoo-4a73d12677b93bcdf102699a5f9a1b375df28fda.tar.bz2 gentoo-4a73d12677b93bcdf102699a5f9a1b375df28fda.zip |
sys-devel/clang: Bump to 4.0.0rc3, fix extra tool tests
Diffstat (limited to 'sys-devel/clang')
-rw-r--r-- | sys-devel/clang/Manifest | 6 | ||||
-rw-r--r-- | sys-devel/clang/clang-4.0.0_rc3.ebuild (renamed from sys-devel/clang/clang-4.0.0_rc2.ebuild) | 11 | ||||
-rw-r--r-- | sys-devel/clang/files/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch | 87 | ||||
-rw-r--r-- | sys-devel/clang/files/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch | 48 | ||||
-rw-r--r-- | sys-devel/clang/files/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch | 83 |
5 files changed, 230 insertions, 5 deletions
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest index 1f2b36a057c3..f329143463cf 100644 --- a/sys-devel/clang/Manifest +++ b/sys-devel/clang/Manifest @@ -1,3 +1,3 @@ -DIST cfe-4.0.0rc2.src.tar.xz 10898628 SHA256 76d6c9b7f388a93a0303dbbac0e42b183b242f822b65eb44064679e7c36aa5dc SHA512 d1015c636a77233bf8c7df28ad71c734cf4755ca5564d4de1fb2574ffb942dfb69e528316e94da54397383a9dca558b0474bd4c599086e8c63abd3de1ce2bb94 WHIRLPOOL 72e76dd862b209dcc18d232b2d723ea19c9aafd1c8ab2db5e23985aaabe382782d598ec6fd58f8209a6b579c35caa1050330474b112ecb32ac5d4eac53e3373d -DIST clang-tools-extra-4.0.0rc2.src.tar.xz 583208 SHA256 1f682bd28714cf95b3e5fa6e638276973442fed349acd8a38a08f15bca9efb7a SHA512 90b1d025c5aed9ebeb9d0c73e18f7734f151cd8637be5f9fd70a14953a73df134baa192ef76d049ac04b121cf2e32cecce311d145e275cd33fc1e7ebf999aad3 WHIRLPOOL 19cf25f96ddc486470cc5d85a28c8abae32ecc50e76e18c936aa2145922d3c075ffa0a105a02422cb59cb91aead5e8b962778b344de926b4089647e9c96544f5 -DIST llvm-4.0.0rc2.src.tar.xz 21005416 SHA256 2257faed3795fedfc509d6dd5905be158231c508c6fcaaa02e4a09c5e8dadbe1 SHA512 537356226123b8c9454ec3dfc3adbfb13cfa4bd35f530b85f2b3242391ea1fbd9abf65dfbb62db533e6eae4c9049bb260fb21dccfeb7e355306f4621d35474b7 WHIRLPOOL d79f343ca00c60dd49a3ada4808e779c45210ab03e365e614563b54879ac72b7e80b4022641db10ad2075a0d417ba7c182f9d3abf8c6b012622c0d1541a7dc69 +DIST cfe-4.0.0rc3.src.tar.xz 10901068 SHA256 974f47d91d97cebadceb33f7a966d1c158f57ffd012a300fd3d96f817ef64dd3 SHA512 6427c90516c80d4ce83861ae2eb22635f38818e4f35441292375b4867abb82c48371ddf0afe9daec3b96f5f5ee1b5eced0e246eb878ef703454b92e6e2f62541 WHIRLPOOL 0608db76025fb81fc5db4e68c5b1c92dda4f82d7cf1518a38ec35cf40d4990314117b7ece0aa2e37badbfa964ba5c9b08664534bec5839cf3d1c965ac672dd30 +DIST clang-tools-extra-4.0.0rc3.src.tar.xz 583064 SHA256 08cf8e27775617f703983fa641be89538bbd7f9da0b53c4aa8bbb8c10f282cb1 SHA512 c6699cee2a4cbc7487bcf76092756939dd39a2c6de6b86e946e63f146c83af727bab0c3d5d148c5d437dea87bec25acc3db8c0c00f048187a6029b10725757e3 WHIRLPOOL 0fa3d18c099d1ff6710136dd0c7b598e230be09b5ec8dc6a8a157704eb3a0e124fe1dac5bbd6772fff52716bf5cec38c1f314cf96e71413c4f8c3d4c3d8188cf +DIST llvm-4.0.0rc3.src.tar.xz 21013952 SHA256 6727c98f436581adc6b8f9c2ad055d8e27832f60a127e97b3451eba85ef28345 SHA512 a64eaf59388be6641b6d654ceddd63232f83ad50226204255a0c9bcc3d1b36470f7acbf43615b2bd9758cd6077f55fc6155803a12947e1bd2be5661e1ff07e4a WHIRLPOOL 7aef4913c8a33ff0e35670063cb26ddd5d7b72cb08c699116dd93c72f25b6b75187bdf6bfd63b3d3b5c964c118c2db71893024524b864412f4f8daa594be7faa diff --git a/sys-devel/clang/clang-4.0.0_rc2.ebuild b/sys-devel/clang/clang-4.0.0_rc3.ebuild index 25f3a68147ed..7911a8235f0f 100644 --- a/sys-devel/clang/clang-4.0.0_rc2.ebuild +++ b/sys-devel/clang/clang-4.0.0_rc3.ebuild @@ -126,8 +126,15 @@ src_prepare() { # fix stand-alone doc build eapply "${FILESDIR}"/9999/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch - # kill extraneous deps - sed -i -e '/FileCheck/d' tools/extra/test/CMakeLists.txt || die + # fix value of ATOMIC_*_LOCK_FREE + # (backport, temporary reverted upstream because of FreeBSD issues) + eapply "${FILESDIR}"/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch + + cd tools/extra || die + # fix stand-alone test build for extra tools + eapply "${FILESDIR}"/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch + eapply "${FILESDIR}"/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch + cd - >/dev/null || die # User patches eapply_user 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 new file mode 100644 index 000000000000..f52d445eb05b --- /dev/null +++ b/sys-devel/clang/files/4.0.0/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch @@ -0,0 +1,87 @@ +From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001 +From: Michal Gorny <mgorny@gentoo.org> +Date: Mon, 9 Jan 2017 20:54:20 +0000 +Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match + builtin + +Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not +to rely on the ABI alignment of types. Instead, just assume all those +types are aligned correctly by default since clang uses safe alignment +for _Atomic types even if the underlying types are aligned to a lower +boundary by default. + +For example, the 'long long' and 'double' types on x86 are aligned to +32-bit boundary by default. However, '_Atomic long long' and '_Atomic +double' are aligned to 64-bit boundary, therefore satisfying +the requirements of lock-free atomic operations. + +This fixes PR #19355 by correcting the value of +__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing +the assumption made in libc++ tests. This also fixes PR #30581 by +applying a consistent logic between the functions used to implement +both interfaces. + +Differential Revision: https://reviews.llvm.org/D28213 + +git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8 +--- + lib/Frontend/InitPreprocessor.cpp | 10 ++++------ + test/Sema/atomic-ops.c | 4 ---- + 2 files changed, 4 insertions(+), 10 deletions(-) + +diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp +index 17603ada11..4502c92499 100644 +--- a/lib/Frontend/InitPreprocessor.cpp ++++ b/lib/Frontend/InitPreprocessor.cpp +@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned, + + /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with + /// the specified properties. +-static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign, +- unsigned InlineWidth) { ++static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) { + // Fully-aligned, power-of-2 sizes no larger than the inline + // width will be inlined as lock-free operations. +- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 && +- TypeWidth <= InlineWidth) ++ // Note: we do not need to check alignment since _Atomic(T) is always ++ // appropriately-aligned in clang. ++ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth) + return "2"; // "always lock free" + // We cannot be certain what operations the lib calls might be + // able to implement as lock-free on future processors. +@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \ + Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \ + getLockFreeValue(TI.get##Type##Width(), \ +- TI.get##Type##Align(), \ + InlineWidthBits)); + DEFINE_LOCK_FREE_MACRO(BOOL, Bool); + DEFINE_LOCK_FREE_MACRO(CHAR, Char); +@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI, + DEFINE_LOCK_FREE_MACRO(LLONG, LongLong); + Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE", + getLockFreeValue(TI.getPointerWidth(0), +- TI.getPointerAlign(0), + InlineWidthBits)); + #undef DEFINE_LOCK_FREE_MACRO + } +diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c +index 8ebf3eaed4..d3ebdf67db 100644 +--- a/test/Sema/atomic-ops.c ++++ b/test/Sema/atomic-ops.c +@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, ""); + _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, ""); +-#ifdef __i386__ +-_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, ""); +-#else + _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, ""); +-#endif + _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, ""); + + _Static_assert(__c11_atomic_is_lock_free(1), ""); +-- +2.12.0 + 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 new file mode 100644 index 000000000000..3779bc620314 --- /dev/null +++ b/sys-devel/clang/files/4.0.0/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch @@ -0,0 +1,48 @@ +From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Fri, 10 Feb 2017 22:44:53 +0100 +Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools + +Use the LLVM_UTILS_PROVIDED variable to determine whether test tool +dependencies should be exposed for clang-tools-extra tests. If clang is +being built stand-alone and LLVM test tools (FileCheck, count and not) +are installed, the top-level CMakeLists.txt of clang sets this variable +to indicate that they will not be built as a part of this build, +and therefore no dependencies should be emitted for them. This fixes +the dependency errors when building clang stand-alone with tests +enabled. +--- + test/CMakeLists.txt | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index a852ef60..c26bd5c4 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG) + endif() + + set(CLANG_TOOLS_TEST_DEPS +- # Base line deps. +- FileCheck count not +- + # clang-tidy tests require it. + clang-headers + +@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS + ExtraToolsUnitTests + ) + ++if(NOT LLVM_UTILS_PROVIDED) ++ list(APPEND CLANG_TOOLS_TEST_DEPS ++ # Base line deps. ++ FileCheck count not ++ ) ++endif() ++ + add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CLANG_TOOLS_TEST_DEPS} +-- +2.12.0 + 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 new file mode 100644 index 000000000000..22f6d5685f33 --- /dev/null +++ b/sys-devel/clang/files/4.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch @@ -0,0 +1,83 @@ +From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sun, 19 Feb 2017 12:13:04 +0100 +Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For + stand-alone build + +Prepend the clang library directory (determined using SHLIBDIR, alike +in clang) to the LD_LIBRARY_PATH to ensure that just-built clang +libraries will be used instead of a previous installed version. + +When a stand-alone build is performed, LLVM_LIBS_DIR contains the path +to installed LLVM library directory. The same directory frequently +contains a previously installed version of clang. SHLIBDIR, on the other +hand, is always the build-tree directory, and therefore contains +the freshly built clang libraries. + +In a non-stand-alone build, both paths will be the same and therefore +including them both will not cause any issues. +--- + test/Unit/lit.cfg | 9 ++++++--- + test/lit.cfg | 5 ++++- + test/lit.site.cfg.in | 1 + + 3 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg +index ff70123c..3a1da187 100644 +--- a/test/Unit/lit.cfg ++++ b/test/Unit/lit.cfg +@@ -41,14 +41,17 @@ elif platform.system() == 'Windows': + shlibpath_var = 'PATH' + + # Point the dynamic loader at dynamic libraries in 'lib'. ++shlibdir = getattr(config, 'shlibdir', None) ++if not shlibdir: ++ lit_config.fatal('No shlibdir set!') + llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) + if not llvm_libs_dir: + lit_config.fatal('No LLVM libs dir set!') +-shlibpath = os.path.pathsep.join((llvm_libs_dir, ++shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir, + config.environment.get(shlibpath_var,''))) + + # Win32 seeks DLLs along %PATH%. +-if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): +- shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath)) ++if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir): ++ shlibpath = os.path.pathsep.join((shlibdir, shlibpath)) + + config.environment[shlibpath_var] = shlibpath +diff --git a/test/lit.cfg b/test/lit.cfg +index bb592936..0e7de849 100644 +--- a/test/lit.cfg ++++ b/test/lit.cfg +@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None: + clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) + config.environment['PATH'] = path + ++ clang_libs_dir = getattr(config, 'clang_libs_dir', None) ++ if not clang_libs_dir: ++ lit_config.fatal('No Clang libs dir set!') + llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) + if not llvm_libs_dir: + lit_config.fatal('No LLVM libs dir set!') +- path = os.path.pathsep.join((llvm_libs_dir, ++ path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir, + config.environment.get('LD_LIBRARY_PATH',''))) + config.environment['LD_LIBRARY_PATH'] = path + +diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in +index dfd0164c..f310b59a 100644 +--- a/test/lit.site.cfg.in ++++ b/test/lit.site.cfg.in +@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" + config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" + config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" + config.clang_tools_dir = "@CLANG_TOOLS_DIR@" ++config.clang_libs_dir = "@SHLIBDIR@" + config.python_executable = "@PYTHON_EXECUTABLE@" + config.target_triple = "@TARGET_TRIPLE@" + +-- +2.12.0 + |