re PR target/86651 (lto-wrapper.exe: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument)

2018-08-01 Jan Willem Jagersma  <jwjagersma@gmail.com>

	PR target/86651
	* dwarf2out.c (dwarf2out_early_finish): Do not generate assembly in LTO
	mode for COFF targets.
	* defaults.h (TARGET_COFF): Define.
	* config/i386/djgpp.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END,
	TARGET_COFF): Define.
	(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): Declare.
	* config/i386/djgpp.c (saved_debug_info_level): New static variable.
	(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): New functions.

From-SVN: r263191
This commit is contained in:
Jan Willem Jagersma 2018-08-01 06:52:44 +00:00 committed by Richard Biener
parent 027c71411c
commit 3311d93cbf
5 changed files with 46 additions and 2 deletions

View File

@ -1,3 +1,15 @@
2018-08-01 Jan Willem Jagersma <jwjagersma@gmail.com>
PR target/86651
* dwarf2out.c (dwarf2out_early_finish): Do not generate assembly in LTO
mode for COFF targets.
* defaults.h (TARGET_COFF): Define.
* config/i386/djgpp.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END,
TARGET_COFF): Define.
(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): Declare.
* config/i386/djgpp.c (saved_debug_info_level): New static variable.
(i386_djgpp_asm_lto_start, i386_djgpp_asm_lto_end): New functions.
2018-07-31 Alexandre Oliva <oliva@adacore.com>
* gimple-streamer-in.c (input_bb): Restore BB discriminator.

View File

@ -47,3 +47,20 @@ i386_djgpp_asm_named_section(const char *name, unsigned int flags,
fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars);
}
/* Kludge because of missing COFF support for early LTO debug. */
static enum debug_info_levels saved_debug_info_level;
void
i386_djgpp_asm_lto_start (void)
{
saved_debug_info_level = debug_info_level;
debug_info_level = DINFO_LEVEL_NONE;
}
void
i386_djgpp_asm_lto_end (void)
{
debug_info_level = saved_debug_info_level;
}

View File

@ -157,8 +157,19 @@ along with GCC; see the file COPYING3. If not see
#undef MAKE_DECL_ONE_ONLY
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
#undef TARGET_COFF
#define TARGET_COFF 1
/* Kludge because of missing COFF support for early LTO debug. */
#undef TARGET_ASM_LTO_START
#define TARGET_ASM_LTO_START i386_djgpp_asm_lto_start
#undef TARGET_ASM_LTO_END
#define TARGET_ASM_LTO_END i386_djgpp_asm_lto_end
/* Function protypes for gcc/i386/djgpp.c */
void
i386_djgpp_asm_named_section(const char *name, unsigned int flags,
tree decl);
void i386_djgpp_asm_lto_start (void);
void i386_djgpp_asm_lto_end (void);

View File

@ -1282,6 +1282,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_PECOFF 0
#endif
#ifndef TARGET_COFF
#define TARGET_COFF 0
#endif
#ifndef EH_RETURN_HANDLER_RTX
#define EH_RETURN_HANDLER_RTX NULL
#endif

View File

@ -31942,10 +31942,10 @@ dwarf2out_early_finish (const char *filename)
/* Do not generate DWARF assembler now when not producing LTO bytecode. */
if ((!flag_generate_lto && !flag_generate_offload)
/* FIXME: Disable debug info generation for PE-COFF targets since the
/* FIXME: Disable debug info generation for (PE-)COFF targets since the
copy_lto_debug_sections operation of the simple object support in
libiberty is not implemented for them yet. */
|| TARGET_PECOFF)
|| TARGET_PECOFF || TARGET_COFF)
return;
/* Now as we are going to output for LTO initialize sections and labels