Index: lib/Driver/ToolChains/Clang.cpp =================================================================== --- lib/Driver/ToolChains/Clang.cpp +++ lib/Driver/ToolChains/Clang.cpp @@ -566,6 +566,17 @@ } } + if (Triple.getEnvironment() == llvm::Triple::EABI) { + switch (Triple.getArch()) { + case llvm::Triple::arm: + case llvm::Triple::thumb: + // ARM EABI doesn't require a frame pointer + return !areOptimizationsEnabled(Args); + default: + return true; + } + } + return true; } Index: test/Driver/frame-pointer.c =================================================================== --- test/Driver/frame-pointer.c +++ test/Driver/frame-pointer.c @@ -33,6 +33,9 @@ // RUN: %clang -target mips64el-linux-gnu -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s // RUN: %clang -target mips64el-linux-gnu -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s +// RUN: %clang -target arm-none-eabi -### -S -O0 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK0-32 %s +// RUN: %clang -target arm-none-eabi -### -S -O1 %s -o %t.s 2>&1 | FileCheck -check-prefix=CHECK1-32 %s + // CHECK0-32: -mdisable-fp-elim // CHECK1-32-NOT: -mdisable-fp-elim // CHECK2-32-NOT: -mdisable-fp-elim