This revision was automatically updated to reflect the committed changes. Closed by commit rL285127: Use linker flag --fix-cortex-a53-843419 on Android ARM64 compilation. (authored by srhines).
Changed prior to commit: https://reviews.llvm.org/D25761?vs=75174&id=75801#toc Repository: rL LLVM https://reviews.llvm.org/D25761 Files: cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/test/Driver/android-aarch64-link.cpp Index: cfe/trunk/test/Driver/android-aarch64-link.cpp =================================================================== --- cfe/trunk/test/Driver/android-aarch64-link.cpp +++ cfe/trunk/test/Driver/android-aarch64-link.cpp @@ -0,0 +1,17 @@ +// Check that we automatically add relevant linker flags for Android aarch64. + +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -### -v %s 2> %t +// RUN: FileCheck -check-prefix=GENERIC-ARM < %t %s +// +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -mcpu=cortex-a53 -### -v %s 2> %t +// RUN: FileCheck -check-prefix=CORTEX-A53 < %t %s +// +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -mcpu=cortex-a57 -### -v %s 2> %t +// RUN: FileCheck -check-prefix=CORTEX-A57 < %t %s +// +// GENERIC-ARM: --fix-cortex-a53-843419 +// CORTEX-A53: --fix-cortex-a53-843419 +// CORTEX-A57-NOT: --fix-cortex-a53-843419 Index: cfe/trunk/lib/Driver/Tools.cpp =================================================================== --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -9712,6 +9712,14 @@ if (Arch == llvm::Triple::armeb || Arch == llvm::Triple::thumbeb) arm::appendEBLinkFlags(Args, CmdArgs, Triple); + // Most Android ARM64 targets should enable the linker fix for erratum + // 843419. Only non-Cortex-A53 devices are allowed to skip this flag. + if (Arch == llvm::Triple::aarch64 && isAndroid) { + std::string CPU = getCPUName(Args, Triple); + if (CPU.empty() || CPU == "generic" || CPU == "cortex-a53") + CmdArgs.push_back("--fix-cortex-a53-843419"); + } + for (const auto &Opt : ToolChain.ExtraOpts) CmdArgs.push_back(Opt.c_str());
Index: cfe/trunk/test/Driver/android-aarch64-link.cpp =================================================================== --- cfe/trunk/test/Driver/android-aarch64-link.cpp +++ cfe/trunk/test/Driver/android-aarch64-link.cpp @@ -0,0 +1,17 @@ +// Check that we automatically add relevant linker flags for Android aarch64. + +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -### -v %s 2> %t +// RUN: FileCheck -check-prefix=GENERIC-ARM < %t %s +// +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -mcpu=cortex-a53 -### -v %s 2> %t +// RUN: FileCheck -check-prefix=CORTEX-A53 < %t %s +// +// RUN: %clang -target aarch64-none-linux-android \ +// RUN: -mcpu=cortex-a57 -### -v %s 2> %t +// RUN: FileCheck -check-prefix=CORTEX-A57 < %t %s +// +// GENERIC-ARM: --fix-cortex-a53-843419 +// CORTEX-A53: --fix-cortex-a53-843419 +// CORTEX-A57-NOT: --fix-cortex-a53-843419 Index: cfe/trunk/lib/Driver/Tools.cpp =================================================================== --- cfe/trunk/lib/Driver/Tools.cpp +++ cfe/trunk/lib/Driver/Tools.cpp @@ -9712,6 +9712,14 @@ if (Arch == llvm::Triple::armeb || Arch == llvm::Triple::thumbeb) arm::appendEBLinkFlags(Args, CmdArgs, Triple); + // Most Android ARM64 targets should enable the linker fix for erratum + // 843419. Only non-Cortex-A53 devices are allowed to skip this flag. + if (Arch == llvm::Triple::aarch64 && isAndroid) { + std::string CPU = getCPUName(Args, Triple); + if (CPU.empty() || CPU == "generic" || CPU == "cortex-a53") + CmdArgs.push_back("--fix-cortex-a53-843419"); + } + for (const auto &Opt : ToolChain.ExtraOpts) CmdArgs.push_back(Opt.c_str());
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits