aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'main/llvm')
-rw-r--r--main/llvm/APKBUILD32
-rw-r--r--main/llvm/llvm-alpine-linux.patch180
-rw-r--r--main/llvm/llvm-musl.patch194
3 files changed, 185 insertions, 221 deletions
diff --git a/main/llvm/APKBUILD b/main/llvm/APKBUILD
index 98788c41be..89c3840650 100644
--- a/main/llvm/APKBUILD
+++ b/main/llvm/APKBUILD
@@ -1,7 +1,7 @@
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=llvm
-pkgver=3.4.2
+pkgver=3.5.0
pkgrel=0
pkgdesc="low level virtual machine compiler system"
arch="x86 x86_64 armhf"
@@ -12,11 +12,12 @@ depends_dev="perl"
makedepends="$depends_dev groff libffi-dev python chrpath"
install=
subpackages="clang $pkgname-dev $pkgname-doc $pkgname-libs"
-source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.gz
- http://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.gz
+source="http://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz
+ http://llvm.org/releases/$pkgver/cfe-$pkgver.src.tar.xz
llvm-alpine-linux.patch
llvm-musl.patch
"
+
# clang hardcodes linker paths; and don't know of a fix like the --with-dynamic-linker
# patch we use for gcc. So llvm-3.2-alpine-linux.patch needs to be updated if/when the
# uClibc ABI version (as of uClibc 0.9.33.2, this is 0.9.32) increases.
@@ -52,7 +53,6 @@ build() {
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 \
- ../$pkgname-$pkgver.src/projects/sample/autoconf/config.guess \
|| return 1
$_srcdir/configure \
@@ -108,15 +108,15 @@ libs() {
mv "$pkgdir"/usr/lib/*.so "$subpkgdir"/usr/lib/
}
-md5sums="a20669f75967440de949ac3b1bad439c llvm-3.4.2.src.tar.gz
-87945973b7c73038871c5f849a818588 cfe-3.4.2.src.tar.gz
-524a204746c423bae0b041e4b409a687 llvm-alpine-linux.patch
-69892689105e1698988b5be3a763b511 llvm-musl.patch"
-sha256sums="17038d47069ad0700c063caed76f0c7259628b0e79651ce2b540d506f2f1efd7 llvm-3.4.2.src.tar.gz
-5ba6f5772f8d00f445209356a7daf83c5bca2da5acd10de517ad2359ae95bc10 cfe-3.4.2.src.tar.gz
-c741573b6495d307085cf06bfc7d315bd3d6ef92fbb01e4c09cd5f1d84840a6a llvm-alpine-linux.patch
-69bf4a102d50e31853371883da1062560bdf7894bdb289c0a9522a214e0473c8 llvm-musl.patch"
-sha512sums="6c1453f7d9d9110257db3574cc4f6227fed8938705cbb09851ac09a868089b48f1556a1b6e758aff6d97520b08b5605d3ed20411ad9dd22cdc573d62176905f0 llvm-3.4.2.src.tar.gz
-e01fa8e312e9b3b7b3cb572ac21349161aaa50078ecfe7bded273b75db4a0c44acde524f8fdfcbeec54c61eeeb8339e9917d1f205a8fda18e34fe7ccbe89c36d cfe-3.4.2.src.tar.gz
-fc566961272054e7415d0215712fd6d986341850d9281ccbcfc861c320bac6d9f3bac90571f2b72e940be4f843ad6e9133446d9fce0770514ccf39ad923bc0c8 llvm-alpine-linux.patch
-3049ad58c65791549cc696edc5920a1a2fabf87808c92a4c3fc5b70ee88745df63e2f0fd38be50e9df2055d05d922d2ccb3fe2542e9f31b4133c47c2f2b0fa93 llvm-musl.patch"
+md5sums="d6987305a1a0e58e128c1374cd3b8fef llvm-3.5.0.src.tar.xz
+27718dd13c7df83e15f997116bbb4aef cfe-3.5.0.src.tar.xz
+6027b00815344fe834e3e3208fc471d9 llvm-alpine-linux.patch
+832e665e4972afb94fb6c976a7e35c69 llvm-musl.patch"
+sha256sums="28e199f368ef0a4666708f31c7991ad3bcc3a578342b0306526dd35f07595c03 llvm-3.5.0.src.tar.xz
+fc80992e004b06f6c7afb612de1cdaa9ac9d25811c55f94fcf7331d9b81cdb8b cfe-3.5.0.src.tar.xz
+789ae8672503be241ef371933795cee148cbc16c3b633c37344ea7b4aef89189 llvm-alpine-linux.patch
+1e4c4d9e2d76719c2fedc6fe1ce03e59a16521bdb2562e84255a82d510a4f894 llvm-musl.patch"
+sha512sums="b4d0f325dbdb0a8f10e5fd031954ef4b1971d8f99f4e4b53834801a2b74a7acde3f77c655c8355b407424b363edfb10f71d85fc370356dc52af5c636a1bba197 llvm-3.5.0.src.tar.xz
+b26a5e2cd81c150607c23b22fafc0d9c7f12b83b45e476b8e75bf5e99d42be7c98ffeac7349df664f01b00900864a01429860b298e48961861377a4b2daf3e49 cfe-3.5.0.src.tar.xz
+65a74090d6541e105220e79944181dca15aca258178a755ac42b7066277202b59836998a27856bab57cf76200a4e538124a6110ea8bcdc15b0abf2508a6e681d llvm-alpine-linux.patch
+e9531f86521628a1f0b73e15da55c6d51c7283a0239bc481b89a73c5195ae605b6680e75cbcd9197b71ceab534082f86e0e4d39701edcbe9195cc01df97285b9 llvm-musl.patch"
diff --git a/main/llvm/llvm-alpine-linux.patch b/main/llvm/llvm-alpine-linux.patch
index 8bef4b1777..d096916731 100644
--- a/main/llvm/llvm-alpine-linux.patch
+++ b/main/llvm/llvm-alpine-linux.patch
@@ -1,69 +1,102 @@
---- a/include/llvm/ADT/Triple.h
-+++ b/include/llvm/ADT/Triple.h
-@@ -117,7 +117,10 @@
- EABI,
- MachO,
+diff -ru llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h llvm-3.5.0.src/include/llvm/ADT/Triple.h
+--- llvm-3.5.0.src.orig/include/llvm/ADT/Triple.h 2014-07-18 17:28:19.000000000 -0300
++++ llvm-3.5.0.src/include/llvm/ADT/Triple.h 2014-11-12 14:44:41.738448045 -0200
+@@ -149,6 +149,10 @@
+ EABIHF,
Android,
-- ELF
-+ ELF,
+
+ Musl,
+ MuslEABI,
-+ MuslEABIHF
- };
-
- private:
---- a/lib/Support/Triple.cpp.orig
-+++ b/lib/Support/Triple.cpp
-@@ -153,6 +153,9 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
- case MachO: return "macho";
- case Android: return "android";
- case ELF: return "elf";
++ MuslEABIHF,
++
+ MSVC,
+ Itanium,
+ Cygnus,
+Only in llvm-3.5.0.src/include/llvm/ADT: Triple.h.orig
+diff -ru llvm-3.5.0.src.orig/lib/Support/Triple.cpp llvm-3.5.0.src/lib/Support/Triple.cpp
+--- llvm-3.5.0.src.orig/lib/Support/Triple.cpp 2014-07-18 17:28:19.000000000 -0300
++++ llvm-3.5.0.src/lib/Support/Triple.cpp 2014-11-12 14:47:06.565122146 -0200
+@@ -168,6 +168,9 @@
+ case CODE16: return "code16";
+ case EABI: return "eabi";
+ case EABIHF: return "eabihf";
+ case Musl: return "musl";
-+ case MuslEABI: return "muslgnueabi";
-+ case MuslEABIHF: return "muslgnueabihf";
- }
-
- llvm_unreachable("Invalid EnvironmentType!");
-@@ -305,6 +308,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
- .StartsWith("macho", Triple::MachO)
- .StartsWith("android", Triple::Android)
- .StartsWith("elf", Triple::ELF)
-+ .StartsWith("muslgnueabihf", Triple::MuslEABIHF)
-+ .StartsWith("muslgnueabi", Triple::MuslEABI)
++ case MuslEABI: return "musleabi";
++ case MuslEABIHF: return "musleabihf";
+ case Android: return "android";
+ case MSVC: return "msvc";
+ case Itanium: return "itanium";
+@@ -344,6 +347,9 @@
+ .StartsWith("gnux32", Triple::GNUX32)
+ .StartsWith("code16", Triple::CODE16)
+ .StartsWith("gnu", Triple::GNU)
+ .StartsWith("musl", Triple::Musl)
- .Default(Triple::UnknownEnvironment);
- }
-
---- a/tools/clang/lib/Driver/ToolChains.cpp
-+++ b/tools/clang/lib/Driver/ToolChains.cpp
-@@ -1118,20 +1118,23 @@ void Generic_GCC::GCCInstallationDetector::print(raw_ostream &OS) const {
++ .StartsWith("musleabi", Triple::MuslEABI)
++ .StartsWith("musleabihf", Triple::MuslEABIHF)
+ .StartsWith("android", Triple::Android)
+ .StartsWith("msvc", Triple::MSVC)
+ .StartsWith("itanium", Triple::Itanium)
+Only in llvm-3.5.0.src/lib/Support: Triple.cpp.orig
+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp
+--- llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.cpp 2014-07-16 23:13:31.000000000 -0300
++++ llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.cpp 2014-11-12 14:50:40.025133104 -0200
+@@ -273,6 +273,8 @@
+ case Triple::EABIHF:
+ case Triple::GNUEABI:
+ case Triple::GNUEABIHF:
++ case Triple::MuslEABI:
++ case Triple::MuslEABIHF:
+ TargetABI = ARM_ABI_AAPCS;
+ break;
+ default:
+diff -ru llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h
+--- llvm-3.5.0.src.orig/lib/Target/ARM/ARMSubtarget.h 2014-07-16 23:13:31.000000000 -0300
++++ llvm-3.5.0.src/lib/Target/ARM/ARMSubtarget.h 2014-11-12 14:53:36.571808822 -0200
+@@ -372,8 +372,10 @@
+ bool isTargetEHABICompatible() const {
+ return (TargetTriple.getEnvironment() == Triple::EABI ||
+ TargetTriple.getEnvironment() == Triple::GNUEABI ||
++ TargetTriple.getEnvironment() == Triple::MuslEABI ||
+ TargetTriple.getEnvironment() == Triple::EABIHF ||
+ TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
++ TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
+ TargetTriple.getEnvironment() == Triple::Android) &&
+ !isTargetDarwin() && !isTargetWindows();
+ }
+diff -ru llvm-3.5.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp llvm-3.5.0.src/tools/clang/lib/Driver/ToolChains.cpp
+--- llvm-3.5.0.src.orig/tools/clang/lib/Driver/ToolChains.cpp 2014-08-27 23:07:31.000000000 -0300
++++ llvm-3.5.0.src/tools/clang/lib/Driver/ToolChains.cpp 2014-11-12 15:09:14.805190323 -0200
+@@ -1324,7 +1324,9 @@
static const char *const ARMTriples[] = { "arm-linux-gnueabi",
"arm-linux-androideabi" };
static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf",
- "armv7hl-redhat-linux-gnueabi" };
+ "armv7hl-redhat-linux-gnueabi",
-+ "armv6-alpine-linux-muslgnueabihf",
-+ "armv7-alpine-linux-muslgnueabihf" };
-
- static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
- static const char *const X86_64Triples[] = {
++ "armv6-alpine-linux-muslgnueabihf",
++ "armv7-alpine-linux-muslgnueabihf" };
+ static const char *const ARMebLibDirs[] = { "/lib" };
+ static const char *const ARMebTriples[] = { "armeb-linux-gnueabi",
+ "armeb-linux-androideabi" };
+@@ -1336,7 +1338,7 @@
"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"
-+ "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux",
-+ "x86_64-alpine-linux-musl"
+ "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", "x86_64-slackware-linux",
+- "x86_64-linux-android", "x86_64-unknown-linux"
++ "x86_64-linux-android", "x86_64-alpine-linux-musl", "x86_64-unknown-linux"
};
+ static const char *const X32LibDirs[] = { "/libx32" };
static const char *const X86LibDirs[] = { "/lib32", "/lib" };
- static const char *const X86Triples[] = {
+@@ -1344,7 +1346,8 @@
"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",
-- "i686-montavista-linux"
-+ "i686-montavista-linux", "i486-alpine-linux-musl"
+- "i686-montavista-linux", "i686-linux-android", "i586-linux-gnu"
++ "i686-montavista-linux", "i686-linux-android", "i586-linux-gnu",
++ "i486-alpine-linux-musl"
};
static const char *const MIPSLibDirs[] = { "/lib" };
-@@ -2166,6 +2169,7 @@ Tool *Solaris::buildLinker() const {
+@@ -2777,6 +2780,7 @@
/// Distribution (very bare-bones at the moment).
enum Distro {
@@ -71,7 +104,7 @@
ArchLinux,
DebianLenny,
DebianSqueeze,
-@@ -2276,6 +2280,9 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
+@@ -2888,6 +2892,9 @@
if (llvm::sys::fs::exists("/etc/arch-release"))
return ArchLinux;
@@ -81,24 +114,37 @@
return UnknownDistro;
}
---- a/tools/clang/lib/Driver/Tools.cpp
-+++ b/tools/clang/lib/Driver/Tools.cpp
-@@ -6355,16 +6355,28 @@ static StringRef getLinuxDynamicLinker(const ArgList &Args,
- const toolchains::Linux &ToolChain) {
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::Android)
- return "/system/bin/linker";
-- else if (ToolChain.getArch() == llvm::Triple::x86)
-- return "/lib/ld-linux.so.2";
-- else if (ToolChain.getArch() == llvm::Triple::aarch64)
-+ else if (ToolChain.getArch() == llvm::Triple::x86) {
+@@ -3042,7 +3049,7 @@
+
+ Distro Distro = DetectDistro(Arch);
+
+- if (IsOpenSUSE(Distro) || IsUbuntu(Distro)) {
++ if (IsOpenSUSE(Distro) || IsUbuntu(Distro) || Distro == AlpineLinux) {
+ ExtraOpts.push_back("-z");
+ ExtraOpts.push_back("relro");
+ }
+diff -ru llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp
+--- llvm-3.5.0.src.orig/tools/clang/lib/Driver/Tools.cpp 2014-08-07 07:51:51.000000000 -0300
++++ llvm-3.5.0.src/tools/clang/lib/Driver/Tools.cpp 2014-11-12 15:11:31.901864030 -0200
+@@ -7182,8 +7182,14 @@
+ return "/system/bin/linker64";
+ else
+ return "/system/bin/linker";
+- } else if (ToolChain.getArch() == llvm::Triple::x86 ||
+- ToolChain.getArch() == llvm::Triple::sparc)
++ } else if (ToolChain.getArch() == llvm::Triple::x86) {
+ switch (ToolChain.getTriple().getEnvironment()) {
+ case llvm::Triple::Musl:
+ return "/lib/ld-musl-i386.so.1";
+ default:
+ return "/lib/ld-linux.so.2";
+ }
-+ } else if (ToolChain.getArch() == llvm::Triple::aarch64)
- return "/lib/ld-linux-aarch64.so.1";
++ } else if (ToolChain.getArch() == llvm::Triple::sparc)
+ return "/lib/ld-linux.so.2";
+ else if (ToolChain.getArch() == llvm::Triple::aarch64 ||
+ ToolChain.getArch() == llvm::Triple::arm64)
+@@ -7193,10 +7199,17 @@
+ return "/lib/ld-linux-aarch64_be.so.1";
else if (ToolChain.getArch() == llvm::Triple::arm ||
ToolChain.getArch() == llvm::Triple::thumb) {
- if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
@@ -114,13 +160,13 @@
+ default:
return "/lib/ld-linux.so.3";
+ }
- } else if (ToolChain.getArch() == llvm::Triple::mips ||
- ToolChain.getArch() == llvm::Triple::mipsel)
- return "/lib/ld.so.1";
-@@ -6380,8 +6392,14 @@ static StringRef getLinuxDynamicLinker(const ArgList &Args,
- ToolChain.getArch() == llvm::Triple::ppc64le ||
- ToolChain.getArch() == llvm::Triple::systemz)
- return "/lib64/ld64.so.1";
+ } else if (ToolChain.getArch() == llvm::Triple::armeb ||
+ ToolChain.getArch() == llvm::Triple::thumbeb) {
+ if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+@@ -7227,8 +7240,14 @@
+ else if (ToolChain.getArch() == llvm::Triple::x86_64 &&
+ ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUX32)
+ return "/libx32/ld-linux-x32.so.2";
- else
- return "/lib64/ld-linux-x86-64.so.2";
+ else {
@@ -133,4 +179,4 @@
+ }
}
- void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA,
+ static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
diff --git a/main/llvm/llvm-musl.patch b/main/llvm/llvm-musl.patch
index 581128c00e..b6a3e216f0 100644
--- a/main/llvm/llvm-musl.patch
+++ b/main/llvm/llvm-musl.patch
@@ -1,6 +1,26 @@
---- a/lib/Support/DynamicLibrary.cpp (revision 170294)
-+++ b/lib/Support/DynamicLibrary.cpp (working copy)
-@@ -155,7 +155,7 @@
+diff -ru llvm-3.5.0.src.orig/include/llvm/Target/TargetLibraryInfo.h llvm-3.5.0.src/include/llvm/Target/TargetLibraryInfo.h
+--- llvm-3.5.0.src.orig/include/llvm/Target/TargetLibraryInfo.h 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/include/llvm/Target/TargetLibraryInfo.h 2014-11-13 12:52:35.078889077 +0000
+@@ -13,6 +13,15 @@
+ #include "llvm/ADT/DenseMap.h"
+ #include "llvm/Pass.h"
+
++#undef fopen64
++#undef fseeko64
++#undef fstat64
++#undef fstatvfs64
++#undef ftello64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ namespace llvm {
+ class Triple;
+
+diff -ru llvm-3.5.0.src.orig/lib/Support/DynamicLibrary.cpp llvm-3.5.0.src/lib/Support/DynamicLibrary.cpp
+--- llvm-3.5.0.src.orig/lib/Support/DynamicLibrary.cpp 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Support/DynamicLibrary.cpp 2014-11-13 12:52:07.781720766 +0000
+@@ -138,7 +138,7 @@
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
@@ -9,58 +29,10 @@
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
---- a/utils/unittest/googletest/src/gtest.cc
-+++ b/utils/unittest/googletest/src/gtest.cc
-@@ -120,6 +120,7 @@
-
- #if GTEST_CAN_STREAM_RESULTS_
- # include <arpa/inet.h> // NOLINT
-+# include <sys/socket.h> // NOLINT
- # include <netdb.h> // NOLINT
- #endif
-
---- a/include/llvm/Target/TargetLibraryInfo.h
-+++ b/include/llvm/Target/TargetLibraryInfo.h
-@@ -243,8 +243,6 @@ namespace llvm {
- fmodl,
- /// FILE *fopen(const char *filename, const char *mode);
- fopen,
-- /// FILE *fopen64(const char *filename, const char *opentype)
-- fopen64,
- /// int fprintf(FILE *stream, const char *format, ...);
- fprintf,
- /// int fputc(int c, FILE *stream);
-@@ -267,8 +265,6 @@ namespace llvm {
- fseek,
- /// int fseeko(FILE *stream, off_t offset, int whence);
- fseeko,
-- /// int fseeko64(FILE *stream, off64_t offset, int whence)
-- fseeko64,
- /// int fsetpos(FILE *stream, const fpos_t *pos);
- fsetpos,
- /// int fstat(int fildes, struct stat *buf);
-@@ -283,8 +279,6 @@ namespace llvm {
- ftell,
- /// off_t ftello(FILE *stream);
- ftello,
-- /// off64_t ftello64(FILE *stream)
-- ftello64,
- /// int ftrylockfile(FILE *file);
- ftrylockfile,
- /// void funlockfile(FILE *file);
-@@ -588,8 +582,6 @@ namespace llvm {
- times,
- /// FILE *tmpfile(void);
- tmpfile,
-- /// FILE *tmpfile64(void)
-- tmpfile64,
- /// int toascii(int c);
- toascii,
- /// double trunc(double x);
-
---- a/lib/Support/Unix/Signals.inc
-+++ b/lib/Support/Unix/Signals.inc
-@@ -268,7 +268,7 @@ void llvm::sys::AddSignalHandler(void (*FnPtr)(void *), void *Cookie) {
+diff -ru llvm-3.5.0.src.orig/lib/Support/Unix/Signals.inc llvm-3.5.0.src/lib/Support/Unix/Signals.inc
+--- llvm-3.5.0.src.orig/lib/Support/Unix/Signals.inc 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Support/Unix/Signals.inc 2014-11-13 12:52:07.781720766 +0000
+@@ -266,7 +266,7 @@
// On glibc systems we have the 'backtrace' function, which works nicely, but
// doesn't demangle symbols.
void llvm::sys::PrintStackTrace(FILE *FD) {
@@ -69,89 +41,35 @@
static void* StackTrace[256];
// Use backtrace() to output a backtrace on Linux systems with glibc.
int depth = backtrace(StackTrace,
---- a/lib/Target/TargetLibraryInfo.cpp
-+++ b/lib/Target/TargetLibraryInfo.cpp
-@@ -136,7 +136,6 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
- "fmodf",
- "fmodl",
- "fopen",
-- "fopen64",
- "fprintf",
- "fputc",
- "fputs",
-@@ -148,7 +147,6 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
- "fscanf",
- "fseek",
- "fseeko",
-- "fseeko64",
- "fsetpos",
- "fstat",
- "fstat64",
-@@ -156,7 +154,6 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
- "fstatvfs64",
- "ftell",
- "ftello",
-- "ftello64",
- "ftrylockfile",
- "funlockfile",
- "fwrite",
-@@ -306,7 +303,6 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
- "tanl",
- "times",
- "tmpfile",
-- "tmpfile64",
- "toascii",
- "trunc",
- "truncf",
-@@ -566,16 +562,12 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
+diff -ru llvm-3.5.0.src.orig/lib/Target/TargetLibraryInfo.cpp llvm-3.5.0.src/lib/Target/TargetLibraryInfo.cpp
+--- llvm-3.5.0.src.orig/lib/Target/TargetLibraryInfo.cpp 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/lib/Target/TargetLibraryInfo.cpp 2014-11-13 12:52:07.785054160 +0000
+@@ -653,14 +653,15 @@
+ }
+
+ // The following functions are available on at least Linux:
+- if (!T.isOSLinux()) {
++ if (!T.isOSLinux())
++ TLI.setUnavailable(LibFunc::memalign);
++ if (1 /*!T.isGlibc()*/) {
+ TLI.setUnavailable(LibFunc::dunder_strdup);
+ TLI.setUnavailable(LibFunc::dunder_strtok_r);
+ TLI.setUnavailable(LibFunc::dunder_isoc99_scanf);
+ TLI.setUnavailable(LibFunc::dunder_isoc99_sscanf);
TLI.setUnavailable(LibFunc::under_IO_getc);
TLI.setUnavailable(LibFunc::under_IO_putc);
- TLI.setUnavailable(LibFunc::memalign);
-- TLI.setUnavailable(LibFunc::fopen64);
-- TLI.setUnavailable(LibFunc::fseeko64);
+- TLI.setUnavailable(LibFunc::memalign);
+ TLI.setUnavailable(LibFunc::fopen64);
+ TLI.setUnavailable(LibFunc::fseeko64);
TLI.setUnavailable(LibFunc::fstat64);
- TLI.setUnavailable(LibFunc::fstatvfs64);
-- TLI.setUnavailable(LibFunc::ftello64);
- TLI.setUnavailable(LibFunc::lstat64);
- TLI.setUnavailable(LibFunc::open64);
- TLI.setUnavailable(LibFunc::stat64);
- TLI.setUnavailable(LibFunc::statvfs64);
-- TLI.setUnavailable(LibFunc::tmpfile64);
- }
- }
-
---- a/lib/Transforms/IPO/FunctionAttrs.cpp
-+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
-@@ -1599,32 +1599,6 @@ bool FunctionAttrs::inferPrototypeAttributes(Function &F) {
- setOnlyReadsMemory(F, 1);
- setOnlyReadsMemory(F, 2);
- break;
-- case LibFunc::fopen64:
-- if (FTy->getNumParams() != 2 ||
-- !FTy->getReturnType()->isPointerTy() ||
-- !FTy->getParamType(0)->isPointerTy() ||
-- !FTy->getParamType(1)->isPointerTy())
-- return false;
-- setDoesNotThrow(F);
-- setDoesNotAlias(F, 0);
-- setDoesNotCapture(F, 1);
-- setDoesNotCapture(F, 2);
-- setOnlyReadsMemory(F, 1);
-- setOnlyReadsMemory(F, 2);
-- break;
-- case LibFunc::fseeko64:
-- case LibFunc::ftello64:
-- if (FTy->getNumParams() == 0 || !FTy->getParamType(0)->isPointerTy())
-- return false;
-- setDoesNotThrow(F);
-- setDoesNotCapture(F, 1);
-- break;
-- case LibFunc::tmpfile64:
-- if (!FTy->getReturnType()->isPointerTy())
-- return false;
-- setDoesNotThrow(F);
-- setDoesNotAlias(F, 0);
-- break;
- case LibFunc::fstat64:
- case LibFunc::fstatvfs64:
- if (FTy->getNumParams() != 2 || !FTy->getParamType(1)->isPointerTy())
+diff -ru llvm-3.5.0.src.orig/utils/unittest/googletest/src/gtest.cc llvm-3.5.0.src/utils/unittest/googletest/src/gtest.cc
+--- llvm-3.5.0.src.orig/utils/unittest/googletest/src/gtest.cc 2014-11-13 12:51:53.341455401 +0000
++++ llvm-3.5.0.src/utils/unittest/googletest/src/gtest.cc 2014-11-13 12:52:07.785054160 +0000
+@@ -120,6 +120,7 @@
+
+ #if GTEST_CAN_STREAM_RESULTS_
+ # include <arpa/inet.h> // NOLINT
++# include <sys/socket.h> // NOLINT
+ # include <netdb.h> // NOLINT
+ #endif
+