From 690fcacdd30b36a9a72e2f6935a2ba643152fd00 Mon Sep 17 00:00:00 2001 From: "Devon H. O'Dell" Date: Wed, 6 Jan 2010 15:45:08 -0800 Subject: [PATCH] cgo: Use -fno-eliminate-unused-debug-types when calling gcc to for dwarf stabs. 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index aeca50eece9..c701a6bbcae 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -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