Pass dwarf-version to cc1as.

Fix PR26999 - crashing in cc1as with any '*bsd' target.

llvm-svn: 266775
This commit is contained in:
Douglas Katzman 2016-04-19 17:43:54 +00:00
parent d5cb34118d
commit 5a9a685405
2 changed files with 11 additions and 0 deletions

View File

@ -6314,6 +6314,12 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
// FIXME: Stop lying and consume only the appropriate driver flags
Args.ClaimAllArgs(options::OPT_W_Group);
// Assemblers that want to know the dwarf version can't assume a value,
// since the defaulting logic resides in the driver. Put in something
// reasonable now, in case a subsequent "-Wa,-g" changes it.
RenderDebugEnablingArgs(Args, CmdArgs, codegenoptions::NoDebugInfo,
getToolChain().GetDefaultDwarfVersion(),
llvm::DebuggerKind::Default);
CollectArgsForIntegratedAssembler(C, Args, CmdArgs,
getToolChain().getDriver());

View File

@ -77,3 +77,8 @@
// CHECK-OBJ-NOO: "-o" "save-temps.s"
// CHECK-OBJ-NOO: "-o" "save-temps.o"
// CHECK-OBJ-NOO: "-o" "a.out"
// RUN: %clang -target i386-unknown-freebsd -save-temps -g -c %s -### 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-SAVE-TEMPS
// CHECK-SAVE-TEMPS: "-cc1as"
// CHECK-SAVE-TEMPS: "-dwarf-version={{.}}"