Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3F2A0200CAA for ; Sat, 3 Jun 2017 04:24:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3E03F160BDD; Sat, 3 Jun 2017 02:24:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5DD0C160BD2 for ; Sat, 3 Jun 2017 04:24:02 +0200 (CEST) Received: (qmail 91387 invoked by uid 500); 3 Jun 2017 02:24:01 -0000 Mailing-List: contact commits-help@kudu.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.apache.org Delivered-To: mailing list commits@kudu.apache.org Received: (qmail 91378 invoked by uid 99); 3 Jun 2017 02:24:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2017 02:24:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 45F7FDFDE2; Sat, 3 Jun 2017 02:24:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: danburkert@apache.org To: commits@kudu.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: kudu git commit: Bump LLVM to 4.0.0 Date: Sat, 3 Jun 2017 02:24:01 +0000 (UTC) archived-at: Sat, 03 Jun 2017 02:24:03 -0000 Repository: kudu Updated Branches: refs/heads/master e3b7d4dc1 -> ce83b6cef Bump LLVM to 4.0.0 I'm working on integrating Thrift into the Kudu build, and hit https://reviews.llvm.org/D22800, which is fixed in 4.0.0. Change-Id: I64f98bb56d2510ba03ef5ea477a4d7bb4b48c555 Reviewed-on: http://gerrit.cloudera.org:8080/7069 Reviewed-by: Adar Dembo Tested-by: Kudu Jenkins Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/ce83b6ce Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/ce83b6ce Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/ce83b6ce Branch: refs/heads/master Commit: ce83b6cefe199c2170a76e2735e6b17e04970ca8 Parents: e3b7d4d Author: Dan Burkert Authored: Fri Jun 2 16:10:19 2017 -0700 Committer: Dan Burkert Committed: Sat Jun 3 02:23:07 2017 +0000 ---------------------------------------------------------------------- thirdparty/download-thirdparty.sh | 5 +- thirdparty/package-llvm.sh | 55 +++++++++++++ .../patches/libc++-fix-std-once-barriers.patch | 86 -------------------- thirdparty/vars.sh | 18 +--- 4 files changed, 58 insertions(+), 106 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/ce83b6ce/thirdparty/download-thirdparty.sh ---------------------------------------------------------------------- diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index 8ac968e..05f8fed 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -238,16 +238,13 @@ if [ ! -d $PYTHON_SOURCE ]; then fetch_and_expand python-${PYTHON_VERSION}.tar.gz fi -LLVM_PATCHLEVEL=2 +LLVM_PATCHLEVEL=1 delete_if_wrong_patchlevel $LLVM_SOURCE $LLVM_PATCHLEVEL if [ ! -d $LLVM_SOURCE ]; then fetch_and_expand llvm-${LLVM_VERSION}.src.tar.gz pushd $LLVM_SOURCE patch -p1 < $TP_DIR/patches/llvm-fix-amazon-linux.patch - pushd projects/libcxx - patch -p1 < $TP_DIR/patches/libc++-fix-std-once-barriers.patch - popd touch patchlevel-$LLVM_PATCHLEVEL popd echo http://git-wip-us.apache.org/repos/asf/kudu/blob/ce83b6ce/thirdparty/package-llvm.sh ---------------------------------------------------------------------- diff --git a/thirdparty/package-llvm.sh b/thirdparty/package-llvm.sh new file mode 100755 index 0000000..344a7fb --- /dev/null +++ b/thirdparty/package-llvm.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Packages LLVM for inclusing in the Kudu thirdparty build. +# +# Our llvm tarball includes clang, extra clang tools, lld, and compiler-rt. +# +# See http://clang.llvm.org/get_started.html and http://lld.llvm.org/ for +# details on how they're laid out in the llvm tarball. +# +# Summary: +# 1. Unpack the llvm tarball +# 2. Unpack the clang tarball as tools/clang (rename from cfe- to clang) +# 3. Unpack the extra clang tools tarball as tools/clang/tools/extra +# 4. Unpack the lld tarball as tools/lld +# 5. Unpack the compiler-rt tarball as projects/compiler-rt +# 6. Unpack the libc++ tarball as projects/libcxx +# 7. Unpack the libc++abi tarball as projects/libcxxabi +# 8. Create new tarball from the resulting source tree +# +# Usage: +# $ env VERSION=4.0.0 thirdparty/package-llvm.sh + +set -ex + +for ARTIFACT in llvm cfe compiler-rt libcxx libcxxabi lld clang-tools-extra; do + wget http://releases.llvm.org/$VERSION/$ARTIFACT-$VERSION.src.tar.xz + tar xf $ARTIFACT-$VERSION.src.tar.xz + rm $ARTIFACT-$VERSION.src.tar.xz +done + +mv cfe-$VERSION.src llvm-$VERSION.src/tools/clang +mv clang-tools-extra-$VERSION.src llvm-$VERSION.src/tools/clang/tools/extra +mv lld-$VERSION.src llvm-$VERSION.src/tools/lld +mv compiler-rt-$VERSION.src llvm-$VERSION.src/projects/compiler-rt +mv libcxx-$VERSION.src llvm-$VERSION.src/projects/libcxx +mv libcxxabi-$VERSION.src llvm-$VERSION.src/projects/libcxxabi + +tar czf llvm-$VERSION.src.tar.gz llvm-$VERSION.src http://git-wip-us.apache.org/repos/asf/kudu/blob/ce83b6ce/thirdparty/patches/libc++-fix-std-once-barriers.patch ---------------------------------------------------------------------- diff --git a/thirdparty/patches/libc++-fix-std-once-barriers.patch b/thirdparty/patches/libc++-fix-std-once-barriers.patch deleted file mode 100644 index 63939b3..0000000 --- a/thirdparty/patches/libc++-fix-std-once-barriers.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 4dbd4fcf8626453949625bf36976e668094cfbb1 Mon Sep 17 00:00:00 2001 -From: Kuba Brecka -Date: Sun, 4 Sep 2016 09:55:12 +0000 -Subject: [PATCH] [libcxx] Fix a data race in call_once - -call_once is using relaxed atomic load to perform double-checked locking, which contains a data race. The fast-path load has to be an acquire atomic load. - -Differential Revision: https://reviews.llvm.org/D24028 - - - -git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@280621 91177308-0d34-0410-b5e6-96231b3b80d8 ---- - include/memory | 12 ++++++++++++ - include/mutex | 4 ++-- - src/mutex.cpp | 5 +---- - 3 files changed, 15 insertions(+), 6 deletions(-) - -diff --git a/include/memory b/include/memory -index 31f58b7..8cb094e 100644 ---- a/include/memory -+++ b/include/memory -@@ -663,6 +663,18 @@ _ValueType __libcpp_relaxed_load(_ValueType const* __value) { - #endif - } - -+template -+inline _LIBCPP_ALWAYS_INLINE -+_ValueType __libcpp_acquire_load(_ValueType const* __value) { -+#if !defined(_LIBCPP_HAS_NO_THREADS) && \ -+ defined(__ATOMIC_ACQUIRE) && \ -+ (__has_builtin(__atomic_load_n) || _GNUC_VER >= 407) -+ return __atomic_load_n(__value, __ATOMIC_ACQUIRE); -+#else -+ return *__value; -+#endif -+} -+ - // addressof moved to <__functional_base> - - template class allocator; -diff --git a/include/mutex b/include/mutex -index c047cf9..79befbe 100644 ---- a/include/mutex -+++ b/include/mutex -@@ -574,7 +574,7 @@ inline _LIBCPP_INLINE_VISIBILITY - void - call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args) - { -- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul) -+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) - { - typedef tuple<_Callable&&, _Args&&...> _Gp; - _Gp __f(_VSTD::forward<_Callable>(__func), _VSTD::forward<_Args>(__args)...); -@@ -590,7 +590,7 @@ inline _LIBCPP_INLINE_VISIBILITY - void - call_once(once_flag& __flag, _Callable& __func) - { -- if (__libcpp_relaxed_load(&__flag.__state_) != ~0ul) -+ if (__libcpp_acquire_load(&__flag.__state_) != ~0ul) - { - __call_once_param<_Callable> __p(__func); - __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>); -diff --git a/src/mutex.cpp b/src/mutex.cpp -index 9f808ca..7226abc 100644 ---- a/src/mutex.cpp -+++ b/src/mutex.cpp -@@ -199,9 +199,6 @@ static __libcpp_mutex_t mut = _LIBCPP_MUTEX_INITIALIZER; - static __libcpp_condvar_t cv = _LIBCPP_CONDVAR_INITIALIZER; - #endif - --/// NOTE: Changes to flag are done via relaxed atomic stores --/// even though the accesses are protected by a mutex because threads --/// just entering 'call_once` concurrently read from flag. - void - __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*)) - { -@@ -238,7 +235,7 @@ __call_once(volatile unsigned long& flag, void* arg, void(*func)(void*)) - __libcpp_mutex_unlock(&mut); - func(arg); - __libcpp_mutex_lock(&mut); -- __libcpp_relaxed_store(&flag, ~0ul); -+ __libcpp_atomic_store(&flag, ~0ul, _AO_Release); - __libcpp_mutex_unlock(&mut); - __libcpp_condvar_broadcast(&cv); - #ifndef _LIBCPP_NO_EXCEPTIONS http://git-wip-us.apache.org/repos/asf/kudu/blob/ce83b6ce/thirdparty/vars.sh ---------------------------------------------------------------------- diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index 3e3ee3c..6a39cd2 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -125,22 +125,8 @@ LIBUNWIND_VERSION=1.1a LIBUNWIND_NAME=libunwind-$LIBUNWIND_VERSION LIBUNWIND_SOURCE=$TP_SOURCE_DIR/$LIBUNWIND_NAME -# Our llvm tarball includes clang, extra clang tools, lld, and compiler-rt. -# -# See http://clang.llvm.org/get_started.html and http://lld.llvm.org/ for -# details on how they're laid out in the llvm tarball. -# -# Summary: -# 1. Unpack the llvm tarball -# 2. Unpack the clang tarball as tools/clang (rename from cfe- to clang) -# 3. Unpack the extra clang tools tarball as tools/clang/tools/extra -# 4. Unpack the lld tarball as tools/lld -# 5. Unpack the compiler-rt tarball as projects/compiler-rt -# 6. Unpack the libc++ tarball as projects/libcxx -# 7. Unpack the libc++abi tarball as projects/libcxxabi -# 8. Create new tarball from the resulting source tree -# -LLVM_VERSION=3.9.1 +# See package-llvm.sh for details on the LLVM tarball. +LLVM_VERSION=4.0.0 LLVM_NAME=llvm-$LLVM_VERSION.src LLVM_SOURCE=$TP_SOURCE_DIR/$LLVM_NAME