aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2010-10-20 07:00:47 +0000
committerChandler Carruth <chandlerc@gmail.com>2010-10-20 07:00:47 +0000
commitfeee58ce268765742e41c473c8648607fd4831a7 (patch)
tree3de51e3912ae71c0a1c862619f7656a82a53f2d1 /lib/Driver/Tools.cpp
parent4e2cbb28baa0342b51336e55c519cd06308c4df2 (diff)
Add support for the '--sysroot' flag, and an accompanying test of its
interactions with -isysroot and other driver commands. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116912 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 7924a034df..882571fdb2 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -295,6 +295,15 @@ void Clang::AddPreprocessingOptions(const Driver &D,
// -I- is a deprecated GCC feature, reject it.
if (Arg *A = Args.getLastArg(options::OPT_I_))
D.Diag(clang::diag::err_drv_I_dash_not_supported) << A->getAsString(Args);
+
+ // If we have a --sysroot, and don't have an explicit -isysroot flag, add an
+ // -isysroot to the CC1 invocation.
+ if (Arg *A = Args.getLastArg(options::OPT__sysroot_EQ)) {
+ if (!Args.hasArg(options::OPT_isysroot)) {
+ CmdArgs.push_back("-isysroot");
+ CmdArgs.push_back(A->getValue(Args));
+ }
+ }
}
/// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targetting.