<br><br><div class="gmail_quote">On Tue Oct 21 2014 at 4:03:52 PM Peter Collingbourne <<a href="mailto:peter@pcc.me.uk">peter@pcc.me.uk</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Oct 21, 2014 at 10:42:18PM +0000, Eric Christopher wrote:<br>
> ><br>
> ><br>
> > > Honestly I didn't think about it much. It should probably get migrated<br>
> > > along, because otherwise how would you pass that along?<br>
> ><br>
> > We might want the flag to appear in --cflags and --cxxflags. But it<br>
> > shouldn't<br>
> > appear in --cppflags, as that should contain only preprocessor flags.<br>
> ><br>
> ><br>
> Sure.<br>
><br>
><br>
> > > That said, stripping it out for now is fine. cgo should probably learn<br>
> > how<br>
> > > to deal with .dwo files at some point.<br>
> ><br>
> > Perhaps, but I'd expect that if cgo uses cppflags on its own it should be<br>
> > able to rely on those flags not changing the output format.<br>
> ><br>
> ><br>
> I'd be surprised if -g wasn't making it in there then since they're relying<br>
> on debug output?<br>
><br>
> What's the actual command line look being passed to files that cgo wants?<br>
<br>
We found that it looked like this:<br>
<br>
gcc -w -Wno-error -o.../_cgo_.o -gdwarf-2 -c -xc -I.../include -I.../include -D_GNU_SOURCE -gsplit-dwarf -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I .../_obj_test/ -m64 -<br>
<br>
It appears that many of these flags (including -gdwarf-2) come from cgo<br>
itself, while the rest come from the user's c*flags.<br>
<br>
<a href="http://golang.org/src/cmd/cgo/gcc.go#L743" target="_blank">http://golang.org/src/cmd/cgo/<u></u>gcc.go#L743</a><br>
<br>
That's probably the only way things could possibly work, as it's certainly<br>
possible for the user's c*flags to not include any -g flags.<br></blockquote><div><br></div><div>Makes total sense.</div><div><br></div><div>OK with me then.</div><div><br></div><div>-ericĀ </div></div>