r201375 - Debug info: Make DWARF4 the default for Darwin, too.

Alexander Potapenko glider at google.com
Thu Feb 13 23:42:21 PST 2014


Hi Adrian,

I'm seeing the following error reports on our OSX ASan buildbot now:

ld: warning: can't parse dwarf compilation unit info in /var/tmp/waitid-1ce479.o

My ld is from Xcode 5 (.0.1 or .0.2):

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-224.1
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64
armv6m armv7m armv7em
LTO support using: LLVM version 3.3svn, from Apple Clang 5.0 (build 500.2.79)

On Fri, Feb 14, 2014 at 4:29 AM, Adrian Prantl <aprantl at apple.com> wrote:
> Author: adrian
> Date: Thu Feb 13 18:29:33 2014
> New Revision: 201375
>
> URL: http://llvm.org/viewvc/llvm-project?rev=201375&view=rev
> Log:
> Debug info: Make DWARF4 the default for Darwin, too.
>
> Modified:
>     cfe/trunk/lib/Driver/Tools.cpp
>     cfe/trunk/test/CodeGen/dwarf-version.c
>     cfe/trunk/test/Driver/clang-g-opts.c
>     cfe/trunk/test/Driver/debug-options.c
>
> Modified: cfe/trunk/lib/Driver/Tools.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=201375&r1=201374&r2=201375&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Driver/Tools.cpp (original)
> +++ cfe/trunk/lib/Driver/Tools.cpp Thu Feb 13 18:29:33 2014
> @@ -2657,9 +2657,6 @@ void Clang::ConstructJob(Compilation &C,
>        // FIXME: we should support specifying dwarf version with
>        // -gline-tables-only.
>        CmdArgs.push_back("-gline-tables-only");
> -      // Default is dwarf-2 for darwin.
> -      if (getToolChain().getTriple().isOSDarwin())
> -        CmdArgs.push_back("-gdwarf-2");
>      } else if (A->getOption().matches(options::OPT_gdwarf_2))
>        CmdArgs.push_back("-gdwarf-2");
>      else if (A->getOption().matches(options::OPT_gdwarf_3))
> @@ -2667,13 +2664,8 @@ void Clang::ConstructJob(Compilation &C,
>      else if (A->getOption().matches(options::OPT_gdwarf_4))
>        CmdArgs.push_back("-gdwarf-4");
>      else if (!A->getOption().matches(options::OPT_g0) &&
> -             !A->getOption().matches(options::OPT_ggdb0)) {
> -      // Default is dwarf-2 for darwin.
> -      if (getToolChain().getTriple().isOSDarwin())
> -        CmdArgs.push_back("-gdwarf-2");
> -      else
> -        CmdArgs.push_back("-g");
> -    }
> +             !A->getOption().matches(options::OPT_ggdb0))
> +      CmdArgs.push_back("-g");
>    }
>
>    // We ignore flags -gstrict-dwarf and -grecord-gcc-switches for now.
>
> Modified: cfe/trunk/test/CodeGen/dwarf-version.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/dwarf-version.c?rev=201375&r1=201374&r2=201375&view=diff
> ==============================================================================
> --- cfe/trunk/test/CodeGen/dwarf-version.c (original)
> +++ cfe/trunk/test/CodeGen/dwarf-version.c Thu Feb 13 18:29:33 2014
> @@ -11,4 +11,4 @@ int main (void) {
>  // VER3: metadata !{i32 2, metadata !"Dwarf Version", i32 3}
>  // VER4: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
>  // LINUX: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
> -// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 2}
> +// DARWIN: metadata !{i32 2, metadata !"Dwarf Version", i32 4}
>
> Modified: cfe/trunk/test/Driver/clang-g-opts.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-g-opts.c?rev=201375&r1=201374&r2=201375&view=diff
> ==============================================================================
> --- cfe/trunk/test/Driver/clang-g-opts.c (original)
> +++ cfe/trunk/test/Driver/clang-g-opts.c Thu Feb 13 18:29:33 2014
> @@ -12,5 +12,5 @@
>
>  // CHECK-WITHOUT-G-NOT: "-g"
>  // CHECK-WITH-G: "-g"
> -// CHECK-WITH-G-DARWIN: "-gdwarf-2"
> +// CHECK-WITH-G-DARWIN: "-g"
>
>
> Modified: cfe/trunk/test/Driver/debug-options.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/debug-options.c?rev=201375&r1=201374&r2=201375&view=diff
> ==============================================================================
> --- cfe/trunk/test/Driver/debug-options.c (original)
> +++ cfe/trunk/test/Driver/debug-options.c Thu Feb 13 18:29:33 2014
> @@ -36,11 +36,11 @@
>  // RUN: %clang -### -c -gline-tables-only %s 2>&1 \
>  // RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
>  // RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \
> -// RUN:             | FileCheck -check-prefix=GLTO_ONLY_DARWIN %s
> +// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s
>  // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \
>  // RUN:             | FileCheck -check-prefix=G_ONLY %s
>  // RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin 2>&1 \
> -// RUN:             | FileCheck -check-prefix=G_ONLY_DARWIN %s
> +// RUN:             | FileCheck -check-prefix=G_ONLY %s
>  // RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \
>  // RUN:             | FileCheck -check-prefix=GLTO_NO %s
>  //
> @@ -74,22 +74,11 @@
>  // GLTO_ONLY: "-gline-tables-only"
>  // GLTO_ONLY-NOT: "-g"
>  //
> -// GLTO_ONLY_DARWIN: "-cc1"
> -// GLTO_ONLY_DARWIN-NOT: "-g"
> -// GLTO_ONLY_DARWIN: "-gline-tables-only"
> -// GLTO_ONLY_DARWIN: "-gdwarf-2"
> -// GLTO_ONLY_DARWIN-NOT: "-g"
> -//
>  // G_ONLY: "-cc1"
>  // G_ONLY-NOT: "-gline-tables-only"
>  // G_ONLY: "-g"
>  // G_ONLY-NOT: "-gline-tables-only"
>  //
> -// G_ONLY_DARWIN: "-cc1"
> -// G_ONLY_DARWIN-NOT: "-gline-tables-only"
> -// G_ONLY_DARWIN: "-gdwarf-2"
> -// G_ONLY_DARWIN-NOT: "-gline-tables-only"
> -//
>  // GLTO_NO: "-cc1"
>  // GLTO_NO-NOT: "-gline-tables-only"
>  //
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



-- 
Alexander Potapenko
Software Engineer
Google Moscow



More information about the cfe-commits mailing list