Commit a1d93256 authored by Travis Tilley's avatar Travis Tilley Committed by Natanael Copa

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

(cherry picked from commit 08fdc970)

fixes #4235
parent 01e49b90
This diff is collapsed.
......@@ -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
......@@ -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/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index f789fd5..6d75b4b 100644
index 8bd8298..620a44a 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);
}
@@ -2672,6 +2672,7 @@ Tool *Solaris::buildLinker() const {
/// Distribution (very bare-bones at the moment).
enum Distro {
......@@ -13,13 +10,7 @@ index f789fd5..6d75b4b 100644
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;
@@ -2783,6 +2784,9 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
if (llvm::sys::fs::exists("/etc/arch-release"))
return ArchLinux;
......@@ -29,6 +20,5 @@ index f789fd5..6d75b4b 100644
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
--
2.1.4
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/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/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
......@@ -54,5 +54,7 @@ index 75eef9e..3e71522 100644
+ }
+ }
}
static void AddRunTimeLibs(const ToolChain &TC, const Driver &D,
--
2.1.4
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 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/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/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/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/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) ||
......@@ -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/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
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
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
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment