aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Tilley <ttilley@gmail.com>2015-05-27 12:39:40 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2015-05-29 13:38:55 +0000
commit08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1 (patch)
treea2be5477ecf414d7932779f755518cb4b74a6c75
parent2e13d49d9449cb2fab62471594f3980307bf4cef (diff)
downloadaports-08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1.tar.bz2
aports-08fdc9700ce1b4e47bebc9c9d08959f5e50bc0c1.tar.xz
main/llvm: update to 3.6.1
clean up and update patchset switch to cmake perform a two-stage build with a minimal bootstrap compile of clang add clang extras update package list to split out clang documentation enable pulling from the svn release tags fix making use of abuild CFLAGS/CXXFLAGS during build don't run check-llvm, as the tests fail when running under PaX
-rw-r--r--main/llvm/APKBUILD441
-rw-r--r--main/llvm/clang-0001-fix-stdint.h.patch (renamed from main/llvm/clang-3.5-fix-stdint.patch)12
-rw-r--r--main/llvm/clang-0002-fix-unwind-header.patch (renamed from main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch)14
-rw-r--r--main/llvm/clang-0003-add-alpine-linux-distro.patch24
-rw-r--r--main/llvm/clang-0004-alpine-use-z-relro.patch (renamed from main/llvm/clang-3.6-alpine-use-z-relro.patch)12
-rw-r--r--main/llvm/clang-0005-alpine-hash-style-gnu.patch (renamed from main/llvm/clang-3.6-alpine-hash-style-gnu.patch)7
-rw-r--r--main/llvm/clang-0006-musl-alpine-triple.patch (renamed from main/llvm/clang-3.6-musl-alpine-triple.patch)20
-rw-r--r--main/llvm/clang-0007-musl-dynamic-linker-paths.patch (renamed from main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch)4
-rw-r--r--main/llvm/clang-0008-alpine-PIE-by-default.patch54
-rw-r--r--main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch12
-rw-r--r--main/llvm/clang-3.6-add-alpine-distro.patch34
-rw-r--r--main/llvm/clang-3.6-default-runtime-compiler-rt.patch27
-rw-r--r--main/llvm/clang-3.6-musl-no-use-cxa-atexit.patch14
-rw-r--r--main/llvm/clang-3.6-musl-use-init-array.patch20
-rw-r--r--main/llvm/clang-3.6-remove-lgcc-when-using-compiler-rt.patch29
-rw-r--r--main/llvm/compiler-rt-0001-musl-no-dlvsym.patch (renamed from main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch)10
-rw-r--r--main/llvm/compiler-rt-0002-musl-no-sanitizers.patch49
-rw-r--r--main/llvm/compiler-rt-0003-off_t.patch (renamed from main/llvm/compiler-rt-sanitizer-off_t.patch)0
-rw-r--r--main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch34
-rw-r--r--main/llvm/llvm-0001-fix-shared-build.patch (renamed from main/llvm/llvm-3.5-gcc-4.9.patch)31
-rw-r--r--main/llvm/llvm-0002-musl-triple.patch (renamed from main/llvm/llvm-3.6-musl-triple.patch)48
-rw-r--r--main/llvm/llvm-0003-musl-hacks.patch (renamed from main/llvm/llvm-3.6-musl.patch)42
22 files changed, 489 insertions, 449 deletions
diff --git a/main/llvm/APKBUILD b/main/llvm/APKBUILD
index 793a8383cf..c86a684236 100644
--- a/main/llvm/APKBUILD
+++ b/main/llvm/APKBUILD
@@ -1,88 +1,180 @@
# Contributor: Travis Tilley <ttilley@gmail.com>
-# Maintainer: William Pitcock <nenolod@dereferenced.org>
+# Maintainer: Travis Tilley <ttilley@gmail.com>
pkgname=llvm
-pkgver=3.6.0
-pkgrel=1
+pkgver=3.6.1
+pkgrel=0
+use_svn="false"
pkgdesc="low level virtual machine compiler system"
-arch="all"
+arch="x86 x86_64 armhf"
url="http://llvm.org/"
license="UOI-NCSA"
depends=""
depends_dev="perl"
-makedepends="$depends_dev make flex bison groff libffi-dev zlib-dev ncurses-dev libedit-dev python chrpath"
+makedepends="$depends_dev cmake make flex bison groff musl-dev binutils-dev libffi-dev libxml2-dev libxml2-utils zlib-dev ncurses-dev python python-dev py-sphinx chrpath"
+[ "${use_svn}" = "true" ] && makedepends="$makedepends subversion"
install=
-subpackages="clang-libs:clang_libs clang
- $pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs"
-source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
- http://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
- http://llvm.org/releases/$pkgver/compiler-rt-$pkgver.src.tar.xz
- llvm-3.5-gcc-4.9.patch
- llvm-3.6-musl-triple.patch
- llvm-3.6-musl.patch
- compiler-rt-3.6-musl-disable-sanitizers.patch
- compiler-rt-3.6-musl-no-dlvsym.patch
- compiler-rt-sanitizer-off_t.patch
- clang-3.5-fix-stdint.patch
- clang-3.6-fix-unwind-chain-inclusion.patch
- clang-3.6-remove-lgcc-when-using-compiler-rt.patch
- clang-3.6-add-alpine-distro.patch
- clang-3.6-alpine-use-z-relro.patch
- clang-3.6-alpine-hash-style-gnu.patch
- clang-3.6-default-runtime-compiler-rt.patch
- clang-3.6-musl-alpine-triple.patch
- clang-3.6-musl-fix-dynamic-linker-paths.patch
- clang-3.6-musl-use-init-array.patch
- clang-3.6-musl-no-use-cxa-atexit.patch
+subpackages="clang clang-doc:clang_doc $pkgname-dev $pkgname-doc $pkgname-libs"
+source="
+ llvm-0001-fix-shared-build.patch
+ llvm-0002-musl-triple.patch
+ llvm-0003-musl-hacks.patch
+ compiler-rt-0001-musl-no-dlvsym.patch
+ compiler-rt-0002-musl-no-sanitizers.patch
+ compiler-rt-0003-off_t.patch
+ clang-0001-fix-stdint.h.patch
+ clang-0002-fix-unwind-header.patch
+ clang-0003-add-alpine-linux-distro.patch
+ clang-0004-alpine-use-z-relro.patch
+ clang-0005-alpine-hash-style-gnu.patch
+ clang-0006-musl-alpine-triple.patch
+ clang-0007-musl-dynamic-linker-paths.patch
+ clang-0008-alpine-PIE-by-default.patch
+ clang-0009-pass-host-triple-to-compiler-rt.patch
"
+if [ "${use_svn}" != "true" ]; then
+ source="$source
+ http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
+ http://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
+ http://llvm.org/releases/$pkgver/clang-tools-extra-$pkgver.src.tar.xz
+ http://llvm.org/releases/$pkgver/compiler-rt-$pkgver.src.tar.xz"
+fi
+
_builddir="$srcdir"/build
+_bootstrap_prefix="$srcdir"/bootstrap
+
+
+_cmake_flags="\
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_VERBOSE_MAKEFILE=NO \
+"
+
+# the binutils include directory setting appears to be necessary in order to
+# build the LLVMGold plugin, even if the headers are in /usr/include and easily
+# detected.
+# auto-detection of both go and ocaml are explicitly disabled here, as they
+# currently do not compile.
+_cmake_common_flags="\
+ ${_cmake_flags} \
+ -DLLVM_DEFAULT_TARGET_TRIPLE=$CBUILD \
+ -DLLVM_HOST_TRIPLE=$CHOST \
+ -DLLVM_BINUTILS_INCDIR=/usr/include \
+ -DLLVM_ENABLE_ASSERTIONS=NO \
+ -DLLVM_ENABLE_FFI=YES \
+ -DLLVM_ENABLE_LIBCXX=NO \
+ -DLLVM_ENABLE_PIC=YES \
+ -DLLVM_ENABLE_ZLIB=YES \
+ -DLLVM_ENABLE_RTTI=YES \
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND \
+ -DOCAMLFIND=OCAMLFIND-NOTFOUND \
+ -DCLANG_BUILD_EXAMPLES=NO \
+ -DLLVM_BUILD_EXAMPLES=NO \
+ -DLLVM_INCLUDE_EXAMPLES=NO \
+ -DLIBXML2_INCLUDE_DIR=/usr/include/libxml2 \
+"
+
+# attempt to build the bootstrap compiler as quickly as is sane. unfortunately,
+# there is no way to turn off ObjC support. we can, however, disable building
+# ARCMT (automatic reference counting migration tool), the static analyzer, and
+# documentation. also, since we're using the cmake build and not autotools, the
+# tests aren't automatically built (targets for testing are emitted, just not
+# built as part of the default target).
+_cmake_bootstrap_flags="\
+ ${_cmake_common_flags} \
+ -DCMAKE_INSTALL_PREFIX=${_bootstrap_prefix} \
+ -DLLVM_TARGETS_TO_BUILD=host \
+ -DBUILD_SHARED_LIBS=NO \
+ -DCLANG_ENABLE_ARCMT=NO \
+ -DCLANG_ENABLE_STATIC_ANALYZER=NO \
+ -DCLANG_INCLUDE_DOCS=NO \
+ -DLLVM_ENABLE_CXX1Y=NO \
+ -DLLVM_ENABLE_SPHINX=NO \
+ -DLLVM_ENABLE_TERMINFO=NO \
+ -DLLVM_INCLUDE_DOCS=NO \
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=NO \
+"
+
+# setting compiler-rt to compile as if it were an external build allows it to
+# use the freshly built clang to compile, rather than the bootstrap compiler.
+# NOTE: there appears to be an issue building compiler-rt as an external project
+# and using ninja as the build tool, so stick to good old fashioned makefiles.
+_cmake_final_flags="\
+ ${_cmake_common_flags} \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLLVM_TARGETS_TO_BUILD=all \
+ -DLLVM_BUILD_EXTERNAL_COMPILER_RT=YES \
+ -DBUILD_SHARED_LIBS=YES \
+ -DLLVM_BUILD_DOCS=YES \
+ -DLLVM_ENABLE_CXX1Y=YES \
+ -DLLVM_ENABLE_SPHINX=YES \
+ -DLLVM_ENABLE_TERMINFO=YES \
+ -DLIBCLANG_BUILD_STATIC=YES \
+"
+
_srcdir="$srcdir"/"$pkgname-$pkgver.src"
_srcdir_clang="$_srcdir"/tools/clang
+_srcdir_clang_extra="$_srcdir_clang"/tools/extra
_srcdir_compiler_rt="$_srcdir"/projects/compiler-rt
-# _srcdir_clang_extra="$_srcdir_clang"/tools/extra
-# _srcdir_lld="$_srcdir"/tools/lld
+
prepare() {
- msg "Preparing LLVM/CLANG sources..."
+ if [[ "${use_svn}" = "true" ]]; then
+ pkgsvnver="tags/RELEASE_${pkgver//./}/final/"
+ svn_source="http://llvm.org/svn/llvm-project"
+ cd "$srcdir"
+ svn co "$svn_source/llvm/$pkgsvnver" llvm-$pkgver.src
+ svn co "$svn_source/cfe/$pkgsvnver" cfe-$pkgver.src
+ svn co "$svn_source/clang-tools-extra/$pkgsvnver" clang-tools-extra-$pkgver.src
+ svn co "$svn_source/compiler-rt/$pkgsvnver" compiler-rt-$pkgver.src
+ fi
+
+
+ msg "Preparing LLVM project sources..."
mv "$srcdir"/cfe-$pkgver.src \
"$_srcdir_clang" || return 1
+ mv "$srcdir"/clang-tools-extra-$pkgver.src \
+ "$_srcdir_clang_extra" || return 1
mv "$srcdir"/compiler-rt-$pkgver.src \
"$_srcdir_compiler_rt" || return 1
- # mv "$srcdir"/clang-tools-extra-$pkgver.src \
- # "$_srcdir_clang_extra" || return 1
- # mv "$srcdir"/lld-$pkgver.src \
- # "$_srcdir_lld" || return 1
+
msg "Patching LLVM core..."
cd "$_srcdir" || return 1
update_config_sub || return 1
+ sed -i -e '/case "\${UNAME_MACHINE}:\${UNAME_SYSTEM}:\${UNAME_RELEASE}:\${UNAME_VERSION}" in/i \' \
+ -e 'if [ x != "x$CBUILD" ]; then echo "$CBUILD"; exit; fi' \
+ ./autoconf/config.guess || return 1
for i in $source; do
case $i in
- llvm*.patch)
+ llvm-*.patch)
msg "Applying $i..."
patch -s -p1 -N -i "$srcdir"/$i || return 1
;;
esac
done
- msg "Patching compiler-rt..."
- cd "$_srcdir_compiler_rt" || return 1
+ msg "Patching clang..."
+ cd "$_srcdir_clang" || return 1
+ # FIXME: I have never seen these tests pass on any system, be it vanilla clang
+ # or patched, musl or glibc, autoconf or cmake. It fails on alpine, gentoo,
+ # and ubuntu.
+ rm ./test/Driver/lto.c
for i in $source; do
case $i in
- compiler-rt*.patch)
- msg "Applying $i..."
+ clang-*.patch)
+ msg "Applying $i..."
patch -s -p1 -N -i "$srcdir"/$i || return 1
;;
esac
done
- msg "Patching clang..."
- cd "$_srcdir_clang" || return 1
+ msg "Patching compiler-rt..."
+ cd "$_srcdir_compiler_rt" || return 1
for i in $source; do
case $i in
- clang-*.patch)
- msg "Applying $i..."
+ compiler-rt-*.patch)
+ msg "Applying $i..."
patch -s -p1 -N -i "$srcdir"/$i || return 1
;;
esac
@@ -90,78 +182,109 @@ prepare() {
}
build() {
- mkdir "$_builddir"
- cd "$_builddir"
+ # cmake is funky. it uses several flag related settings in addition to picking
+ # up what's in the CFLAGS/CXXFLAGS env variables. to make using any abuild-set
+ # flags sane, we pass them in as options to cmake and unset the environment
+ # variables. we also back up the original flags so that we can tweak them
+ # without losing the original setting (see below re: -fno-devirtualize).
+ orig_cflags="${CFLAGS}"
+ orig_cxxflags="${CXXFLAGS}"
+ unset CFLAGS
+ unset CXXFLAGS
+ # just in case those were set to blank strings, we _really_ want to make sure
+ # we're not building what will effectively be a -O0 build here...
+ test -z "${orig_cflags}" && orig_cflags="-O3"
+ test -z "${orig_cxxflags}" && orig_cxxflags="-O3"
+
+ # -fno-devirtualize is added here because, to quote the fedora spec file,
+ # "gcc has scary template-related bugs". the flag is removed post-bootstrap.
+ # -DNDEBUG is required to disable assertions
+ cflags="${orig_cflags} -DNDEBUG"
+ cxxflags="${orig_cxxflags} -DNDEBUG -fno-devirtualize"
+
+ # The cmake logic appears to use the result of config.guess in a few places
+ # even though we override the various triple settings manually. export CBUILD
+ # to the tweaked config.guess just to be safe.
export CBUILD
- sed -i -e '/case "\${UNAME_MACHINE}:\${UNAME_SYSTEM}:\${UNAME_RELEASE}:\${UNAME_VERSION}" in/i \' \
- -e 'if [ x != "x$CBUILD" ]; then echo "$CBUILD"; exit; fi' \
- ../$pkgname-$pkgver.src/autoconf/config.guess \
- || return 1
-
- export CPPFLAGS="${CPPFLAGS} $(pkg-config --cflags-only-I libffi) $(pkg-config --cflags-only-I libedit)"
-
- $_srcdir/configure \
- --build=$CBUILD \
- --host=$CHOST \
- --prefix=/usr \
- --sysconfdir=/etc \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --enable-shared \
- --enable-optimized \
- --enable-keep-symbols \
- --enable-libedit \
- --enable-terminfo \
- --enable-libffi \
- --enable-clang-plugin-support \
- --enable-clang-static-analyzer \
- --enable-docs \
- --enable-threads \
- --enable-zlib \
- --enable-pic \
- --enable-targets=x86,x86_64,arm,arm64,cpp,r600 \
- --enable-bindings=none \
- --disable-timestamps \
- --disable-assertions \
- --disable-expensive-checks \
- --disable-libcpp \
- --disable-werror \
- || return 1
+
+ # cmake doesn't call out to pkg-config to determine the include path for FFI,
+ # and since alpine installs the headers to a versioned directory cmake can't
+ # auto-detect it by guessing either.
+ ffi_include_dir="$(pkg-config --cflags-only-I libffi | sed 's|^-I||g')"
+
+
+ mkdir -p "$_builddir"
+ cd "$_builddir"
+
+ msg "Compiling bootstrap compiler"
+ cmake -G "Unix Makefiles" -Wno-dev ${_cmake_bootstrap_flags} \
+ -DCMAKE_C_FLAGS_RELEASE="${cflags}" \
+ -DCMAKE_CXX_FLAGS_RELEASE="${cxxflags}" \
+ -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
+ -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
+ -DFFI_INCLUDE_DIR="$ffi_include_dir" \
+ "${_srcdir}" || return 1
make || return 1
-}
+ make install || return 1
-package() {
+ cflags="${orig_cflags} -DNDEBUG"
+ cxxflags="${orig_cxxflags} -DNDEBUG"
+ CC="${_bootstrap_prefix}/bin/clang"
+ CXX="${_bootstrap_prefix}/bin/clang++"
+
+ cd ..
+ rm -rf "$_builddir"
+ mkdir -p "$_builddir"
cd "$_builddir"
- make DESTDIR="$pkgdir" install
- #relocate docs
- mkdir -p "$pkgdir"/usr/share/doc
- mv "$pkgdir"/usr/docs/llvm "$pkgdir"/usr/share/doc/ || return 1
- rmdir "$pkgdir"/usr/docs || return 1
- chrpath -d "$pkgdir"/usr/bin/* "$pkgdir"/usr/lib/*.so || return 1
+ msg "Compiling final compiler"
+ cmake -G "Unix Makefiles" -Wno-dev ${_cmake_final_flags} \
+ -DCMAKE_C_COMPILER="${CC}" \
+ -DCMAKE_CXX_COMPILER="${CXX}" \
+ -DCMAKE_C_FLAGS_RELEASE="${cflags}" \
+ -DCMAKE_CXX_FLAGS_RELEASE="${cxxflags}" \
+ -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
+ -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
+ -DFFI_INCLUDE_DIR="$ffi_include_dir" \
+ "${_srcdir}" || return 1
+
+ make || return 1
+
+ # llvm tests don't run under PaX, almost certainly due to MCJIT
+ # TODO: detect when running a vanilla kernel and run all tests
+ # make check-llvm || return 1
+
+ make check-clang || return 1
- # remove erroneously installed example
- rm "$pkgdir"/usr/lib/*LLVMHello.* || return 1
+ # 27 failures, all related to clang-tidy.
+ # clang-format/clang-modernize and friends pass their test suites
+ # make check-clang-tools || return 1
- # remove executable bit from static libc
- chmod -x "$pkgdir"/usr/lib/*.a
+ make check-compiler-rt || return 1
}
-clang_libs() {
- pkgdesc="Runtime library for clang"
- mkdir -p "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libclang.so "$subpkgdir"/usr/lib/
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install
+
+ rm "$pkgdir"/usr/lib/LLVMHello.so
+
+ file "$pkgdir"/usr/lib/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
+ file "$pkgdir"/usr/bin/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
}
clang() {
pkgdesc="A C language family front-end for LLVM"
+
mkdir -p "$subpkgdir"/usr/bin \
"$subpkgdir"/usr/lib "$subpkgdir"/usr/share/clang "$subpkgdir"/usr/include
- mv "$pkgdir"/usr/bin/clang* "$pkgdir"/usr/bin/c-index-test \
+ mv "$pkgdir"/usr/bin/*clang* \
"$subpkgdir"/usr/bin/ || return 1
mv "$pkgdir"/usr/lib/clang \
+ "$pkgdir"/usr/lib/libclang* \
+ "$pkgdir"/usr/lib/libmodernize* \
"$subpkgdir"/usr/lib/ || return 1
mv "$pkgdir"/usr/include/clang "$pkgdir"/usr/include/clang-c \
"$subpkgdir"/usr/include/ || return 1
@@ -173,11 +296,10 @@ clang() {
ln -s /usr/share/clang/scan-view/scan-view "$subpkgdir"/usr/bin/scan-view
}
-static() {
- pkgdesc="LLVM static libraries"
- depends=
- mkdir -p "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
+clang_doc() {
+ pkgdesc="clang documentation"
+ mkdir -p "$subpkgdir"/usr/share/doc/ || return 1
+ mv "$pkgdir"/usr/share/doc/clang "$subpkgdir"/usr/share/doc/ || return 1
}
libs() {
@@ -186,63 +308,60 @@ libs() {
mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}
-md5sums="f1e14e949f8df3047c59816c55278cec llvm-3.6.0.src.tar.xz
-e3012065543dc6ab8a9842b09616b78d cfe-3.6.0.src.tar.xz
-cc36dbcafe43406083e98bc9e74f8054 compiler-rt-3.6.0.src.tar.xz
-178eecb7554f893198716e35245fc3c9 llvm-3.5-gcc-4.9.patch
-74f92f6719995be866f461a29a7c8112 llvm-3.6-musl-triple.patch
-3068c2bc0dd0f694d002d992743401ac llvm-3.6-musl.patch
-b1732677fb7641c13300a98bdd47d467 compiler-rt-3.6-musl-disable-sanitizers.patch
-a56d3a3da587b5936e338d85947bd16f compiler-rt-3.6-musl-no-dlvsym.patch
-8bc11d4a60af51a7fc10643bd0970d3a compiler-rt-sanitizer-off_t.patch
-be9b343bacbd220a154b0a773bcd3bd3 clang-3.5-fix-stdint.patch
-02df7f41728ceb3b401dd3972531d4ec clang-3.6-fix-unwind-chain-inclusion.patch
-9790d1131f498f5957e0107727489704 clang-3.6-remove-lgcc-when-using-compiler-rt.patch
-74612f41b5bda8f05be5cf2e59eebd26 clang-3.6-add-alpine-distro.patch
-dbf4e6686137d097768e971c0efd4a0b clang-3.6-alpine-use-z-relro.patch
-7495743d3c85ad48fd7ab9ca1f674884 clang-3.6-alpine-hash-style-gnu.patch
-a26e050907fae3f8ac51375826f9767c clang-3.6-default-runtime-compiler-rt.patch
-bf66b2ce06519085484776e40290118a clang-3.6-musl-alpine-triple.patch
-28266841c807bd3835186ad32942ac11 clang-3.6-musl-fix-dynamic-linker-paths.patch
-b7e213b69c848ad1bcb98a798a2f9d1d clang-3.6-musl-use-init-array.patch
-01eb6923bfa059e36ab39f44b2b6f03f clang-3.6-musl-no-use-cxa-atexit.patch"
-sha256sums="b39a69e501b49e8f73ff75c9ad72313681ee58d6f430bfad4d81846fe92eb9ce llvm-3.6.0.src.tar.xz
-be0e69378119fe26f0f2f74cffe82b7c26da840c9733fe522ed3c1b66b11082d cfe-3.6.0.src.tar.xz
-7f49fb79e5adcdce7dddaf973f1db130228dfb19e37a99a7f5365a6948b26b11 compiler-rt-3.6.0.src.tar.xz
-96851b9d89647276f4611ea7db59f84240a727b199925ee6c9599f959fc7bd05 llvm-3.5-gcc-4.9.patch
-fbe1bab0aa5eb8c54ac1ed0f7d27212efd597c8eaa889599549d0defe82bc7c9 llvm-3.6-musl-triple.patch
-f1ca24437533c5022d591b8b9a5ea7f0494e984a5c24ef1e5dcf71dbee0df240 llvm-3.6-musl.patch
-d5aa68e35fe3fe0cb2393d3abecd80987c4876f332ca03b55f03bcd82b2b720d compiler-rt-3.6-musl-disable-sanitizers.patch
-90a582ef8561ed4953feae7f19f3a30856da845174ae93e7acdb4bc088be5b78 compiler-rt-3.6-musl-no-dlvsym.patch
-45bcfa7d1c757e32183c5cd95703f150ec3d1ed966a9cfa68b13b648e5310e78 compiler-rt-sanitizer-off_t.patch
-a41aa73b9edcf0588d61e17e9d53738e9e16209eac9c5488eaef7770ab1517d1 clang-3.5-fix-stdint.patch
-2c73e2c6f3e90e2535e0662714645fc4d1189b4b1beb5a0ebb6ba1af62580d23 clang-3.6-fix-unwind-chain-inclusion.patch
-dea41fd9eb16d2c3b9b73ad1ee3af2923b26f806185494835c899700ec6830f4 clang-3.6-remove-lgcc-when-using-compiler-rt.patch
-4f68d475947eb35515231fdf23dc5a92f656038ca21b0d3d0ea110129b07d313 clang-3.6-add-alpine-distro.patch
-ba0dd990424699b92b79c8511143cbf33766e8d2009a979928e9b8229fa3cfba clang-3.6-alpine-use-z-relro.patch
-46f4c3c08bee21cc9051181108776f37acc7e9589c85f62dbd6a842b842f5a43 clang-3.6-alpine-hash-style-gnu.patch
-8c8295e10453e89d8ae70d709a91f186ea5e279494ab538e28339d9d2efa3ae8 clang-3.6-default-runtime-compiler-rt.patch
-da420dda54b0058140a4ade99de49e617c2533857ccb327d95bf51027bb0bcf8 clang-3.6-musl-alpine-triple.patch
-03c392733933198adbb3e6cb2eb9ed95e8d01f7d013e3fe2d12a8f1001b73893 clang-3.6-musl-fix-dynamic-linker-paths.patch
-03709cff62464ef2afdaa2bfaccf4dffd5d3e20eee561fb94e486a2912d8a6e6 clang-3.6-musl-use-init-array.patch
-3d5c097ab1a4e4cfadeeb11aef66a90daaff11095dd3349f25832bedc317cac8 clang-3.6-musl-no-use-cxa-atexit.patch"
-sha512sums="ca492b7d86333f05930dc849c7a8beff981da51ca174cd844650b516d0a592a2c3837d5a8a9b62713c0f29292b845f27ef0ec361809e325c6b60cbbcd3f20357 llvm-3.6.0.src.tar.xz
-dc137bdf9c2c5adb25498c995f0b944016699267156a595cc1fe6127f6961d45162275023d194db42691d80fa8fc74f56abad9c145ef1ff492881f547ca76cfe cfe-3.6.0.src.tar.xz
-2758bc2b78dcfb9b6509b83ebc4ebc86907ca3dc2a5f151f580771c674b934432cae055e342ed73096a08331b2f7b129ff65629b27932458b1877aeb554b6328 compiler-rt-3.6.0.src.tar.xz
-a16f175c75893ac58350e0573012a66c1e8908e94a03197ca50b147eb492402e706e4816b80428ccdf92a112673ec8552a0d5dc699dc95250e756c161328d9f2 llvm-3.5-gcc-4.9.patch
-a084b995b2ea65c19da5e000459c993d5a3396f0eb4f6d6ec29299d98f3df8ee6f23723f8d19e93ef906861bb83dbba5c05b8cf7801f92c8748b8687247e25d2 llvm-3.6-musl-triple.patch
-e3f4203679c978cbf359200de0cd60c0adcc58c92611ec70b4b991c6612e0b41b67c19c9994769302284edb953e258d3717ec32d90abbd9bdeff3739aa5ffb18 llvm-3.6-musl.patch
-e9cf172aac82b5e4680d4c6fb25f11e04d1db75ad4e99f7117c08631ca8a7955677fc046f58b6eef05f9e98ef0374eb9248b5674aa26b08d9f7efd30525740be compiler-rt-3.6-musl-disable-sanitizers.patch
-8cde42c93a1eda14d31f8e51ffd00d031f10071e9a4ee91fa9b08ef5b8e7bf9ec32ccd102b652e35e6f75d1339d934daa68185529ca6dba74e61f979a27498f3 compiler-rt-3.6-musl-no-dlvsym.patch
-effed16bed6160c1629c72960424afed87f8c1c1290bf4eccd43da5a1fcb5b350242c01fcc1cc7355b420f5ac80231ea7a33ca71cafad884ea4c756cbdfbdd59 compiler-rt-sanitizer-off_t.patch
-764382fc79598ca85c9c500d16e02a2710025416dc9bd8a7407aad38e663dee9539e47a1ae763b45c36cd86c4ff5853c4799835cd7363a3a208191ae7a703321 clang-3.5-fix-stdint.patch
-4cbabce34b7352bf5a043db3abe8931f58adce4fda80846c39b63399a025cbbac572052d3f0f598466bc9dca23b8ff88e655b10bf54b3870bc4e6f4225b6f558 clang-3.6-fix-unwind-chain-inclusion.patch
-d50aa3271e9247896bd3df5a55c987da81a01892af8afbd0483cff4c0467b2dc438fa9166d1aaeaf5165555c30d4a2af68c3bdbfa8fba798c2ca124172cf2642 clang-3.6-remove-lgcc-when-using-compiler-rt.patch
-f5fa5aa1b2a559215792a98806b18b32ce6b82e57afb09aa3886b22f71420c8377b784f55610b4948185e115b39aeeaf1f27625d0d91dbd3b146e4986eb29c54 clang-3.6-add-alpine-distro.patch
-61d0113e2287b82d27b4d08ed98e8f2dad864a36a295f9d8a28d54b6b8516ecda2986d402ba04146976e25e35198e12d567df80979c88081369ac386fa213a0f clang-3.6-alpine-use-z-relro.patch
-1982e8b84415fa314b040cbecac38640d754105b5af2c26d5aa7ca74d7ef14cc074bf7a5537dc492a7051d8f94035a1d69de2e913eabee7fcd1b50d6f6f126f7 clang-3.6-alpine-hash-style-gnu.patch
-b906ff5a59c83e553d67b2574bcd3c22e7975b487ad928f9e0db0a07ffb54c5e412d4527401db63f1de94884410709b4fe637e12d36fa0c0661f69fd88f09c25 clang-3.6-default-runtime-compiler-rt.patch
-d2192b615307a762d324a1643dae33bc8a97e22e6a9dd712f9a243c6d3f728c9f9f036ce34d4137c8537651d78332ad8b98fd7f325648ac68e1bda54f5f58348 clang-3.6-musl-alpine-triple.patch
-d3f6c97bdfccdab056aef149413108eb1fdf68d10782cdb1a50695a8e2e53432555a73c640ae635c697d41330c7869acc864b9f0fedbb1a4cba6d13785168564 clang-3.6-musl-fix-dynamic-linker-paths.patch
-4ae8409f3d03e8b30cbe33be507a43194ff6f3e6ce6467d3341ff08f08b12a22517a4c4b012f1b1029d956f8c486412353d937f316a7648a5be14549555aecae clang-3.6-musl-use-init-array.patch
-20cddcf4289bb50bedac2636d32824860252617545d85c5cdc13f630a6f8be2be2a7e018401de4cec0a78bafc1f940ed8d565c2cda518b73290cf3ced4d0807e clang-3.6-musl-no-use-cxa-atexit.patch"
+md5sums="0947294a8c83c8d7f857dfc16204c4eb llvm-0001-fix-shared-build.patch
+d10fc3574c560ccfae3eeacdc4a988f2 llvm-0002-musl-triple.patch
+056178d87918d531f531b1b765a59e7c llvm-0003-musl-hacks.patch
+346081b2f0825ca7f491155c4b3ca0ea compiler-rt-0001-musl-no-dlvsym.patch
+eb3797555357896a92f74bf1bacfbdc2 compiler-rt-0002-musl-no-sanitizers.patch
+8bc11d4a60af51a7fc10643bd0970d3a compiler-rt-0003-off_t.patch
+eab0123372fa909817ed21cfcffdbe16 clang-0001-fix-stdint.h.patch
+069f5cd7a6d0b01eade62bb72aac9e8b clang-0002-fix-unwind-header.patch
+93ffbede80bc857c8ae6bed5ff016a52 clang-0003-add-alpine-linux-distro.patch
+231fad6dc619ef6a54567c14082bf7af clang-0004-alpine-use-z-relro.patch
+2967fea7ed0624d99808bc091be1bab4 clang-0005-alpine-hash-style-gnu.patch
+15044d16ec3e46b89f698bf63e73bb08 clang-0006-musl-alpine-triple.patch
+e24a82edcd6caa5e405ff67a45d6befc clang-0007-musl-dynamic-linker-paths.patch
+6bc4b7047042f9afec452a97c35c2cd5 clang-0008-alpine-PIE-by-default.patch
+0ae0c5939c27750c52b39158fbc7a7a9 clang-0009-pass-host-triple-to-compiler-rt.patch
+ebf9e97be405ae126e134d3a357cd58a llvm-3.6.1.src.tar.xz
+9ff6811757735051f8651833b22ae014 cfe-3.6.1.src.tar.xz
+1ad810536f0f7fefd4541a907aff83b3 clang-tools-extra-3.6.1.src.tar.xz
+6f204b1feb324b1672ac907b32d927c0 compiler-rt-3.6.1.src.tar.xz"
+sha256sums="4f75c2a76cf4c439d65c8e67511cd91c895edf8ccf003a5f94ffa07c29456296 llvm-0001-fix-shared-build.patch
+3062c6135b12eab1ff365d1d609193723bb4c6ff3dfa9fcf76fe2b75948668c9 llvm-0002-musl-triple.patch
+c6892c843b38c9a852367e5d76ffc29c21bdfd522adbc4c4e3e3c890a513c0db llvm-0003-musl-hacks.patch
+94f5626b4729afb39ad00a6cac4f8d44e3ee6f3d87362268bcd2c0ec637edc22 compiler-rt-0001-musl-no-dlvsym.patch
+7dd2d22c61892eb651809649606fb3722520a5d12f8d88c2e96be977d0f8b71a compiler-rt-0002-musl-no-sanitizers.patch
+45bcfa7d1c757e32183c5cd95703f150ec3d1ed966a9cfa68b13b648e5310e78 compiler-rt-0003-off_t.patch
+516a1dbba85731a557840ee3ebc9cc82a2e5ce625cf5b37f5392bd089ef40bdc clang-0001-fix-stdint.h.patch
+3be240b78d2371728280ffb15191573c969b304ed784883b79c662ff73c2bc43 clang-0002-fix-unwind-header.patch
+78449c4f7c9fdfaccef3b68039c69e7e041fb34862d39c803d7e6fac17f659aa clang-0003-add-alpine-linux-distro.patch
+501ab6e3fb99c9ffb82329475051a633797bf824c0dea437843266f190c062a0 clang-0004-alpine-use-z-relro.patch
+1c4dbd1d474bf08de5979d6f4399aeba29de9ba8950aa0688d081d82e552d7d3 clang-0005-alpine-hash-style-gnu.patch
+772b1492022d1088ccf1c4ac491d9ffa326ad98a3ca8949aa52225b27641642a clang-0006-musl-alpine-triple.patch
+c7612168defefcb35cc8c988ff8b519aa983f07a62fd3b2c67f7d468459ca48a clang-0007-musl-dynamic-linker-paths.patch
+39c275490e3360d50fe339406992616fad0fa9127204c9b93578ee2403ae850c clang-0008-alpine-PIE-by-default.patch
+ec0c2014d455040499f599dc3d690fb92e54baf6058605be5f25c2c845629cfe clang-0009-pass-host-triple-to-compiler-rt.patch
+2f00c615913aa0b56607ee1548936e60ad2aa89e6d56f23fb032a4463366fc7a llvm-3.6.1.src.tar.xz
+74f92d0c93b86678b015e87655f59474b2f657769680efdeb3c0524ffbd2dad7 cfe-3.6.1.src.tar.xz
+f4ee70d870d550a9147ac6a548ce7daf7d9e6897348bf411f43c572966fb92b6 clang-tools-extra-3.6.1.src.tar.xz
+fcbf610c77be6047f11ca10c4725610417beba832565115a9e2fcfe2897b649f compiler-rt-3.6.1.src.tar.xz"
+sha512sums="b3c0e0f74680e9b2d02f1c923a191ef5eb913be84105e4d63aae6a88b1dac758467cecad3430496a7945cebdc73ec5ee1f643dc5dc7b336fee920e3c8b6d54d2 llvm-0001-fix-shared-build.patch
+8088e79c51694d237f0e29a1c9032776f943561aff389f8706f1c10b3b0405d4fa72643fb83c973be55370e89d893f7b7592bb8c64dcf2310369c0d1b7ba5db2 llvm-0002-musl-triple.patch
+df8959d43af48054bc35e4125f98e5dab1e1b5beaf7b67e95791caf144efec06764bd31a9eb5efc2179932591de8b862ebf89592d131e47070c89f19412979b7 llvm-0003-musl-hacks.patch
+f1e6d17f4cc618b6a1edba64bda652f210d3c839bd8d2d4eff81af0895176062dab1e8fa963d0fe2403311863aee083d257bdb57ad9b44e23a958286a0d2e12b compiler-rt-0001-musl-no-dlvsym.patch
+45f64cd5863238b7f7ad2f4a3733455e17eb3ab3121ba3404404f312beb91bb4d109c7c3278f77fc78730086e70cfe6532e159efef30e34af0132ca44a965220 compiler-rt-0002-musl-no-sanitizers.patch
+effed16bed6160c1629c72960424afed87f8c1c1290bf4eccd43da5a1fcb5b350242c01fcc1cc7355b420f5ac80231ea7a33ca71cafad884ea4c756cbdfbdd59 compiler-rt-0003-off_t.patch
+6ad0a3409eb9c9bd43115c696f2894b683e4659b16b7ce29c7d88c35b3f585c10870c9df224a63fa14ff78810ee829b88a60dbf426f5b36084dfce7541a0cc00 clang-0001-fix-stdint.h.patch
+0e3c9fbc70a12986e0531c9c642f9fff97d9d7617fd33ee69ac81d283ee14e86b6de435f1b51478a9c304f787c1b21ebc804d39a57a1ebeedce7308362d93614 clang-0002-fix-unwind-header.patch
+0b8108c96948a1704275a93f3b872572fe2c61a0cd3e7f4caf63c0ca262cc079e2424b70f41d20f4a9aebe30333e39e3c594b4240fd41f7bd9a6682e751a23d9 clang-0003-add-alpine-linux-distro.patch
+ac72ea29d6f889f2b54915b97d56bc388e849da2f524b872241053fa6bb9dde4eb6b1333813070e3671115121da34c22ff1e87aa19ce82a393166143b30c7de4 clang-0004-alpine-use-z-relro.patch
+0594cc85b6cf0be66e747eb7ba6af5aff401d65b4072f3da4a3e531795965f72df5a3850c7abbbe4e1fde3dc6ad583ecfc4a77429531bae02143b5ca36bed37e clang-0005-alpine-hash-style-gnu.patch
+7c58ea951c14f6e61c7b687cf9f54ff706d8e400e3af9593879aa124e43d02a0290f1078c8af00365f7c4b8b3e760e8f6edf092f4eee89fdfc053b1b5417d081 clang-0006-musl-alpine-triple.patch
+c4365cbf9645e7aacbef2392cd7418c055a45e178e4ad956dfe45eafc90ab1db70ff620dfeeec11a4fab550ec557385f2d75f68adc0830ce74b5ece7077a3baf clang-0007-musl-dynamic-linker-paths.patch
+2a217800aefbce07017b793a8c91e174dac20546343de47749b4b07b4905db9a55411ef45e482b8df93cb4dbbdf25415202c3257be36ae095a6f2de11935f80b clang-0008-alpine-PIE-by-default.patch
+7628c1b12febb27d0a9ecb846205edec61044fbb963ba5e588863652bccbb05d1436febf8840ff4b47dfb326689bb142464be59a18b17bd5d30aa03bb7e76a9f clang-0009-pass-host-triple-to-compiler-rt.patch
+fa07d0fe6c527d86c0b91b1b62597f949d777e3609e4e8ca2ea5e07931e1ebc7a363273cc705cf4a13b45e7ab00716b76de26688d077c1b51341d9dd2972de3f llvm-3.6.1.src.tar.xz
+a96944bccfd9341be7adafdcc40367d458e85e7e74b0d2f3a7ea18edf1454d04a232c2d0003d6449c52f81d1e235b434acc1bb63eb5f7d16f8f4a43b70826743 cfe-3.6.1.src.tar.xz
+3273f8c1fa1683de231d0c0b9371d4b7537381e939fe38996e70a8005a1e6185da459ace2f260fad41df4840b459448ed1498c2fd576dd560005117a54e2ccb9 clang-tools-extra-3.6.1.src.tar.xz
+121c048fe60bccccd4a188a18613c94e1e1d9abd8fbae6405d23418f0c9b3562fff72fe77aea9bc0f8632ec9ad89503b9c67fcab5bf378001f90ad7492a1845a compiler-rt-3.6.1.src.tar.xz"
diff --git a/main/llvm/clang-3.5-fix-stdint.patch b/main/llvm/clang-0001-fix-stdint.h.patch
index 4db83d5b19..649a9efd3c 100644
--- a/main/llvm/clang-3.5-fix-stdint.patch
+++ b/main/llvm/clang-0001-fix-stdint.h.patch
@@ -5,25 +5,27 @@ index 0303db9..8ca28df 100644
@@ -22,8 +22,6 @@
*
\*===----------------------------------------------------------------------===*/
-
+
-#ifndef __CLANG_STDINT_H
-#define __CLANG_STDINT_H
-
+
/* If we're hosted, fall back to the system's stdint.h, which might have
* additional definitions.
@@ -72,6 +70,8 @@
# endif
-
+
#else
+#ifndef __CLANG_STDINT_H
+#define __CLANG_STDINT_H
-
+
/* C99 7.18.1.1 Exact-width integer types.
* C99 7.18.1.2 Minimum-width integer types.
@@ -703,5 +703,5 @@ typedef __UINTMAX_TYPE__ uintmax_t;
#define INTMAX_C(v) __INTN_C(__INTMAX_WIDTH__, v)
#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)
-
+
-#endif /* __STDC_HOSTED__ */
#endif /* __CLANG_STDINT_H */
+#endif /* __STDC_HOSTED__ */
+--
+2.1.4
diff --git a/main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch b/main/llvm/clang-0002-fix-unwind-header.patch
index 2ead52f0a6..30bfaaef0b 100644
--- a/main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch
+++ b/main/llvm/clang-0002-fix-unwind-header.patch
@@ -3,9 +3,9 @@ index 90aca16..ef96969 100644
--- a/lib/Headers/unwind.h
+++ b/lib/Headers/unwind.h
@@ -23,9 +23,6 @@
-
+
/* See "Data Definitions for libgcc_s" in the Linux Standard Base.*/
-
+
-#ifndef __CLANG_UNWIND_H
-#define __CLANG_UNWIND_H
-
@@ -15,19 +15,21 @@ index 90aca16..ef96969 100644
@@ -53,6 +50,9 @@
# endif
#else
-
+
+#ifndef __CLANG_UNWIND_H
+#define __CLANG_UNWIND_H
+
#include <stdint.h>
-
+
#ifdef __cplusplus
@@ -277,6 +277,7 @@ _Unwind_Ptr _Unwind_GetTextRelBase(struct _Unwind_Context *);
}
#endif
-
+
+#endif /* __CLANG_UNWIND_H */
+
#endif
-
+
-#endif /* __CLANG_UNWIND_H */
+--
+2.1.4
diff --git a/main/llvm/clang-0003-add-alpine-linux-distro.patch b/main/llvm/clang-0003-add-alpine-linux-distro.patch
new file mode 100644
index 0000000000..3305ce3116
--- /dev/null
+++ b/main/llvm/clang-0003-add-alpine-linux-distro.patch
@@ -0,0 +1,24 @@
+diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
+index 8bd8298..620a44a 100644
+--- a/lib/Driver/ToolChains.cpp
++++ b/lib/Driver/ToolChains.cpp
+@@ -2672,6 +2672,7 @@ Tool *Solaris::buildLinker() const {
+ /// Distribution (very bare-bones at the moment).
+
+ enum Distro {
++ AlpineLinux,
+ ArchLinux,
+ DebianLenny,
+ DebianSqueeze,
+@@ -2783,6 +2784,9 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
+ if (llvm::sys::fs::exists("/etc/arch-release"))
+ return ArchLinux;
+
++ if (llvm::sys::fs::exists("/etc/alpine-release"))
++ return AlpineLinux;
++
+ return UnknownDistro;
+ }
+
+--
+2.1.4
diff --git a/main/llvm/clang-3.6-alpine-use-z-relro.patch b/main/llvm/clang-0004-alpine-use-z-relro.patch
index bd7cea08c8..52a47b0302 100644
--- a/main/llvm/clang-3.6-alpine-use-z-relro.patch
+++ b/main/llvm/clang-0004-alpine-use-z-relro.patch
@@ -1,11 +1,8 @@
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index f789fd5..6d75b4b 100644
+index 620a44a..006915c 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
-@@ -2930,13 +2940,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
- GCCInstallation.getTriple().str() + "/bin").str());
-
- Linker = GetLinkerPath();
+@@ -2939,7 +2939,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
Distro Distro = DetectDistro(Arch);
@@ -14,6 +11,5 @@ index f789fd5..6d75b4b 100644
ExtraOpts.push_back("-z");
ExtraOpts.push_back("relro");
}
-
- if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
- ExtraOpts.push_back("-X");
+--
+2.1.4
diff --git a/main/llvm/clang-3.6-alpine-hash-style-gnu.patch b/main/llvm/clang-0005-alpine-hash-style-gnu.patch
index ee1f7c0f31..ebb5fb3dc8 100644
--- a/main/llvm/clang-3.6-alpine-hash-style-gnu.patch
+++ b/main/llvm/clang-0005-alpine-hash-style-gnu.patch
@@ -1,8 +1,8 @@
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index efa9541..1c6a6d5 100644
+index 006915c..6007a98 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
-@@ -2963,7 +2963,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+@@ -2959,7 +2959,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// ABI requires a mapping between the GOT and the symbol table.
// Android loader does not support .gnu.hash.
if (!IsMips && !IsAndroid) {
@@ -10,3 +10,6 @@ index efa9541..1c6a6d5 100644
+ if (IsRedhat(Distro) || IsOpenSUSE(Distro) || Distro == AlpineLinux ||
(IsUbuntu(Distro) && Distro >= UbuntuMaverick))
ExtraOpts.push_back("--hash-style=gnu");
+
+--
+2.1.4
diff --git a/main/llvm/clang-3.6-musl-alpine-triple.patch b/main/llvm/clang-0006-musl-alpine-triple.patch
index 86cf2a4788..1c5d31e8e4 100644
--- a/main/llvm/clang-3.6-musl-alpine-triple.patch
+++ b/main/llvm/clang-0006-musl-alpine-triple.patch
@@ -1,11 +1,8 @@
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index f789fd5..6d75b4b 100644
+index 6007a98..44e929f 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
-@@ -1293,33 +1293,38 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
- "aarch64_be-linux-gnu" };
-
- static const char *const ARMLibDirs[] = { "/lib" };
+@@ -1296,7 +1296,9 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
static const char *const ARMTriples[] = { "arm-linux-gnueabi",
"arm-linux-androideabi" };
static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf",
@@ -16,11 +13,7 @@ index f789fd5..6d75b4b 100644
static const char *const ARMebLibDirs[] = { "/lib" };
static const char *const ARMebTriples[] = { "armeb-linux-gnueabi",
"armeb-linux-androideabi" };
- static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf",
- "armebv7hl-redhat-linux-gnueabi" };
-
- static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
- static const char *const X86_64Triples[] = {
+@@ -1308,7 +1310,8 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
"x86_64-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-linux-gnu",
"x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux",
"x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux",
@@ -30,7 +23,7 @@ index f789fd5..6d75b4b 100644
};
static const char *const X32LibDirs[] = { "/libx32" };
static const char *const X86LibDirs[] = { "/lib32", "/lib" };
- static const char *const X86Triples[] = {
+@@ -1316,7 +1319,9 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
"i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", "i386-linux-gnu",
"i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux",
"i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux",
@@ -41,6 +34,5 @@ index f789fd5..6d75b4b 100644
};
static const char *const MIPSLibDirs[] = { "/lib" };
- static const char *const MIPSTriples[] = { "mips-linux-gnu",
- "mips-mti-linux-gnu",
- "mips-img-linux-gnu" };
+--
+2.1.4
diff --git a/main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch b/main/llvm/clang-0007-musl-dynamic-linker-paths.patch
index 27c17728ce..c8b927fba3 100644
--- a/main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch
+++ b/main/llvm/clang-0007-musl-dynamic-linker-paths.patch
@@ -54,5 +54,7 @@ index 75eef9e..3e71522 100644
+ }
+ }
}
-
+
static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
+--
+2.1.4
diff --git a/main/llvm/clang-0008-alpine-PIE-by-default.patch b/main/llvm/clang-0008-alpine-PIE-by-default.patch
new file mode 100644
index 0000000000..7f46452751
--- /dev/null
+++ b/main/llvm/clang-0008-alpine-PIE-by-default.patch
@@ -0,0 +1,54 @@
+diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
+index 44e929f..3f25a36 100644
+--- a/lib/Driver/ToolChains.cpp
++++ b/lib/Driver/ToolChains.cpp
+@@ -3397,6 +3397,9 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+ }
+
+ bool Linux::isPIEDefault() const {
++ StringRef VendorName = Linux::getTriple().getVendorName();
++ if (VendorName.compare("alpine") == 0)
++ return true;
+ return getSanitizerArgs().requiresPIE();
+ }
+
+diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
+index 3e71522..9a0fc84 100644
+--- a/lib/Driver/Tools.cpp
++++ b/lib/Driver/Tools.cpp
+@@ -7462,7 +7462,9 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ if (!D.SysRoot.empty())
+ CmdArgs.push_back(Args.MakeArgString("--sysroot=" + D.SysRoot));
+
+- if (IsPIE)
++ if (Args.hasArg(options::OPT_nopie))
++ CmdArgs.push_back("-nopie");
++ else if (IsPIE)
+ CmdArgs.push_back("-pie");
+
+ if (Args.hasArg(options::OPT_rdynamic))
+diff --git a/test/Driver/pic.c b/test/Driver/pic.c
+index a3d989c..b1a55ae 100644
+--- a/test/Driver/pic.c
++++ b/test/Driver/pic.c
+@@ -225,6 +225,18 @@
+ // RUN: %clang %s -target i386-pc-openbsd -nopie -### 2>&1 \
+ // RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD
+ //
++// On Alpine Linux, we want similar PIE-by-default behavior
++// RUN: %clang -c %s -target x86_64-alpine-linux-musl -### 2>&1 \
++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2
++// RUN: %clang -c %s -target i686-alpine-linux-musl -### 2>&1 \
++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2
++// RUN: %clang -c %s -target armv6-alpine-linux-musleabihf -### 2>&1 \
++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2
++// RUN: %clang -c %s -target armv7-alpine-linux-musleabihf -### 2>&1 \
++// RUN: | FileCheck %s --check-prefix=CHECK-PIE2
++// RUN: %clang %s -target x86_64-alpine-linux-musl -nopie -### 2>&1 \
++// RUN: | FileCheck %s --check-prefix=CHECK-NOPIE-LD
++//
+ // On Android PIC is enabled by default
+ // RUN: %clang -c %s -target i686-linux-android -### 2>&1 \
+ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2
+--
+2.1.4
diff --git a/main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch b/main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch
new file mode 100644
index 0000000000..89174112b6
--- /dev/null
+++ b/main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch
@@ -0,0 +1,12 @@
+diff --git i/runtime/CMakeLists.txt w/runtime/CMakeLists.txt
+index 9f1cd78..5b3da2e 100644
+--- i/runtime/CMakeLists.txt
++++ w/runtime/CMakeLists.txt
+@@ -46,6 +46,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
+ -DCOMPILER_RT_INSTALL_PATH=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}
+ -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
+ -DCOMPILER_RT_ENABLE_WERROR=ON
++ -DLLVM_HOST_TRIPLE=${LLVM_HOST_TRIPLE}
+ INSTALL_COMMAND ""
+ STEP_TARGETS configure build
+ )
diff --git a/main/llvm/clang-3.6-add-alpine-distro.patch b/main/llvm/clang-3.6-add-alpine-distro.patch
deleted file mode 100644
index 9b959d335d..0000000000
--- a/main/llvm/clang-3.6-add-alpine-distro.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index f789fd5..6d75b4b 100644
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -2667,12 +2673,13 @@ Tool *Solaris::buildLinker() const {
- return new tools::solaris::Link(*this);
- }
-
- /// Distribution (very bare-bones at the moment).
-
- enum Distro {
-+ AlpineLinux,
- ArchLinux,
- DebianLenny,
- DebianSqueeze,
- DebianWheezy,
- DebianJessie,
- Exherbo,
-@@ -2778,12 +2785,15 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
- if (llvm::sys::fs::exists("/etc/exherbo-release"))
- return Exherbo;
-
- if (llvm::sys::fs::exists("/etc/arch-release"))
- return ArchLinux;
-
-+ if (llvm::sys::fs::exists("/etc/alpine-release"))
-+ return AlpineLinux;
-+
- return UnknownDistro;
- }
-
- /// \brief Get our best guess at the multiarch triple for a target.
- ///
- /// Debian-based systems are starting to use a multiarch setup where they use
diff --git a/main/llvm/clang-3.6-default-runtime-compiler-rt.patch b/main/llvm/clang-3.6-default-runtime-compiler-rt.patch
deleted file mode 100644
index f4bf20cf9b..0000000000
--- a/main/llvm/clang-3.6-default-runtime-compiler-rt.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index 1c6a6d5..7377f72 100644
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -3395,6 +3395,10 @ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
- }
- }
-
-+ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const {
-+ return ToolChain::RLT_CompilerRT;
-+}
-+
- bool Linux::isPIEDefault() const {
- return getSanitizerArgs().requiresPIE();
- }
-diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
-index 47fb10d..88aee51 100644
---- a/lib/Driver/ToolChains.h
-+++ b/lib/Driver/ToolChains.h
-@@ -640,6 +640,7 @@ public:
- void
- AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
- llvm::opt::ArgStringList &CC1Args) const override;
-+ RuntimeLibType GetDefaultRuntimeLibType() const override;
- bool isPIEDefault() const override;
-
- std::string Linker;
diff --git a/main/llvm/clang-3.6-musl-no-use-cxa-atexit.patch b/main/llvm/clang-3.6-musl-no-use-cxa-atexit.patch
deleted file mode 100644
index d1c23b0992..0000000000
--- a/main/llvm/clang-3.6-musl-no-use-cxa-atexit.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
-index 08e4439..4e5a594 100644
---- a/lib/Driver/Tools.cpp
-+++ b/lib/Driver/Tools.cpp
-@@ -3978,7 +3978,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
- options::OPT_fno_use_cxa_atexit,
- !IsWindowsCygnus && !IsWindowsGNU &&
- getToolChain().getArch() != llvm::Triple::hexagon &&
-- getToolChain().getArch() != llvm::Triple::xcore) ||
-+ getToolChain().getArch() != llvm::Triple::xcore &&
-+ getToolChain().getTriple().getEnvironment() != llvm::Triple::Musl) ||
- KernelOrKext)
- CmdArgs.push_back("-fno-use-cxa-atexit");
-
diff --git a/main/llvm/clang-3.6-musl-use-init-array.patch b/main/llvm/clang-3.6-musl-use-init-array.patch
deleted file mode 100644
index ae632aabf9..0000000000
--- a/main/llvm/clang-3.6-musl-use-init-array.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index f789fd5..6d75b4b 100644
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -2080,13 +2085,14 @@ void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
- const Generic_GCC::GCCVersion &V = GCCInstallation.getVersion();
- bool UseInitArrayDefault =
- getTriple().getArch() == llvm::Triple::aarch64 ||
- getTriple().getArch() == llvm::Triple::aarch64_be ||
- (getTriple().getOS() == llvm::Triple::Linux &&
- (!V.isOlderThan(4, 7, 0) ||
-- getTriple().getEnvironment() == llvm::Triple::Android));
-+ getTriple().getEnvironment() == llvm::Triple::Android ||
-+ getTriple().getEnvironment() == llvm::Triple::Musl));
-
- if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
- options::OPT_fno_use_init_array,
- UseInitArrayDefault))
- CC1Args.push_back("-fuse-init-array");
- }
diff --git a/main/llvm/clang-3.6-remove-lgcc-when-using-compiler-rt.patch b/main/llvm/clang-3.6-remove-lgcc-when-using-compiler-rt.patch
deleted file mode 100644
index 15cfe2f8ae..0000000000
--- a/main/llvm/clang-3.6-remove-lgcc-when-using-compiler-rt.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
-index 75eef9e..08e4439 100644
---- a/lib/Driver/Tools.cpp
-+++ b/lib/Driver/Tools.cpp
-@@ -2154,18 +2154,18 @@ static SmallString<128> getCompilerRT(const ToolChain &TC, StringRef Component,
- // FIXME: Make sure we can also emit shared objects if they're requested
- // and available, check for possible errors, etc.
- static void addClangRT(const ToolChain &TC, const ArgList &Args,
- ArgStringList &CmdArgs) {
- CmdArgs.push_back(Args.MakeArgString(getCompilerRT(TC, "builtins")));
-
-- if (!TC.getTriple().isOSWindows()) {
-- // FIXME: why do we link against gcc when we are using compiler-rt?
-- CmdArgs.push_back("-lgcc_s");
-- if (TC.getDriver().CCCIsCXX())
-- CmdArgs.push_back("-lgcc_eh");
-- }
-+ // if (!TC.getTriple().isOSWindows()) {
-+ // // FIXME: why do we link against gcc when we are using compiler-rt?
-+ // CmdArgs.push_back("-lgcc_s");
-+ // if (TC.getDriver().CCCIsCXX())
-+ // CmdArgs.push_back("-lgcc_eh");
-+ // }
- }
-
- static void addProfileRT(const ToolChain &TC, const ArgList &Args,
- ArgStringList &CmdArgs) {
- if (!(Args.hasFlag(options::OPT_fprofile_arcs, options::OPT_fno_profile_arcs,
- false) ||
diff --git a/main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch b/main/llvm/compiler-rt-0001-musl-no-dlvsym.patch
index 444f4e073b..1d427d93b2 100644
--- a/main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch
+++ b/main/llvm/compiler-rt-0001-musl-no-dlvsym.patch
@@ -2,10 +2,7 @@ diff --git a/lib/interception/interception_linux.cc b/lib/interception/intercept
index 6e908ac..7fcf2a6 100644
--- a/lib/interception/interception_linux.cc
+++ b/lib/interception/interception_linux.cc
-@@ -21,13 +21,13 @@ namespace __interception {
- bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
- uptr real, uptr wrapper) {
- *func_addr = (uptr)dlsym(RTLD_NEXT, func_name);
+@@ -24,7 +24,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
return real == wrapper;
}
@@ -14,6 +11,5 @@ index 6e908ac..7fcf2a6 100644
void *GetFuncAddrVer(const char *func_name, const char *ver) {
return dlvsym(RTLD_NEXT, func_name, ver);
}
- #endif // !defined(__ANDROID__)
-
- } // namespace __interception
+--
+2.1.4
diff --git a/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch b/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch
new file mode 100644
index 0000000000..48822b3933
--- /dev/null
+++ b/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch
@@ -0,0 +1,49 @@
+diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
+index f6d48b3..26b6d8e 100644
+--- a/cmake/config-ix.cmake
++++ b/cmake/config-ix.cmake
+@@ -186,13 +186,15 @@ filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64
+ filter_available_targets(TSAN_SUPPORTED_ARCH x86_64)
+ filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips mipsel mips64 mips64el)
+
++string(REGEX MATCH "musl[^-]*$" LLVM_ENV_MUSL ${LLVM_HOST_TRIPLE})
++
+ if(ANDROID)
+ set(OS_NAME "Android")
+ else()
+ set(OS_NAME "${CMAKE_SYSTEM_NAME}")
+ endif()
+
+-if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND
++if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND NOT LLVM_ENV_MUSL AND
+ (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR
+ (OS_NAME MATCHES "Windows" AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)))
+ set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE)
+diff --git a/lib/Makefile.mk b/lib/Makefile.mk
+index ed9690d..28e17d9 100644
+--- a/lib/Makefile.mk
++++ b/lib/Makefile.mk
+@@ -10,13 +10,14 @@
+ SubDirs :=
+
+ # Add submodules.
+-SubDirs += asan
++#SubDirs += asan
+ SubDirs += builtins
+-SubDirs += dfsan
++#SubDirs += dfsan
+ SubDirs += interception
+-SubDirs += lsan
+-SubDirs += msan
++#SubDirs += lsan
++#SubDirs += msan
+ SubDirs += profile
+-SubDirs += sanitizer_common
+-SubDirs += tsan
+-SubDirs += ubsan
++#SubDirs += sanitizer_common
++#SubDirs += tsan
++#SubDirs += ubsan
++
+--
+2.1.4
diff --git a/main/llvm/compiler-rt-sanitizer-off_t.patch b/main/llvm/compiler-rt-0003-off_t.patch
index eee8ab0626..eee8ab0626 100644
--- a/main/llvm/compiler-rt-sanitizer-off_t.patch
+++ b/main/llvm/compiler-rt-0003-off_t.patch
diff --git a/main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch b/main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch
deleted file mode 100644
index c37490ca3f..0000000000
--- a/main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Unfortunately, the sanitizer functionality depends on a variety of GNU
-extensions and headers that simply don't exist on a musl based system. Fixing
-this would be a fairly complicated task, though some inspiration could be taken
-from dpkg's static 'libcompat' approach of supplying equivalent functionality
-that might be missing. A task for another day perhaps.
-
-diff --git a/lib/Makefile.mk b/lib/Makefile.mk
-index ed9690d..aacb2b1 100644
---- a/lib/Makefile.mk
-+++ b/lib/Makefile.mk
-@@ -7,16 +7,16 @@
- #
- #===------------------------------------------------------------------------===#
-
- SubDirs :=
-
- # Add submodules.
--SubDirs += asan
-+# SubDirs += asan
- SubDirs += builtins
--SubDirs += dfsan
-+# SubDirs += dfsan
- SubDirs += interception
--SubDirs += lsan
--SubDirs += msan
-+# SubDirs += lsan
-+# SubDirs += msan
- SubDirs += profile
--SubDirs += sanitizer_common
--SubDirs += tsan
--SubDirs += ubsan
-+# SubDirs += sanitizer_common
-+# SubDirs += tsan
-+# SubDirs += ubsan
diff --git a/main/llvm/llvm-3.5-gcc-4.9.patch b/main/llvm/llvm-0001-fix-shared-build.patch
index f60c4df723..492c4399ac 100644
--- a/main/llvm/llvm-3.5-gcc-4.9.patch
+++ b/main/llvm/llvm-0001-fix-shared-build.patch
@@ -1,19 +1,22 @@
-commit 080fb498017d17af2e4d7563608c7d8a848f20da
-Author: Sanjoy Das <sanjoy at azulsystems.com>
+From 0d03d2ea17b66d8cb0f6ca5f2181237228535845 Mon Sep 17 00:00:00 2001
+From: Sanjoy Das <sanjoy at azulsystems.com>
Date: Thu Jun 19 15:38:02 2014 -0700
+Subject: Fix the --enable-shared build.
- Fix the --enable-shared build.
+Currently a build configured with ./configure --enable-shared breaks
+with an undefined "llvm::cl::parser<llvm::PassInfo
+const*>::getOption(unsigned int) const" symbol when linking opt. This
+body for this symbol gets emitted into Pass.o (along with the destructor
+for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
+visibility, causing the link error.
- Currently a build configured with ./configure --enable-shared breaks
- with an undefined "llvm::cl::parser<llvm::PassInfo
- const*>::getOption(unsigned int) const" symbol when linking opt. This
- body for this symbol gets emitted into Pass.o (along with the destructor
- for PassNameParser), but gets linked into libLLVM-3.5svn.so with local
- visibility, causing the link error.
-
- This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
- visible definition for the functions in parser<const PassInfo *> into
- Pass.o.
+This fix uses the existing EXTERN_TEMPLATE machinery to force a globally
+visible definition for the functions in parser<const PassInfo *> into
+Pass.o.
+---
+ include/llvm/IR/LegacyPassNameParser.h | 2 ++
+ lib/IR/Pass.cpp | 2 ++
+ 2 files changed, 4 insertions(+)
diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
index e2e4912..a07e3fd 100644
@@ -41,3 +44,5 @@ index 91d86ae..00ce223 100644
//===----------------------------------------------------------------------===//
// AnalysisUsage Class Implementation
//
+--
+2.1.4
diff --git a/main/llvm/llvm-3.6-musl-triple.patch b/main/llvm/llvm-0002-musl-triple.patch
index 08919c680e..f6f186e70c 100644
--- a/main/llvm/llvm-3.6-musl-triple.patch
+++ b/main/llvm/llvm-0002-musl-triple.patch
@@ -2,10 +2,7 @@ diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index 8a68599..072623c 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
-@@ -151,12 +151,16 @@ public:
- GNUX32,
- CODE16,
- EABI,
+@@ -154,6 +154,10 @@ public:
EABIHF,
Android,
@@ -16,17 +13,11 @@ index 8a68599..072623c 100644
MSVC,
Itanium,
Cygnus,
- };
- enum ObjectFormatType {
- UnknownObjectFormat,
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 0838e90..4be78e5 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
-@@ -172,12 +172,15 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
- case GNUEABIHF: return "gnueabihf";
- case GNUEABI: return "gnueabi";
- case GNUX32: return "gnux32";
+@@ -175,6 +175,9 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
case CODE16: return "code16";
case EABI: return "eabi";
case EABIHF: return "eabihf";
@@ -36,13 +27,7 @@ index 0838e90..4be78e5 100644
case Android: return "android";
case MSVC: return "msvc";
case Itanium: return "itanium";
- case Cygnus: return "cygnus";
- }
-
-@@ -372,12 +375,15 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
- .StartsWith("gnueabihf", Triple::GNUEABIHF)
- .StartsWith("gnueabi", Triple::GNUEABI)
- .StartsWith("gnux32", Triple::GNUX32)
+@@ -375,6 +378,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
.StartsWith("code16", Triple::CODE16)
.StartsWith("gnu", Triple::GNU)
.StartsWith("android", Triple::Android)
@@ -52,18 +37,11 @@ index 0838e90..4be78e5 100644
.StartsWith("msvc", Triple::MSVC)
.StartsWith("itanium", Triple::Itanium)
.StartsWith("cygnus", Triple::Cygnus)
- .Default(Triple::UnknownEnvironment);
- }
-
-
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
-index dbacd4d..c81e620 100644
+index dbacd4d..b330be5 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
-@@ -366,22 +366,25 @@ public:
-
- // ARM Targets that support EHABI exception handling standard
- // Darwin uses SjLj. Other targets might need more checks.
+@@ -369,8 +369,10 @@ public:
bool isTargetEHABICompatible() const {
return (TargetTriple.getEnvironment() == Triple::EABI ||
TargetTriple.getEnvironment() == Triple::GNUEABI ||
@@ -74,8 +52,7 @@ index dbacd4d..c81e620 100644
TargetTriple.getEnvironment() == Triple::Android) &&
!isTargetDarwin() && !isTargetWindows();
}
-
- bool isTargetHardFloat() const {
+@@ -379,6 +381,7 @@ public:
// FIXME: this is invalid for WindowsCE
return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
TargetTriple.getEnvironment() == Triple::EABIHF ||
@@ -83,17 +60,11 @@ index dbacd4d..c81e620 100644
isTargetWindows();
}
bool isTargetAndroid() const {
- return TargetTriple.getEnvironment() == Triple::Android;
- }
-
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index 7a8181b..ce5ceb9 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
-@@ -84,12 +84,14 @@ computeTargetABI(const Triple &TT, StringRef CPU,
- switch (TT.getEnvironment()) {
- case llvm::Triple::Android:
- case llvm::Triple::GNUEABI:
+@@ -87,6 +87,8 @@ computeTargetABI(const Triple &TT, StringRef CPU,
case llvm::Triple::GNUEABIHF:
case llvm::Triple::EABIHF:
case llvm::Triple::EABI:
@@ -102,6 +73,5 @@ index 7a8181b..ce5ceb9 100644
TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS;
break;
case llvm::Triple::GNU:
- TargetABI = ARMBaseTargetMachine::ARM_ABI_APCS;
- break;
- default:
+--
+2.1.4
diff --git a/main/llvm/llvm-3.6-musl.patch b/main/llvm/llvm-0003-musl-hacks.patch
index ba3c49f785..7d3e0a6183 100644
--- a/main/llvm/llvm-3.6-musl.patch
+++ b/main/llvm/llvm-0003-musl-hacks.patch
@@ -2,10 +2,7 @@ diff --git a/include/llvm/Target/TargetLibraryInfo.h b/include/llvm/Target/Targe
index 46f87b9..41ac5fd 100644
--- a/include/llvm/Target/TargetLibraryInfo.h
+++ b/include/llvm/Target/TargetLibraryInfo.h
-@@ -10,12 +10,21 @@
- #ifndef LLVM_TARGET_TARGETLIBRARYINFO_H
- #define LLVM_TARGET_TARGETLIBRARYINFO_H
-
+@@ -13,6 +13,15 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/Pass.h"
@@ -21,17 +18,11 @@ index 46f87b9..41ac5fd 100644
namespace llvm {
class Triple;
- namespace LibFunc {
- enum Func {
- /// int _IO_getc(_IO_FILE * __fp);
diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
index d2b551e..4634a13 100644
--- a/lib/Support/DynamicLibrary.cpp
+++ b/lib/Support/DynamicLibrary.cpp
-@@ -135,13 +135,13 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
-
- if (void *Result = llvm::SearchForAddressOfSpecialSymbol(symbolName))
- return Result;
+@@ -138,7 +138,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
@@ -40,17 +31,11 @@ index d2b551e..4634a13 100644
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
- // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
- #if defined(__linux__) and !defined(__ANDROID__)
- {
diff --git a/lib/Support/Unix/Signals.inc b/lib/Support/Unix/Signals.inc
index e8f4643..8a320ef 100644
--- a/lib/Support/Unix/Signals.inc
+++ b/lib/Support/Unix/Signals.inc
-@@ -413,13 +413,13 @@ static bool printSymbolizedStackTrace(void **StackTrace, int Depth, FILE *FD) {
- // PrintStackTrace - In the case of a program crash or fault, print out a stack
- // trace so that the user has an indication of why and where we died.
- //
+@@ -416,7 +416,7 @@ static bool printSymbolizedStackTrace(void **StackTrace, int Depth, FILE *FD) {
// On glibc systems we have the 'backtrace' function, which works nicely, but
// doesn't demangle symbols.
void llvm::sys::PrintStackTrace(FILE *FD) {
@@ -59,17 +44,11 @@ index e8f4643..8a320ef 100644
static void* StackTrace[256];
// Use backtrace() to output a backtrace on Linux systems with glibc.
int depth = backtrace(StackTrace,
- static_cast<int>(array_lengthof(StackTrace)));
- if (printSymbolizedStackTrace(StackTrace, depth, FD))
- return;
diff --git a/lib/Target/TargetLibraryInfo.cpp b/lib/Target/TargetLibraryInfo.cpp
index c0abdbd..ed908f8 100644
--- a/lib/Target/TargetLibraryInfo.cpp
+++ b/lib/Target/TargetLibraryInfo.cpp
-@@ -661,20 +661,21 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
- break;
- default:
- TLI.setUnavailable(LibFunc::ffsll);
+@@ -664,14 +664,15 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
}
// The following functions are available on at least Linux:
@@ -87,17 +66,11 @@ index c0abdbd..ed908f8 100644
TLI.setUnavailable(LibFunc::fopen64);
TLI.setUnavailable(LibFunc::fseeko64);
TLI.setUnavailable(LibFunc::fstat64);
- TLI.setUnavailable(LibFunc::fstatvfs64);
- TLI.setUnavailable(LibFunc::ftello64);
- TLI.setUnavailable(LibFunc::lstat64);
diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
index bf850c6..9e9088c 100644
--- a/utils/unittest/googletest/src/gtest.cc
+++ b/utils/unittest/googletest/src/gtest.cc
-@@ -117,12 +117,13 @@
- #if GTEST_HAS_EXCEPTIONS
- # include <stdexcept>
- #endif
+@@ -120,6 +120,7 @@
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
@@ -105,6 +78,5 @@ index bf850c6..9e9088c 100644
# include <netdb.h> // NOLINT
#endif
- // Indicates that this translation unit is part of Google Test's
- // implementation. It must come before gtest-internal-inl.h is
- // included, or there will be a compiler error. This trick is to
+--
+2.1.4