aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-04-12 14:18:17 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-04-12 14:18:17 +0000
commitdc0e0c6b2e70e9d2b3bbf02664b3f5a670c5c2be (patch)
treef9ab5a36b95554430d5d26309c62747b49010914
parent2e5efa6760314aac101b63d1a7742cff5f5e650f (diff)
downloadgcc-dc0e0c6b2e70e9d2b3bbf02664b3f5a670c5c2be.zip
gcc-dc0e0c6b2e70e9d2b3bbf02664b3f5a670c5c2be.tar.gz
gcc-dc0e0c6b2e70e9d2b3bbf02664b3f5a670c5c2be.tar.bz2
re PR target/85238 (lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin)
PR target/85238 * lto-wrapper.c (debug_objcopy): Open the files in binary mode. * dwarf2out.c (dwarf2out_early_finish): Do not generate assembly in LTO mode for PE-COFF targets. * config/i386/i386-protos.h (i386_pe_asm_lto_start): Declare. (i386_pe_asm_lto_end): Likewise. * config/i386/cygming.h (TARGET_ASM_LTO_START): Define. (TARGET_ASM_LTO_END): Likewise. * config/i386/winnt.c (saved_debug_info_level): New static variable. (i386_pe_asm_lto_start): New function. (i386_pe_asm_lto_end): Likewise. From-SVN: r259347
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/i386/cygming.h6
-rw-r--r--gcc/config/i386/i386-protos.h2
-rw-r--r--gcc/config/i386/winnt.c17
-rw-r--r--gcc/dwarf2out.c6
-rw-r--r--gcc/lto-wrapper.c2
6 files changed, 45 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 798469f..25bcfa9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2018-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/85238
+ * lto-wrapper.c (debug_objcopy): Open the files in binary mode.
+ * dwarf2out.c (dwarf2out_early_finish): Do not generate assembly in LTO
+ mode for PE-COFF targets.
+ * config/i386/i386-protos.h (i386_pe_asm_lto_start): Declare.
+ (i386_pe_asm_lto_end): Likewise.
+ * config/i386/cygming.h (TARGET_ASM_LTO_START): Define.
+ (TARGET_ASM_LTO_END): Likewise.
+ * config/i386/winnt.c (saved_debug_info_level): New static variable.
+ (i386_pe_asm_lto_start): New function.
+ (i386_pe_asm_lto_end): Likewise.
+
2018-04-12 Cesar Philippidis <cesar@codesourcery.com>
Richard Biener <rguenther@suse.de>
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 21b0f43..1d35885 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -356,6 +356,12 @@ do { \
#undef TARGET_ASM_FILE_END
#define TARGET_ASM_FILE_END i386_pe_file_end
+/* Kludge because of missing PE-COFF support for early LTO debug. */
+#undef TARGET_ASM_LTO_START
+#define TARGET_ASM_LTO_START i386_pe_asm_lto_start
+#undef TARGET_ASM_LTO_END
+#define TARGET_ASM_LTO_END i386_pe_asm_lto_end
+
#undef ASM_COMMENT_START
#define ASM_COMMENT_START " #"
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index ef7c818..40756f5 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -254,6 +254,8 @@ extern void i386_pe_asm_output_aligned_decl_common (FILE *, tree,
HOST_WIDE_INT,
HOST_WIDE_INT);
extern void i386_pe_file_end (void);
+extern void i386_pe_asm_lto_start (void);
+extern void i386_pe_asm_lto_end (void);
extern void i386_pe_start_function (FILE *, const char *, tree);
extern void i386_pe_end_function (FILE *, const char *, tree);
extern void i386_pe_end_cold_function (FILE *, const char *, tree);
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index d5c256b..3a857f9 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -808,6 +808,23 @@ i386_pe_file_end (void)
}
}
+/* Kludge because of missing PE-COFF support for early LTO debug. */
+
+static enum debug_info_levels saved_debug_info_level;
+
+void
+i386_pe_asm_lto_start (void)
+{
+ saved_debug_info_level = debug_info_level;
+ debug_info_level = DINFO_LEVEL_NONE;
+}
+
+void
+i386_pe_asm_lto_end (void)
+{
+ debug_info_level = saved_debug_info_level;
+}
+
/* x64 Structured Exception Handling unwind info. */
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f52ec45..620e669 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -31820,7 +31820,11 @@ dwarf2out_early_finish (const char *filename)
early_dwarf_finished = true;
/* Do not generate DWARF assembler now when not producing LTO bytecode. */
- if (!flag_generate_lto && !flag_generate_offload)
+ if ((!flag_generate_lto && !flag_generate_offload)
+ /* 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)
return;
/* Now as we are going to output for LTO initialize sections and labels
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index f7f6f6b..f1f059c 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -983,7 +983,7 @@ debug_objcopy (const char *infile)
infile = fname;
inoff = (off_t) loffset;
}
- int infd = open (infile, O_RDONLY);
+ int infd = open (infile, O_RDONLY | O_BINARY);
if (infd == -1)
return NULL;
simple_object_read *inobj = simple_object_start_read (infd, inoff,