]> Cypherpunks repositories - gostls13.git/commitdiff
cgo: Use -fno-eliminate-unused-debug-types when calling gcc to for dwarf stabs.
authorDevon H. O'Dell <devon.odell@gmail.com>
Wed, 6 Jan 2010 23:45:08 +0000 (15:45 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 6 Jan 2010 23:45:08 +0000 (15:45 -0800)
This keeps debug symbols in for e.g. unreferenced enums.

Fixes #479

R=rsc
CC=golang-dev, waltermundt
https://golang.org/cl/181102

src/cmd/cgo/gcc.go

index aeca50eece913eefe354bdf24c55f546a002040d..c701a6bbcae6be48f7e2efc92218ee57078d9426 100644 (file)
@@ -229,6 +229,7 @@ func (p *Prog) gccDebug(stdin []byte) (*dwarf.Data, string) {
                "-Werror", // warnings are errors
                "-o" + tmp, // write object to tmp
                "-gdwarf-2", // generate DWARF v2 debugging symbols
+               "-fno-eliminate-unused-debug-types", // gets rid of e.g. untyped enum otherwise
                "-c", // do not link
                "-xc", // input language is C
                "-", // read input from standard input