diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 8ff8197e8eea..e180543d5310 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -301,7 +301,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // < 3) if (Args.hasFlag(options::OPT_funwind_tables, options::OPT_fno_unwind_tables, - getToolChain().IsUnwindTablesDefault())) + (getToolChain().IsUnwindTablesDefault() && + !Args.hasArg(options::OPT_mkernel)))) CmdArgs.push_back("--unwind-tables=1"); else CmdArgs.push_back("--unwind-tables=0");