diff options
| author | Adrian Prantl <aprantl@apple.com> | 2016-04-19 20:31:19 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2016-04-19 20:31:19 +0000 |
| commit | ae39ccc49f8d5a9451353a89958183c4bfa6e6b8 (patch) | |
| tree | cfb082728b61cf7ab52ddd8bf759f2f014b48a6f | |
| parent | 04ccbd40533450fad13f027ed53eab813fe50991 (diff) | |
| download | bcm5719-llvm-ae39ccc49f8d5a9451353a89958183c4bfa6e6b8.tar.gz bcm5719-llvm-ae39ccc49f8d5a9451353a89958183c4bfa6e6b8.zip | |
cc1as: Don't crash when CIE is requested and no DWARF version is specified.
This patch changes the default DWARF version for cc1as from invalid 0 to 2,
which should be the lowest common denominator on all platforms.
rdar://problem/24735813
llvm-svn: 266814
| -rw-r--r-- | clang/test/Driver/as-dwarf-cie.s | 37 | ||||
| -rw-r--r-- | clang/tools/driver/cc1as_main.cpp | 2 |
2 files changed, 38 insertions, 1 deletions
diff --git a/clang/test/Driver/as-dwarf-cie.s b/clang/test/Driver/as-dwarf-cie.s new file mode 100644 index 00000000000..73d987afd42 --- /dev/null +++ b/clang/test/Driver/as-dwarf-cie.s @@ -0,0 +1,37 @@ +# REQUIRES: x86-registered-target +# Test that there is a sane default CIE version. +# RUN: %clang -cc1as -triple i386-apple-darwin -filetype obj %s -o %t +# RUN: llvm-objdump -dwarf=frames %t | FileCheck %s +# CHECK: .debug_frame contents: +# CHECK: CIE +# CHECK: Version: 1 + .section __TEXT,__text,regular,pure_instructions + .globl _f + .p2align 4, 0x90 +_f: ## @f +Lfunc_begin0: + .file 1 "test.c" + .loc 1 1 0 ## test.c:1:0 + .cfi_startproc +## BB#0: ## %entry + pushl %ebp +Ltmp0: + .cfi_def_cfa_offset 8 +Ltmp1: + .cfi_offset %ebp, -8 + movl %esp, %ebp +Ltmp2: + .cfi_def_cfa_register %ebp +Ltmp3: + .loc 1 1 11 prologue_end ## test.c:1:11 + popl %ebp + retl +Ltmp4: +Lfunc_end0: + .cfi_endproc + .cfi_sections .debug_frame + +.subsections_via_symbols + .section __DWARF,__debug_line,regular,debug +Lsection_line: +Lline_table_start0: diff --git a/clang/tools/driver/cc1as_main.cpp b/clang/tools/driver/cc1as_main.cpp index 388a7693584..bcc2cde17a8 100644 --- a/clang/tools/driver/cc1as_main.cpp +++ b/clang/tools/driver/cc1as_main.cpp @@ -200,7 +200,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts, // Any DebugInfoKind implies GenDwarfForAssembly. Opts.GenDwarfForAssembly = Args.hasArg(OPT_debug_info_kind_EQ); Opts.CompressDebugSections = Args.hasArg(OPT_compress_debug_sections); - Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 0, Diags); + Opts.DwarfVersion = getLastArgIntValue(Args, OPT_dwarf_version_EQ, 2, Diags); Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags); Opts.DwarfDebugProducer = Args.getLastArgValue(OPT_dwarf_debug_producer); Opts.DebugCompilationDir = Args.getLastArgValue(OPT_fdebug_compilation_dir); |

