зеркало из https://github.com/microsoft/clang-1.git
Rename ANDROIDEABI to Android.
Most of the code guarded with ANDROIDEABI are not ARM-specific, and having no relation with arm-eabi. Thus, it will be more natural to call this environment "Android" instead of "ANDROIDEABI". Note: We are not using ANDROID because several projects are using "-DANDROID" as the conditional compilation flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ca0d10edcf
Коммит
94a7142f74
|
@ -316,7 +316,7 @@ protected:
|
|||
DefineStd(Builder, "linux", Opts);
|
||||
Builder.defineMacro("__gnu_linux__");
|
||||
Builder.defineMacro("__ELF__");
|
||||
if (Triple.getEnvironment() == llvm::Triple::ANDROIDEABI)
|
||||
if (Triple.getEnvironment() == llvm::Triple::Android)
|
||||
Builder.defineMacro("__ANDROID__", "1");
|
||||
if (Opts.POSIXThreads)
|
||||
Builder.defineMacro("_REENTRANT");
|
||||
|
|
|
@ -2576,7 +2576,8 @@ public:
|
|||
bool isEABI() const {
|
||||
StringRef Env =
|
||||
getContext().getTargetInfo().getTriple().getEnvironmentName();
|
||||
return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi");
|
||||
return (Env == "gnueabi" || Env == "eabi" ||
|
||||
Env == "android" || Env == "androideabi");
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -2064,7 +2064,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
|
|||
Arch == llvm::Triple::mips64 ||
|
||||
Arch == llvm::Triple::mips64el;
|
||||
|
||||
const bool IsAndroid = Triple.getEnvironment() == llvm::Triple::ANDROIDEABI;
|
||||
const bool IsAndroid = Triple.getEnvironment() == llvm::Triple::Android;
|
||||
|
||||
// Do not use 'gnu' hash style for Mips targets because .gnu.hash
|
||||
// and the MIPS ABI require .dynsym to be sorted in different ways.
|
||||
|
|
|
@ -643,7 +643,7 @@ static StringRef getARMFloatABI(const Driver &D,
|
|||
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
|
||||
FloatABI = "softfp";
|
||||
break;
|
||||
case llvm::Triple::ANDROIDEABI: {
|
||||
case llvm::Triple::Android: {
|
||||
std::string ArchName =
|
||||
getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
|
||||
if (StringRef(ArchName).startswith("v7"))
|
||||
|
@ -680,7 +680,7 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
|
|||
} else {
|
||||
// Select the default based on the platform.
|
||||
switch(Triple.getEnvironment()) {
|
||||
case llvm::Triple::ANDROIDEABI:
|
||||
case llvm::Triple::Android:
|
||||
case llvm::Triple::GNUEABI:
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
ABIName = "aapcs-linux";
|
||||
|
@ -1406,7 +1406,7 @@ static void addAsanRTLinux(const ToolChain &TC, const ArgList &Args,
|
|||
if (!Args.hasFlag(options::OPT_faddress_sanitizer,
|
||||
options::OPT_fno_address_sanitizer, false))
|
||||
return;
|
||||
if(TC.getTriple().getEnvironment() == llvm::Triple::ANDROIDEABI) {
|
||||
if(TC.getTriple().getEnvironment() == llvm::Triple::Android) {
|
||||
if (!Args.hasArg(options::OPT_shared)) {
|
||||
if (!Args.hasArg(options::OPT_pie))
|
||||
TC.getDriver().Diag(diag::err_drv_asan_android_requires_pie);
|
||||
|
@ -5576,7 +5576,7 @@ void linuxtools::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
|
||||
static void AddLibgcc(llvm::Triple Triple, const Driver &D,
|
||||
ArgStringList &CmdArgs, const ArgList &Args) {
|
||||
bool isAndroid = Triple.getEnvironment() == llvm::Triple::ANDROIDEABI;
|
||||
bool isAndroid = Triple.getEnvironment() == llvm::Triple::Android;
|
||||
bool StaticLibgcc = isAndroid || Args.hasArg(options::OPT_static) ||
|
||||
Args.hasArg(options::OPT_static_libgcc);
|
||||
if (!D.CCCIsCXX)
|
||||
|
@ -5608,7 +5608,7 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
static_cast<const toolchains::Linux&>(getToolChain());
|
||||
const Driver &D = ToolChain.getDriver();
|
||||
const bool isAndroid = ToolChain.getTriple().getEnvironment() ==
|
||||
llvm::Triple::ANDROIDEABI;
|
||||
llvm::Triple::Android;
|
||||
|
||||
ArgStringList CmdArgs;
|
||||
|
||||
|
|
|
@ -367,6 +367,10 @@
|
|||
// RUN: -target arm-linux-androideabi \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target arm-linux-android \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID %s
|
||||
// CHECK-ANDROID: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
||||
// CHECK-ANDROID: "{{.*}}/crtbegin_dynamic.o"
|
||||
// CHECK-ANDROID: "-L[[SYSROOT]]/usr/lib"
|
||||
|
@ -379,6 +383,11 @@
|
|||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: -shared \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target arm-linux-android \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: -shared \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-SO %s
|
||||
// CHECK-ANDROID-SO: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
||||
// CHECK-ANDROID-SO: "{{.*}}/crtbegin_so.o"
|
||||
// CHECK-ANDROID-SO: "-L[[SYSROOT]]/usr/lib"
|
||||
|
@ -391,6 +400,11 @@
|
|||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: -static \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
|
||||
// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
|
||||
// RUN: -target arm-linux-android \
|
||||
// RUN: --sysroot=%S/Inputs/basic_android_tree \
|
||||
// RUN: -static \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-ANDROID-STATIC %s
|
||||
// CHECK-ANDROID-STATIC: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
||||
// CHECK-ANDROID-STATIC: "{{.*}}/crtbegin_static.o"
|
||||
// CHECK-ANDROID-STATIC: "-L[[SYSROOT]]/usr/lib"
|
||||
|
|
Загрузка…
Ссылка в новой задаче