aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-05-22 13:43:22 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-05-22 13:43:22 +0000
commit70622e24effd147a1d3e6206607f73ccdba33e8f (patch)
tree9f6ad37ec2977a564c47819340add467227c9dc0 /main/llvm
parent95623fb7c14e2129b8e4f39e947d99dc85d3e158 (diff)
downloadaports-70622e24effd147a1d3e6206607f73ccdba33e8f.tar.bz2
aports-70622e24effd147a1d3e6206607f73ccdba33e8f.tar.xz
Revert "main/llvm: update patchset, switch to cmake, perform two-stage build with a minimal bootstrap compile of clang, add clang extras, update package list to split out clang documentation"
Diffstat (limited to 'main/llvm')
-rw-r--r--main/llvm/APKBUILD409
-rw-r--r--main/llvm/clang-0003-add-alpine-linux-distro.patch34
-rw-r--r--main/llvm/clang-0004-alpine-use-z-relro.patch25
-rw-r--r--main/llvm/clang-0008-alpine-PIE-by-default.patch67
-rw-r--r--main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch12
-rw-r--r--main/llvm/clang-3.5-fix-stdint.patch (renamed from main/llvm/clang-0001-fix-stdint.h.patch)12
-rw-r--r--main/llvm/clang-3.6-add-alpine-distro.patch34
-rw-r--r--main/llvm/clang-3.6-alpine-hash-style-gnu.patch (renamed from main/llvm/clang-0005-alpine-hash-style-gnu.patch)17
-rw-r--r--main/llvm/clang-3.6-alpine-use-z-relro.patch19
-rw-r--r--main/llvm/clang-3.6-default-runtime-compiler-rt.patch27
-rw-r--r--main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch (renamed from main/llvm/clang-0002-fix-unwind-header.patch)12
-rw-r--r--main/llvm/clang-3.6-musl-alpine-triple.patch (renamed from main/llvm/clang-0006-musl-alpine-triple.patch)32
-rw-r--r--main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch (renamed from main/llvm/clang-0007-musl-dynamic-linker-paths.patch)12
-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-0002-musl-no-sanitizers.patch61
-rw-r--r--main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch34
-rw-r--r--main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch (renamed from main/llvm/compiler-rt-0001-musl-no-dlvsym.patch)20
-rw-r--r--main/llvm/llvm-3.5-gcc-4.9.patch (renamed from main/llvm/llvm-0001-fix-shared-build.patch)36
-rw-r--r--main/llvm/llvm-3.6-musl-triple.patch (renamed from main/llvm/llvm-0002-musl-triple.patch)63
-rw-r--r--main/llvm/llvm-3.6-musl.patch (renamed from main/llvm/llvm-0003-musl-hacks.patch)69
22 files changed, 440 insertions, 618 deletions
diff --git a/main/llvm/APKBUILD b/main/llvm/APKBUILD
index c5fdc8e283..5f2cccae94 100644
--- a/main/llvm/APKBUILD
+++ b/main/llvm/APKBUILD
@@ -2,292 +2,165 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=llvm
pkgver=3.6.0
-pkgrel=2
+pkgrel=1
pkgdesc="low level virtual machine compiler system"
-arch="x86 x86_64 armhf"
+arch="x86_64 armhf"
url="http://llvm.org/"
license="UOI-NCSA"
depends=""
depends_dev="perl"
-makedepends="$depends_dev cmake make flex bison groff musl-dev binutils-gold binutils-dev libffi-dev libxml2-dev libxml2-utils zlib-dev ncurses-dev python python-dev py-sphinx chrpath"
+makedepends="$depends_dev make flex bison groff libffi-dev zlib-dev ncurses-dev libedit-dev python chrpath"
install=
-subpackages="clang clang-doc:clang_doc $pkgname-dev $pkgname-doc $pkgname-libs"
+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/clang-tools-extra-$pkgver.src.tar.xz
http://llvm.org/releases/$pkgver/compiler-rt-$pkgver.src.tar.xz
- 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
- 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
+ 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
+ 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
"
_builddir="$srcdir"/build
-_bootstrap_prefix="$srcdir"/bootstrap
_srcdir="$srcdir"/"$pkgname-$pkgver.src"
_srcdir_clang="$_srcdir"/tools/clang
-_srcdir_clang_extra="$_srcdir_clang"/tools/extra
-# _srcdir_polly="$_srcdir"/tools/polly
_srcdir_compiler_rt="$_srcdir"/projects/compiler-rt
-# _srcdir_libcxx="$_srcdir"/projects/libcxx
-
-
-# get_libstdcxx_header_directories() {
-# echo | \
-# g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | \
-# grep '^ /' | \
-# head -2 | \
-# sed 's|^ *||g' | \
-# tr '\n' ';'
-# }
-
-# dynamically link to libstdc++ rather than statically link to libsupc++ even
-# though that's all we need. If a program also needs to link against libstdc++,
-# it will provide its own copy of libsupc++ and this can lead to subtle problems.
-# NOTE: the define has changed name in the 3.7 tree to always be
-# LIBCXX_ABI_INCLUDE_PATHS, even when using libsupc++.
-# _cmake_libcxx_abi_flags="\
-# -DLIBCXX_CXX_ABI=libstdc++ \
-# -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS=$(get_libstdcxx_header_directories) \
-# "
-
-# _cmake_libcxx_flags="\
-# ${_cmake_libcxx_abi_flags} \
-# -DLIBCXX_HOST_TRIPLE=$CHOST \
-# -DLIBCXX_TARGET_TRIPLE=$CBUILD \
-# -DLIBCXX_ENABLE_ASSERTIONS=NO \
-# "
-
-_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} \
- -DCOMPILER_RT_TEST_TARGET_TRIPLE=$CBUILD \
- -DLLVM_DEFAULT_TARGET_TRIPLE=$CBUILD \
- -DLLVM_HOST_TRIPLE=$CHOST \
- -DFFI_INCLUDE_DIR=$(pkg-config --cflags-only-I libffi | sed 's|^-I||g') \
- -DLIBXML2_INCLUDE_DIR=$(pkg-config --cflags-only-I libxml-2.0 | sed 's|^-I||g') \
- -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 \
-"
-
-# 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_clang_extra="$_srcdir_clang"/tools/extra
+# _srcdir_lld="$_srcdir"/tools/lld
prepare() {
- msg "Preparing LLVM project sources..."
+ msg "Preparing LLVM/CLANG sources..."
mv "$srcdir"/cfe-$pkgver.src \
"$_srcdir_clang" || return 1
- mv "$srcdir"/clang-tools-extra-$pkgver.src \
- "$_srcdir_clang_extra" || return 1
- # TODO: polly requires isl 0.14.x
- # mv "$srcdir"/polly-$pkgver.src \
- # "$_srcdir_polly" || return 1
mv "$srcdir"/compiler-rt-$pkgver.src \
"$_srcdir_compiler_rt" || return 1
- # mv "$srcdir"/libcxx-$pkgver.src \
- # "$_srcdir_libcxx" || 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 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
+ 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
done
- msg "Patching compiler-rt..."
- cd "$_srcdir_compiler_rt" || return 1
+ msg "Patching clang..."
+ cd "$_srcdir_clang" || return 1
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 libc++..."
- # cd "$_srcdir_libcxx" || return 1
- # for i in $source; do
- # case $i in
- # libcxx-*.patch)
- # msg "Applying $i..."
- # patch -s -p1 -N -i "$srcdir"/$i || return 1
- # ;;
- # esac
- # done
}
build() {
- # These flag settings are added to the existing cmake build flags rather
- # than replacing them, so we clear them out here to remove any abuild set
- # flags. For a Release build, the default flags will be "-O3 -NDEBUG".
- # -fno-devirtualize is added here because, to quote the fedora spec file,
- # "gcc has scary template-related bugs". the flag is removed post-bootstrap.
- CFLAGS=""
- CXXFLAGS="-fno-devirtualize"
- LDFLAGS=""
- : ${CC:=$(which gcc)}
- : ${CXX:=$(which g++)}
-
- # 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
-
- mkdir -p "$_builddir"
+ mkdir "$_builddir"
cd "$_builddir"
- msg "Compiling bootstrap compiler"
- cmake -G "Unix Makefiles" -Wno-dev ${_cmake_bootstrap_flags} \
- -DCMAKE_C_COMPILER="${CC}" \
- -DCMAKE_CXX_COMPILER="${CXX}" \
- -DCMAKE_C_FLAGS="${CFLAGS}" \
- -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
- -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
- -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
- "${_srcdir}" || return 1
-
- make || return 1
- make install || return 1
-
- CFLAGS=""
- CXXFLAGS=""
- CC="${_bootstrap_prefix}/bin/clang"
- CXX="${_bootstrap_prefix}/bin/clang++"
-
- cd ..
- rm -rf "$_builddir"
- mkdir -p "$_builddir"
- cd "$_builddir"
-
- msg "Compiling final compiler"
- cmake -G "Unix Makefiles" -Wno-dev ${_cmake_final_flags} \
- -DCMAKE_C_COMPILER="${CC}" \
- -DCMAKE_CXX_COMPILER="${CXX}" \
- -DCMAKE_C_FLAGS="${CFLAGS}" \
- -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
- -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
- -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
- "${_srcdir}" || return 1
+ 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
make || return 1
- make check-llvm || return 1
- make check-clang || return 1
- # 27 failures, all related to clang-tidy
- # make check-clang-tools || return 1
- make check-compiler-rt || return 1
- # 172 test failures, so it's not included
- # make check-libcxx || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install
- rm "$pkgdir"/usr/lib/LLVMHello.so
+ #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
- 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
+ # remove erroneously installed example
+ rm "$pkgdir"/usr/lib/*LLVMHello.* || return 1
+
+ # remove executable bit from static libc
+ chmod -x "$pkgdir"/usr/lib/*.a
+}
+
+clang_libs() {
+ pkgdesc="Runtime library for clang"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libclang.so "$subpkgdir"/usr/lib/
}
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* \
+ mv "$pkgdir"/usr/bin/clang* "$pkgdir"/usr/bin/c-index-test \
"$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
@@ -299,10 +172,11 @@ clang() {
ln -s /usr/share/clang/scan-view/scan-view "$subpkgdir"/usr/bin/scan-view
}
-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
+static() {
+ pkgdesc="LLVM static libraries"
+ depends=
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}
libs() {
@@ -313,55 +187,58 @@ libs() {
md5sums="f1e14e949f8df3047c59816c55278cec llvm-3.6.0.src.tar.xz
e3012065543dc6ab8a9842b09616b78d cfe-3.6.0.src.tar.xz
-85a170713a0b15a728b0cfd7b63c546c clang-tools-extra-3.6.0.src.tar.xz
cc36dbcafe43406083e98bc9e74f8054 compiler-rt-3.6.0.src.tar.xz
-dd8e9953b54b2f783cdf111e31adf9ce llvm-0001-fix-shared-build.patch
-1a9472a91fa50f3a844ad21d33242aa2 llvm-0002-musl-triple.patch
-3254a34a4c87ed5e6d4730972f7807ed llvm-0003-musl-hacks.patch
-5c0fbb582bbd9c6e6999830c720ea5be compiler-rt-0001-musl-no-dlvsym.patch
-3ae77dfa18a7ac0a787e34f599d5c71d compiler-rt-0002-musl-no-sanitizers.patch
-4f964e4a6ed8de0a9ee55f94fb8d1a64 clang-0001-fix-stdint.h.patch
-ee28027eff24641b13ae19a04746fd6a clang-0002-fix-unwind-header.patch
-e61b007324f9ab08b13ae0a249400ee1 clang-0003-add-alpine-linux-distro.patch
-fe5108b7c78d4493200f84d9f39f70ac clang-0004-alpine-use-z-relro.patch
-2b39912685835682633c4d11aa39f400 clang-0005-alpine-hash-style-gnu.patch
-eafaf62d4938aa34d1902c46288f5f35 clang-0006-musl-alpine-triple.patch
-0f206f7c8a29263d19bda41b48ec4ae8 clang-0007-musl-dynamic-linker-paths.patch
-f3537e99223c975bbc4abef21f7ced7f clang-0008-alpine-PIE-by-default.patch
-0ae0c5939c27750c52b39158fbc7a7a9 clang-0009-pass-host-triple-to-compiler-rt.patch"
+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
+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
-3aa949ba82913490a75697287d9ee8598c619fae0aa6bb8fddf0095ff51bc812 clang-tools-extra-3.6.0.src.tar.xz
7f49fb79e5adcdce7dddaf973f1db130228dfb19e37a99a7f5365a6948b26b11 compiler-rt-3.6.0.src.tar.xz
-d6d425bfc40908158fdee6160dd43f3804c320efec8637207196deccae7bae63 llvm-0001-fix-shared-build.patch
-67fed034e986b60e71d1fb546ca36529972c03e0b370f8e01b34f183ce6920e5 llvm-0002-musl-triple.patch
-0b49b6914999140ee6f8084b7506d1933860d73332ea8e3d4e4096f4bb6f1510 llvm-0003-musl-hacks.patch
-82c38857bcbfd96e857299d0db7070b5f09d2edb3a32fb9d2e26a51a27e5f86a compiler-rt-0001-musl-no-dlvsym.patch
-124d9f48a0127747073c2ed36aadfd0cc747f580978f9c0ce329632190afc200 compiler-rt-0002-musl-no-sanitizers.patch
-4212f7a2de9544545aa88b0061f32e01962813e8271650e6f452de7eee5a4895 clang-0001-fix-stdint.h.patch
-443305f3ac60502a210339d1bf28e1f2b79cb4dd1274ba4458da354b7a2f529a clang-0002-fix-unwind-header.patch
-a958600c5fc8a67fb59266e0f7759b7ec959042358470f802f9b3385fb0cac9b clang-0003-add-alpine-linux-distro.patch
-d08fb6de8aae75439b38a945773ddfe77e0f0d0f01ef03c3d087a8dbdfa01a7f clang-0004-alpine-use-z-relro.patch
-624a99a4f8354e9179b8d7705c0f0db9368f074023ccf3a2186235c49050b6be clang-0005-alpine-hash-style-gnu.patch
-88f60113909a57c3ae428e219d8e81d0355aa102c34d853db3b19627d8724608 clang-0006-musl-alpine-triple.patch
-069e5974573d1f6efc784cf4e3027f2197c50319a5787cffff825f3253c525dd clang-0007-musl-dynamic-linker-paths.patch
-2512ede893e2af8d7b3df4f490427b77af726b06336e84a74169d427f69ff438 clang-0008-alpine-PIE-by-default.patch
-ec0c2014d455040499f599dc3d690fb92e54baf6058605be5f25c2c845629cfe clang-0009-pass-host-triple-to-compiler-rt.patch"
+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
+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
-52e0cd3cce3047bb98d52e5c03ac4a8c549fcdc628f57492727f3e7659b2d4bd29ad98ab4ebab387233911fbb098861ec020b28c051e6b2c17d73dd490beebf3 clang-tools-extra-3.6.0.src.tar.xz
2758bc2b78dcfb9b6509b83ebc4ebc86907ca3dc2a5f151f580771c674b934432cae055e342ed73096a08331b2f7b129ff65629b27932458b1877aeb554b6328 compiler-rt-3.6.0.src.tar.xz
-4878becb5e28fa1f29f0e46b643a8df688f53a48b0c6988d3f581fabca3a5812af12d197e0a9b38e324b83c53026304070fa09fb9dc7c1b5532ab8488fcc7356 llvm-0001-fix-shared-build.patch
-e543093f1385e8fcd94780a2f7887a51a13b6eaf0ef8c07be827851cac918376f45936f9bed341e30bd83a3557e67165f31977b3d7350932e8c94b7fc6356bf6 llvm-0002-musl-triple.patch
-d73b6fc0525e4800e9629411d727b7457f1298cd798022aa1b1c7699f21c7c461cd5473f19ef0c2ab8dba15d81b2950e890bce10bcb9c2dcdb7bae4e8d9db4ca llvm-0003-musl-hacks.patch
-0e99e707794d260b193cd601914a47f1d138c21e1de6fdb67a6ebfa7035fda190fc41041e03ccca564bbecc739b8efaf1ae6000e8b35b0de528b28820b28bf2c compiler-rt-0001-musl-no-dlvsym.patch
-b3475eb64891eddd5a135c89d5d9eb479497e2dd04d114ffe7518a4a4117d5f011985a13c77d83b07bd6c6e5fe625d21d791bb671d112014f2ef1b77fedd74ce compiler-rt-0002-musl-no-sanitizers.patch
-266e1af8c495201e60e909de37a3c705670ad6b9d07dc29926c34e65fba19b0b60b39a0189c4fdb0222e7c061a4378f56dfc7286dcd5d6f9a67a823c13f1d840 clang-0001-fix-stdint.h.patch
-d550193133ac8baf435c73865a90a6bf5b3c5e0e0dd308d4f413043d2ca3f63b4edb2cda9f282f4632e1e6e8974aba83febfffdf923fedd5d760c5ada26e9c73 clang-0002-fix-unwind-header.patch
-3f31200835b4e9e7067191c9610a732b036318c17c38db6da380cbf7d7df8184507e819844fe92f01afc676d7dcf266bf28a6bbe26aa5fe208ef99885b42753c clang-0003-add-alpine-linux-distro.patch
-46cb2d09fe25c98ab38db31a46b62570bbf0647847a30e8f568081121a727b70acf1a94b2d6b977d2ca6a68893370d7ffe59b80c7f492a8aba74592795437bbb clang-0004-alpine-use-z-relro.patch
-c9dea90fefdaccb01190ea0e170918252cb4c355b5ffc8ebe55c1154fa97247ab9d9e26157bbf4fbe02ebd5b06bb5257adeae1e7efdaf1327d8e672c85799dce clang-0005-alpine-hash-style-gnu.patch
-77b12b357b316206df7a3187a72c50b625990df7fb56de7ab811dc500ed982086e1d02491b8661df92fd0da9849a50057d36ad34fa40f6addfd674e66d0edb8e clang-0006-musl-alpine-triple.patch
-73699c0dd5a1960caf00d997aa95a88a178d9aa9dc86d05e404d6ad9ac8c54d450d58870aa54e0cd75f6e29ec3ee034118a1db735a9583665d34c62cdb2c0ae3 clang-0007-musl-dynamic-linker-paths.patch
-2e3c6b519bb07915bf02ee2b12d4a5e28197c22d89f4ffe92f4cc485c2ba00d94faf91473a6219cb2af89e986ea7bf05a6dfa94f20f6c5919818b053bf40df38 clang-0008-alpine-PIE-by-default.patch
-7628c1b12febb27d0a9ecb846205edec61044fbb963ba5e588863652bccbb05d1436febf8840ff4b47dfb326689bb142464be59a18b17bd5d30aa03bb7e76a9f clang-0009-pass-host-triple-to-compiler-rt.patch"
+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
+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"
diff --git a/main/llvm/clang-0003-add-alpine-linux-distro.patch b/main/llvm/clang-0003-add-alpine-linux-distro.patch
deleted file mode 100644
index b3c24dd382..0000000000
--- a/main/llvm/clang-0003-add-alpine-linux-distro.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From ab87f035bb1c8bd37bf1fd99e6dcee4408c50929 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:25:17 -0400
-Subject: [PATCH 3/8] add alpine linux distro
-
----
- lib/Driver/ToolChains.cpp | 4 ++++
- 1 file changed, 4 insertions(+)
-
-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-0004-alpine-use-z-relro.patch b/main/llvm/clang-0004-alpine-use-z-relro.patch
deleted file mode 100644
index c7fe94bed1..0000000000
--- a/main/llvm/clang-0004-alpine-use-z-relro.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 383827121a633f2cf93535487e991efd6e4ff577 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:25:51 -0400
-Subject: [PATCH 4/8] alpine-use-z-relro.patch
-
----
- lib/Driver/ToolChains.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index 620a44a..006915c 100644
---- a/lib/Driver/ToolChains.cpp
-+++ b/lib/Driver/ToolChains.cpp
-@@ -2939,7 +2939,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
-
- Distro Distro = DetectDistro(Arch);
-
-- if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
-+ if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || Distro == AlpineLinux) {
- ExtraOpts.push_back("-z");
- ExtraOpts.push_back("relro");
- }
---
-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
deleted file mode 100644
index 04c745c09e..0000000000
--- a/main/llvm/clang-0008-alpine-PIE-by-default.patch
+++ /dev/null
@@ -1,67 +0,0 @@
-From fec8bdd3fc2d45dc1da8e6b94c1b264a6431685e Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Sat, 9 May 2015 23:02:45 -0400
-Subject: [PATCH 8/8] enable PIE by default behavior on alpine linux add -nopie
- flag for disabling this behavior
-
----
- lib/Driver/ToolChains.cpp | 3 +++
- lib/Driver/Tools.cpp | 4 +++-
- test/Driver/pic.c | 12 ++++++++++++
- 3 files changed, 18 insertions(+), 1 deletion(-)
-
-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
deleted file mode 100644
index 89174112b6..0000000000
--- a/main/llvm/clang-0009-pass-host-triple-to-compiler-rt.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-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-0001-fix-stdint.h.patch b/main/llvm/clang-3.5-fix-stdint.patch
index 1288aab5ad..4db83d5b19 100644
--- a/main/llvm/clang-0001-fix-stdint.h.patch
+++ b/main/llvm/clang-3.5-fix-stdint.patch
@@ -1,12 +1,3 @@
-From df7be8fa2f40672a872a0aea2266fcbf96a10374 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Mon, 27 Apr 2015 08:30:55 -0400
-Subject: [PATCH 1/8] fix stdint.h
-
----
- lib/Headers/stdint.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
diff --git a/lib/Headers/stdint.h b/lib/Headers/stdint.h
index 0303db9..8ca28df 100644
--- a/lib/Headers/stdint.h
@@ -36,6 +27,3 @@ index 0303db9..8ca28df 100644
-#endif /* __STDC_HOSTED__ */
#endif /* __CLANG_STDINT_H */
+#endif /* __STDC_HOSTED__ */
---
-2.1.4
-
diff --git a/main/llvm/clang-3.6-add-alpine-distro.patch b/main/llvm/clang-3.6-add-alpine-distro.patch
new file mode 100644
index 0000000000..9b959d335d
--- /dev/null
+++ b/main/llvm/clang-3.6-add-alpine-distro.patch
@@ -0,0 +1,34 @@
+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-0005-alpine-hash-style-gnu.patch b/main/llvm/clang-3.6-alpine-hash-style-gnu.patch
index 36e8506a05..ee1f7c0f31 100644
--- a/main/llvm/clang-0005-alpine-hash-style-gnu.patch
+++ b/main/llvm/clang-3.6-alpine-hash-style-gnu.patch
@@ -1,17 +1,8 @@
-From 60d9da20f29f8121ee6b383c49249d04141efc4b Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:26:27 -0400
-Subject: [PATCH 5/8] alpine-hash-style-gnu.patch
-
----
- lib/Driver/ToolChains.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index 006915c..6007a98 100644
+index efa9541..1c6a6d5 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
-@@ -2959,7 +2959,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+@@ -2963,7 +2963,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) {
@@ -19,7 +10,3 @@ index 006915c..6007a98 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-alpine-use-z-relro.patch b/main/llvm/clang-3.6-alpine-use-z-relro.patch
new file mode 100644
index 0000000000..bd7cea08c8
--- /dev/null
+++ b/main/llvm/clang-3.6-alpine-use-z-relro.patch
@@ -0,0 +1,19 @@
+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
+@@ -2930,13 +2940,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
+ GCCInstallation.getTriple().str() + "/bin").str());
+
+ Linker = GetLinkerPath();
+
+ Distro Distro = DetectDistro(Arch);
+
+- if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
++ if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || Distro == AlpineLinux) {
+ ExtraOpts.push_back("-z");
+ ExtraOpts.push_back("relro");
+ }
+
+ if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb)
+ ExtraOpts.push_back("-X");
diff --git a/main/llvm/clang-3.6-default-runtime-compiler-rt.patch b/main/llvm/clang-3.6-default-runtime-compiler-rt.patch
new file mode 100644
index 0000000000..f4bf20cf9b
--- /dev/null
+++ b/main/llvm/clang-3.6-default-runtime-compiler-rt.patch
@@ -0,0 +1,27 @@
+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-0002-fix-unwind-header.patch b/main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch
index 1b86de2c47..2ead52f0a6 100644
--- a/main/llvm/clang-0002-fix-unwind-header.patch
+++ b/main/llvm/clang-3.6-fix-unwind-chain-inclusion.patch
@@ -1,12 +1,3 @@
-From 757d99457c9dffe5e7d9a300f14728ecaa8db868 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Mon, 27 Apr 2015 08:38:38 -0400
-Subject: [PATCH 2/8] fix unwind header inclusion
-
----
- lib/Headers/unwind.h | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
diff --git a/lib/Headers/unwind.h b/lib/Headers/unwind.h
index 90aca16..ef96969 100644
--- a/lib/Headers/unwind.h
@@ -40,6 +31,3 @@ index 90aca16..ef96969 100644
#endif
-#endif /* __CLANG_UNWIND_H */
---
-2.1.4
-
diff --git a/main/llvm/clang-0006-musl-alpine-triple.patch b/main/llvm/clang-3.6-musl-alpine-triple.patch
index d9b6982c9a..86cf2a4788 100644
--- a/main/llvm/clang-0006-musl-alpine-triple.patch
+++ b/main/llvm/clang-3.6-musl-alpine-triple.patch
@@ -1,17 +1,11 @@
-From 1001e7fa6c2e5ec9d82b78c31e4be56765b5722b Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:26:50 -0400
-Subject: [PATCH 6/8] musl-alpine-triple.patch
-
----
- lib/Driver/ToolChains.cpp | 11 ++++++++---
- 1 file changed, 8 insertions(+), 3 deletions(-)
-
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
-index 6007a98..44e929f 100644
+index f789fd5..6d75b4b 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
-@@ -1296,7 +1296,9 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
+@@ -1293,33 +1293,38 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
+ "aarch64_be-linux-gnu" };
+
+ static const char *const ARMLibDirs[] = { "/lib" };
static const char *const ARMTriples[] = { "arm-linux-gnueabi",
"arm-linux-androideabi" };
static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf",
@@ -22,7 +16,11 @@ index 6007a98..44e929f 100644
static const char *const ARMebLibDirs[] = { "/lib" };
static const char *const ARMebTriples[] = { "armeb-linux-gnueabi",
"armeb-linux-androideabi" };
-@@ -1308,7 +1310,8 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
+ 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[] = {
"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",
@@ -32,7 +30,7 @@ index 6007a98..44e929f 100644
};
static const char *const X32LibDirs[] = { "/libx32" };
static const char *const X86LibDirs[] = { "/lib32", "/lib" };
-@@ -1316,7 +1319,9 @@ bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
+ static const char *const X86Triples[] = {
"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,8 +39,8 @@ index 6007a98..44e929f 100644
+ "i486-alpine-linux-musl", "i486-pc-linux-musl",
+ "i686-alpine-linux-musl", "i686-pc-linux-musl"
};
-
- static const char *const MIPSLibDirs[] = { "/lib" };
---
-2.1.4
+ static const char *const MIPSLibDirs[] = { "/lib" };
+ static const char *const MIPSTriples[] = { "mips-linux-gnu",
+ "mips-mti-linux-gnu",
+ "mips-img-linux-gnu" };
diff --git a/main/llvm/clang-0007-musl-dynamic-linker-paths.patch b/main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch
index 2c9fc83f48..27c17728ce 100644
--- a/main/llvm/clang-0007-musl-dynamic-linker-paths.patch
+++ b/main/llvm/clang-3.6-musl-fix-dynamic-linker-paths.patch
@@ -1,12 +1,3 @@
-From c914c8a347cc57261fa7b185f020ae2a60d8c527 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:27:13 -0400
-Subject: [PATCH 7/8] fix dynamic linker paths for musl
-
----
- lib/Driver/Tools.cpp | 31 +++++++++++++++++++++++++------
- 1 file changed, 25 insertions(+), 6 deletions(-)
-
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 75eef9e..3e71522 100644
--- a/lib/Driver/Tools.cpp
@@ -65,6 +56,3 @@ index 75eef9e..3e71522 100644
}
static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
---
-2.1.4
-
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
new file mode 100644
index 0000000000..d1c23b0992
--- /dev/null
+++ b/main/llvm/clang-3.6-musl-no-use-cxa-atexit.patch
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000000..ae632aabf9
--- /dev/null
+++ b/main/llvm/clang-3.6-musl-use-init-array.patch
@@ -0,0 +1,20 @@
+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
new file mode 100644
index 0000000000..15cfe2f8ae
--- /dev/null
+++ b/main/llvm/clang-3.6-remove-lgcc-when-using-compiler-rt.patch
@@ -0,0 +1,29 @@
+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-0002-musl-no-sanitizers.patch b/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch
deleted file mode 100644
index 433895a3b8..0000000000
--- a/main/llvm/compiler-rt-0002-musl-no-sanitizers.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c6a6b4cd6b6516aa01595292086d53f9e47ca599 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Sat, 9 May 2015 04:17:45 -0400
-Subject: [PATCH 2/2] dont build sanitizers on musl. they currently require too
- many extensions to compile.
-
----
- cmake/config-ix.cmake | 4 +++-
- lib/Makefile.mk | 15 ++++++++-------
- 2 files changed, 11 insertions(+), 8 deletions(-)
-
-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-3.6-musl-disable-sanitizers.patch b/main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch
new file mode 100644
index 0000000000..c37490ca3f
--- /dev/null
+++ b/main/llvm/compiler-rt-3.6-musl-disable-sanitizers.patch
@@ -0,0 +1,34 @@
+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/compiler-rt-0001-musl-no-dlvsym.patch b/main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch
index f5761f5ee6..444f4e073b 100644
--- a/main/llvm/compiler-rt-0001-musl-no-dlvsym.patch
+++ b/main/llvm/compiler-rt-3.6-musl-no-dlvsym.patch
@@ -1,25 +1,19 @@
-From dba6719feee1aab8d4bf881faa7a19b0920af261 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:24:19 -0400
-Subject: [PATCH 1/2] musl-no-dlvsym.patch
-
----
- lib/interception/interception_linux.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
diff --git a/lib/interception/interception_linux.cc b/lib/interception/interception_linux.cc
index 6e908ac..7fcf2a6 100644
--- a/lib/interception/interception_linux.cc
+++ b/lib/interception/interception_linux.cc
-@@ -24,7 +24,7 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr,
+@@ -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);
return real == wrapper;
}
-
+
-#if !defined(__ANDROID__) // android does not have dlvsym
+#if 0 // !defined(__ANDROID__) // android does not have dlvsym
void *GetFuncAddrVer(const char *func_name, const char *ver) {
return dlvsym(RTLD_NEXT, func_name, ver);
}
---
-2.1.4
+ #endif // !defined(__ANDROID__)
+ } // namespace __interception
diff --git a/main/llvm/llvm-0001-fix-shared-build.patch b/main/llvm/llvm-3.5-gcc-4.9.patch
index ceeda806d7..f60c4df723 100644
--- a/main/llvm/llvm-0001-fix-shared-build.patch
+++ b/main/llvm/llvm-3.5-gcc-4.9.patch
@@ -1,22 +1,19 @@
-From 0d03d2ea17b66d8cb0f6ca5f2181237228535845 Mon Sep 17 00:00:00 2001
-From: Sanjoy Das <sanjoy at azulsystems.com>
+commit 080fb498017d17af2e4d7563608c7d8a848f20da
+Author: Sanjoy Das <sanjoy at azulsystems.com>
Date: Thu Jun 19 15:38:02 2014 -0700
-Subject: [PATCH 1/3] 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.
+ Fix the --enable-shared build.
-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(+)
+ 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.
diff --git a/include/llvm/IR/LegacyPassNameParser.h b/include/llvm/IR/LegacyPassNameParser.h
index e2e4912..a07e3fd 100644
@@ -25,7 +22,7 @@ index e2e4912..a07e3fd 100644
@@ -95,6 +95,8 @@ private:
}
};
-
+
+EXTERN_TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
///===----------------------------------------------------------------------===//
@@ -38,12 +35,9 @@ index 91d86ae..00ce223 100644
@@ -234,6 +234,8 @@ PassNameParser::~PassNameParser() {
// attempting to remove the registration listener is an error.
}
-
+
+TEMPLATE_INSTANTIATION(class cl::parser<const PassInfo *>);
+
//===----------------------------------------------------------------------===//
// AnalysisUsage Class Implementation
//
---
-2.1.4
-
diff --git a/main/llvm/llvm-0002-musl-triple.patch b/main/llvm/llvm-3.6-musl-triple.patch
index 1be21a72c7..08919c680e 100644
--- a/main/llvm/llvm-0002-musl-triple.patch
+++ b/main/llvm/llvm-3.6-musl-triple.patch
@@ -1,23 +1,14 @@
-From b8a0587b17b6c58973bf5463096538a37cc516a5 Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Tue, 28 Apr 2015 20:22:40 -0400
-Subject: [PATCH 2/3] musl triple
-
----
- include/llvm/ADT/Triple.h | 4 ++++
- lib/Support/Triple.cpp | 6 ++++++
- lib/Target/ARM/ARMSubtarget.h | 3 +++
- lib/Target/ARM/ARMTargetMachine.cpp | 2 ++
- 4 files changed, 15 insertions(+)
-
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
-@@ -154,6 +154,10 @@ public:
+@@ -151,12 +151,16 @@ public:
+ GNUX32,
+ CODE16,
+ EABI,
EABIHF,
Android,
-
+
+ Musl,
+ MuslEABI,
+ MuslEABIHF,
@@ -25,11 +16,17 @@ 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
-@@ -175,6 +175,9 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
+@@ -172,12 +172,15 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
+ case GNUEABIHF: return "gnueabihf";
+ case GNUEABI: return "gnueabi";
+ case GNUX32: return "gnux32";
case CODE16: return "code16";
case EABI: return "eabi";
case EABIHF: return "eabihf";
@@ -39,7 +36,13 @@ index 0838e90..4be78e5 100644
case Android: return "android";
case MSVC: return "msvc";
case Itanium: return "itanium";
-@@ -375,6 +378,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
+ 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)
.StartsWith("code16", Triple::CODE16)
.StartsWith("gnu", Triple::GNU)
.StartsWith("android", Triple::Android)
@@ -49,11 +52,18 @@ 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..b330be5 100644
+index dbacd4d..c81e620 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
-@@ -369,8 +369,10 @@ public:
+@@ -366,22 +366,25 @@ public:
+
+ // ARM Targets that support EHABI exception handling standard
+ // Darwin uses SjLj. Other targets might need more checks.
bool isTargetEHABICompatible() const {
return (TargetTriple.getEnvironment() == Triple::EABI ||
TargetTriple.getEnvironment() == Triple::GNUEABI ||
@@ -64,7 +74,8 @@ index dbacd4d..b330be5 100644
TargetTriple.getEnvironment() == Triple::Android) &&
!isTargetDarwin() && !isTargetWindows();
}
-@@ -379,6 +381,7 @@ public:
+
+ bool isTargetHardFloat() const {
// FIXME: this is invalid for WindowsCE
return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
TargetTriple.getEnvironment() == Triple::EABIHF ||
@@ -72,11 +83,17 @@ index dbacd4d..b330be5 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
-@@ -87,6 +87,8 @@ computeTargetABI(const Triple &TT, StringRef CPU,
+@@ -84,12 +84,14 @@ computeTargetABI(const Triple &TT, StringRef CPU,
+ switch (TT.getEnvironment()) {
+ case llvm::Triple::Android:
+ case llvm::Triple::GNUEABI:
case llvm::Triple::GNUEABIHF:
case llvm::Triple::EABIHF:
case llvm::Triple::EABI:
@@ -85,6 +102,6 @@ index 7a8181b..ce5ceb9 100644
TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS;
break;
case llvm::Triple::GNU:
---
-2.1.4
-
+ TargetABI = ARMBaseTargetMachine::ARM_ABI_APCS;
+ break;
+ default:
diff --git a/main/llvm/llvm-0003-musl-hacks.patch b/main/llvm/llvm-3.6-musl.patch
index 7d11534c8d..ba3c49f785 100644
--- a/main/llvm/llvm-0003-musl-hacks.patch
+++ b/main/llvm/llvm-3.6-musl.patch
@@ -1,25 +1,14 @@
-From cbfa6c322a8082ad40e765a73df9ea9bf695cd6f Mon Sep 17 00:00:00 2001
-From: Travis Tilley <ttilley@gmail.com>
-Date: Sat, 9 May 2015 03:43:33 -0400
-Subject: [PATCH 3/3] weirder musl fixes/hacks that would require refactoring
- before being acceptable upstream
-
----
- include/llvm/Target/TargetLibraryInfo.h | 9 +++++++++
- lib/Support/DynamicLibrary.cpp | 2 +-
- lib/Support/Unix/Signals.inc | 2 +-
- lib/Target/TargetLibraryInfo.cpp | 5 +++--
- utils/unittest/googletest/src/gtest.cc | 1 +
- 5 files changed, 15 insertions(+), 4 deletions(-)
-
diff --git a/include/llvm/Target/TargetLibraryInfo.h b/include/llvm/Target/TargetLibraryInfo.h
index 46f87b9..41ac5fd 100644
--- a/include/llvm/Target/TargetLibraryInfo.h
+++ b/include/llvm/Target/TargetLibraryInfo.h
-@@ -13,6 +13,15 @@
+@@ -10,12 +10,21 @@
+ #ifndef LLVM_TARGET_TARGETLIBRARYINFO_H
+ #define LLVM_TARGET_TARGETLIBRARYINFO_H
+
#include "llvm/ADT/DenseMap.h"
#include "llvm/Pass.h"
-
+
+#undef fopen64
+#undef fseeko64
+#undef fstat64
@@ -31,25 +20,37 @@ 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
-@@ -138,7 +138,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
-
+@@ -135,13 +135,13 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
+
+ if (void *Result = llvm::SearchForAddressOfSpecialSymbol(symbolName))
+ return Result;
+
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(symbolName, #SYM)) return &SYM
+ if (!strcmp(symbolName, #SYM)) return (void *) &SYM
-
+
// 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
-@@ -416,7 +416,7 @@ static bool printSymbolizedStackTrace(void **StackTrace, int Depth, FILE *FD) {
+@@ -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.
+ //
// On glibc systems we have the 'backtrace' function, which works nicely, but
// doesn't demangle symbols.
void llvm::sys::PrintStackTrace(FILE *FD) {
@@ -58,13 +59,19 @@ 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
-@@ -664,14 +664,15 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
+@@ -661,20 +661,21 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
+ break;
+ default:
+ TLI.setUnavailable(LibFunc::ffsll);
}
-
+
// The following functions are available on at least Linux:
- if (!T.isOSLinux()) {
+ if (!T.isOSLinux())
@@ -80,18 +87,24 @@ 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
-@@ -120,6 +120,7 @@
-
+@@ -117,12 +117,13 @@
+ #if GTEST_HAS_EXCEPTIONS
+ # include <stdexcept>
+ #endif
+
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
+# include <sys/socket.h> // NOLINT
# include <netdb.h> // NOLINT
#endif
-
---
-2.1.4
+ // 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