From 3fd823b0625eba87153fe592a0fd12e088db3b36 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 30 Apr 2011 04:20:40 +0000 Subject: [PATCH] Driver/Darwin: Reject invalid arch combinations with -mios-simulator-version-min. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130593 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticDriverKinds.td | 2 ++ lib/Driver/ToolChains.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td index 75d9821030..908a69b162 100644 --- a/include/clang/Basic/DiagnosticDriverKinds.td +++ b/include/clang/Basic/DiagnosticDriverKinds.td @@ -80,6 +80,8 @@ def err_drv_preamble_format : Error< "incorrect format for -preamble-bytes=N,END">; def err_drv_conflicting_deployment_targets : Error< "conflicting deployment targets, both '%0' and '%1' are present in environment">; +def err_drv_invalid_arch_for_deployment_target : Error< + "invalid architecture '%0' for deployment target '%1'">; def warn_c_kext : Warning< "ignoring -fapple-kext which is valid for c++ and objective-c++ only">; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 838e5bf2eb..7f464c6944 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -457,6 +457,13 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { } } + // Reject invalid architecture combinations. + if (iOSSimVersion && (getTriple().getArch() != llvm::Triple::x86 && + getTriple().getArch() != llvm::Triple::x86_64)) { + getDriver().Diag(clang::diag::err_drv_invalid_arch_for_deployment_target) + << getTriple().getArchName() << iOSSimVersion->getAsString(Args); + } + // Set the tool chain target information. unsigned Major, Minor, Micro; bool HadExtra; -- 2.40.0