Re: [PATCH] Make LTO link pick up compile-time -g

2019-12-21 Thread Gerald Pfeifer
On Mon, 9 Sep 2019, Richard Biener wrote: > Like the following? > > Richard. > > 2019-09-09 Richard Biener > > * lto-opts.c (lto_write_options): Stream -g when debug is enabled. > * lto-wrapper.c (merge_and_complain): Pick up -g. > (append_compiler_options): Likewise. >

Re: [PATCH] Make LTO link pick up compile-time -g

2019-09-09 Thread Matthias Klose
On 09.09.19 15:51, Richard Biener wrote: On Mon, 9 Sep 2019, Matthias Klose wrote: On 09.09.19 14:02, Richard Biener wrote: So this is really a very poor mans solution that also might uncover issues with -g0 at compile-time vs. -g at link-time if there are mixed -g0/g TUs in the LTO link. Co

Re: [PATCH] Make LTO link pick up compile-time -g

2019-09-09 Thread Richard Biener
On Mon, 9 Sep 2019, Matthias Klose wrote: > On 09.09.19 14:02, Richard Biener wrote: > > So this is really a very poor mans solution that also might > > uncover issues with -g0 at compile-time vs. -g at link-time > > if there are mixed -g0/g TUs in the LTO link. > > Could this be documented, at l

Re: [PATCH] Make LTO link pick up compile-time -g

2019-09-09 Thread Matthias Klose
On 09.09.19 14:02, Richard Biener wrote: So this is really a very poor mans solution that also might uncover issues with -g0 at compile-time vs. -g at link-time if there are mixed -g0/g TUs in the LTO link. Could this be documented, at least in the man page? e.g. invoke.texi. As a bonus I wou

[PATCH] Make LTO link pick up compile-time -g

2019-09-09 Thread Richard Biener
Currently when you compile with -g -flto and then link without repeating -g you'll get a binary that has all early debug but none of the late because the driver doesn't pass -g along to the LTRANS stage. This has always been the case and as with other options "guessing" correctly is hard. The f