diff mbox series

Fix link failure with debug info in LTO mode

Message ID 1672625.LqMC4mkd7s@polaris
State New
Headers show
Series Fix link failure with debug info in LTO mode | expand

Commit Message

Eric Botcazou Feb. 25, 2020, 10:35 a.m. UTC
Hi,

this is a regression present on all active branches: the attached testcase 
fails to link with debug info in LTO mode because of an undefined reference to 
a symbol coming from the object files containing the early debug info.

Tested on x86_64-suse-linux, OK for all active branches?


2019-20-25  Eric Botcazou  <ebotcazou@adacore.com>

	* dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.


2019-20-25  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat.dg/lto24.adb: New test.
	* gnat.dg/lto24_pkg1.ads: New helper.
	* gnat.dg/lto24_pkg2.ad[sb]: Likewise.

Comments

Richard Biener Feb. 25, 2020, 11:29 a.m. UTC | #1
On Tue, Feb 25, 2020 at 11:36 AM Eric Botcazou <ebotcazou@adacore.com> wrote:
>
> Hi,
>
> this is a regression present on all active branches: the attached testcase
> fails to link with debug info in LTO mode because of an undefined reference to
> a symbol coming from the object files containing the early debug info.
>
> Tested on x86_64-suse-linux, OK for all active branches?

OK.

Thanks,
Richard.


>
>
> 2019-20-25  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * dwarf2out.c (dwarf2out_size_function): Run in early-DWARF mode.
>
>
> 2019-20-25  Eric Botcazou  <ebotcazou@adacore.com>
>
>         * gnat.dg/lto24.adb: New test.
>         * gnat.dg/lto24_pkg1.ads: New helper.
>         * gnat.dg/lto24_pkg2.ad[sb]: Likewise.
>
> --
> Eric Botcazou
diff mbox series

Patch

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index fe46c7e1eee..1fcb19a0489 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27610,6 +27610,7 @@  dwarf2out_inline_entry (tree block)
 static void
 dwarf2out_size_function (tree decl)
 {
+  set_early_dwarf s;
   function_to_dwarf_procedure (decl);
 }