[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-22 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Eric Botcazou  changed:

   What|Removed |Added

 CC||gjl at gcc dot gnu.org

--- Comment #27 from Eric Botcazou  ---
*** Bug 85495 has been marked as a duplicate of this bug. ***

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Eric Botcazou  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|ktietz at gcc dot gnu.org  |ebotcazou at gcc dot 
gnu.org

--- Comment #26 from Eric Botcazou  ---
This should work now.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #25 from Eric Botcazou  ---
Author: ebotcazou
Date: Thu Apr 12 14:18:17 2018
New Revision: 259347

URL: https://gcc.gnu.org/viewcvs?rev=259347=gcc=rev
Log:
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.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/cygming.h
trunk/gcc/config/i386/i386-protos.h
trunk/gcc/config/i386/winnt.c
trunk/gcc/dwarf2out.c
trunk/gcc/lto-wrapper.c

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-12 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #24 from rguenther at suse dot de  ---
On Thu, 12 Apr 2018, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
> 
> --- Comment #23 from Eric Botcazou  ---
> > Huh, no. Never seen that.
> 
> Well, well, well... ;-)

He!  Thanks - counts as obvious.

> Index: lto-wrapper.c
> ===
> --- lto-wrapper.c   (revision 259205)
> +++ lto-wrapper.c   (working copy)
> @@ -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,

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #23 from Eric Botcazou  ---
> Huh, no. Never seen that.

Well, well, well... ;-)

Index: lto-wrapper.c
===
--- lto-wrapper.c   (revision 259205)
+++ lto-wrapper.c   (working copy)
@@ -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,

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #22 from rguenther at suse dot de  ---
On April 11, 2018 4:21:06 PM GMT+02:00, "ebotcazou at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
>
>--- Comment #21 from Eric Botcazou  ---
>> Looks good to me, aka OK if it passes whatever testing you think is
>> sufficient.
>
>Thanks.  There is apparently another, preexisting issue visible in Ada:
>
>$ gcc -o t t.c -flto -g 
>lto-wrapper.exe: fatal error: simple_object_copy_lto_debug_sections not
>implemented: Invalid argument
>
>$ gnatmake nested_controlled_alloc -flto
>gcc -c -flto nested_controlled_alloc.adb
>gnatbind -x nested_controlled_alloc.ali
>gnatlink nested_controlled_alloc.ali -flto
>lto-wrapper.exe: fatal error: file too short: No error
>
>compilation terminated.
>c:/home/botcazou/anod-wave/x86_64-windows/gcc-gcc-head.0/install/bin/../libexec/gcc/x86_64-pc-mingw32/8.0.1/ld.exe:
>error: lto-wrapper failed
>
>but adding -g0 makes it disappear:
>
>$ gnatmake nested_controlled_alloc -flto -g0
>gcc -c -flto -g0 nested_controlled_alloc.adb
>gnatbind -x nested_controlled_alloc.ali
>gnatlink nested_controlled_alloc.ali -flto -g0
>
>Do you have any idea about what's going on here?

Huh, no. Never seen that. When debugging lto-wrapper issues I place a
raise(SIGSTOP) inside it and attach

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #21 from Eric Botcazou  ---
> Looks good to me, aka OK if it passes whatever testing you think is
> sufficient.

Thanks.  There is apparently another, preexisting issue visible in Ada:

$ gcc -o t t.c -flto -g 
lto-wrapper.exe: fatal error: simple_object_copy_lto_debug_sections not
implemented: Invalid argument

$ gnatmake nested_controlled_alloc -flto
gcc -c -flto nested_controlled_alloc.adb
gnatbind -x nested_controlled_alloc.ali
gnatlink nested_controlled_alloc.ali -flto
lto-wrapper.exe: fatal error: file too short: No error

compilation terminated.
c:/home/botcazou/anod-wave/x86_64-windows/gcc-gcc-head.0/install/bin/../libexec/gcc/x86_64-pc-mingw32/8.0.1/ld.exe:
error: lto-wrapper failed

but adding -g0 makes it disappear:

$ gnatmake nested_controlled_alloc -flto -g0
gcc -c -flto -g0 nested_controlled_alloc.adb
gnatbind -x nested_controlled_alloc.ali
gnatlink nested_controlled_alloc.ali -flto -g0

Do you have any idea about what's going on here?

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #20 from Richard Biener  ---
(In reply to Eric Botcazou from comment #18)
> Created attachment 43906 [details]
> Tentative fix v2

Looks good to me, aka OK if it passes whatever testing you think is sufficient.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #19 from rguenther at suse dot de  ---
On Wed, 11 Apr 2018, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
> 
> --- Comment #17 from Eric Botcazou  ---
> > Yes, I said we need that anyway...
> 
> Well, you also said that you were OK for a single kludge in the middle-end,
> which seems rather contradictory with having half of it in the back-end.

Ah, I refered to not adding another target hook for the cut-off in
dwarf2out_early_finish, sorry for the confusion.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Eric Botcazou  changed:

   What|Removed |Added

  Attachment #43893|0   |1
is obsolete||

--- Comment #18 from Eric Botcazou  ---
Created attachment 43906
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43906=edit
Tentative fix v2

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #17 from Eric Botcazou  ---
> Yes, I said we need that anyway...

Well, you also said that you were OK for a single kludge in the middle-end,
which seems rather contradictory with having half of it in the back-end.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #16 from rguenther at suse dot de  ---
On Wed, 11 Apr 2018, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
> 
> --- Comment #15 from Eric Botcazou  ---
> > I think we do need to run dwarf2out_early_finish for the FAT part
> > of the object file so please move this to dwarf2out_early_finish,
> > like for example with
> 
> But then we also need the first kludge in the back-end, otherwise we ICE:
> 
> during IPA pass: fnsummary
> t.c:6:1: internal compiler error: in dwarf2out_die_ref_for_decl, at
> dwarf2out.c:5854

Yes, I said we need that anyway...

Darwin should also avoid the work of writing out the early sections
(though it doesn't do any harm there but waste space and time...).
Looks like there's no TARGET_MACHO though.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #15 from Eric Botcazou  ---
> I think we do need to run dwarf2out_early_finish for the FAT part
> of the object file so please move this to dwarf2out_early_finish,
> like for example with

But then we also need the first kludge in the back-end, otherwise we ICE:

during IPA pass: fnsummary
t.c:6:1: internal compiler error: in dwarf2out_die_ref_for_decl, at
dwarf2out.c:5854

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #14 from rguenther at suse dot de  ---
On Wed, 11 Apr 2018, ebotcazou at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
> 
> --- Comment #13 from Eric Botcazou  ---
> > Sure, that works for me.
> 
> OK, something like this is apparently sufficient:

I think we do need to run dwarf2out_early_finish for the FAT part
of the object file so please move this to dwarf2out_early_finish,
like for example with

Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 259308)
+++ gcc/dwarf2out.c (working copy)
@@ -31807,7 +31808,11 @@ dwarf2out_early_finish (const char *file
   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 early debug sections for PE-COFF targets because the
+copy_lto_debug_sections operation of the simple object support in
+libiberty is not implemented yet.  */
+  || TARGET_PECOFF)
 return;

   /* Now as we are going to output for LTO initialize sections and labels

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-11 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #13 from Eric Botcazou  ---
> Sure, that works for me.

OK, something like this is apparently sufficient:

===
--- cgraphunit.c(revision 259205)
+++ cgraphunit.c(working copy)
@@ -2700,7 +2700,14 @@ symbol_table::finalize_compilation_unit
   if (!in_lto_p && g->have_offload)
 flag_generate_offload = 1;

-  if (!seen_error ())
+  /* FIXME: Disable debug info generation during the LGEN phase of LTO for
+ PE-COFF targets because the copy_lto_debug_sections operation of the
+ simple object support in libiberty is not implemented yet.  */
+  enum debug_info_levels saved_debug_info_level = debug_info_level;
+  if (TARGET_PECOFF && (flag_generate_lto || flag_generate_offload))
+debug_info_level = DINFO_LEVEL_NONE;
+
+  if (debug_info_level > DINFO_LEVEL_NONE && !seen_error ())
 {
   /* Emit early debug for reachable functions, and by consequence,
 locally scoped symbols.  */
@@ -2716,6 +2723,8 @@ symbol_table::finalize_compilation_unit
   /* Finally drive the pass manager.  */
   compile ();

+  debug_info_level = saved_debug_info_level;
+
   timevar_pop (TV_CGRAPH);
 }

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #12 from rguenther at suse dot de  ---
On April 10, 2018 5:58:32 PM GMT+02:00, "ebotcazou at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
>
>--- Comment #11 from Eric Botcazou  ---
>> So we in additional to that require a target hook that can be queried
>> from dwarf2out_early_finish () to disable the output of the sections.
>> Or somehow query the simple-object capability there.
>
>Can't we just put a single kludge in the middle-end, for example based
>on
>TARGET_PECOFF which is already used for a kludge in varasm.c?

Sure, that works for me.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #11 from Eric Botcazou  ---
> So we in additional to that require a target hook that can be queried
> from dwarf2out_early_finish () to disable the output of the sections.
> Or somehow query the simple-object capability there.

Can't we just put a single kludge in the middle-end, for example based on
TARGET_PECOFF which is already used for a kludge in varasm.c?

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #10 from Richard Biener  ---
So I guess for darwin we're confused by lto-wrapper.c:debug_objcopy using

  simple_object_read *inobj = simple_object_start_read (infd, inoff,
"__GNU_LTO",
, );
  if (!inobj)
return NULL;

  off_t off, len;
  if (simple_object_find_section (inobj, ".gnu.debuglto_.debug_info",
  , , , ) != 1)

which won't find the darwin early debug sections anyway and the effect of
the (still correct!) patch is to disable references to the early debug
section in the IL.

So we in additional to that require a target hook that can be queried
from dwarf2out_early_finish () to disable the output of the sections.
Or somehow query the simple-object capability there.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #9 from Richard Biener  ---
(In reply to Eric Botcazou from comment #7)
> This doesn't seem to work:
> 
> (gdb) run
> The program being debugged has been started already.
> Start it from the beginning? (y or n) [answered Y; input not from terminal]
> Starting program:
> c:\home\botcazou\anod-wave\x86_64-windows\gcc-gcc-
> head\install\libexec\gcc\x86_64-pc-mingw32\8.0.1\cc1.exe -quiet -v -iprefix
> c:homebotcazouanod-wavex86_64-windowsgcc-gcc-headinstallbin../lib/gcc/x86_64-
> pc-mingw32/8.0.1/ t.c -quiet -dumpbase t.c "-mtune=generic" "-march=x86-64"
> -auxbase t -g -version -flto -o C:tmpcc6RiDxZ.s
> [New Thread 16284.0x1968]
> 
> Breakpoint 1, 0x00b4b4b0 in i386_pe_asm_lto_start() ()
> (gdb) bt
> #0  0x00b4b4b0 in i386_pe_asm_lto_start() ()
> #1  0x005318bc in symbol_table::compile() [clone .part.74] ()
> #2  0x005b in symbol_table::finalize_compilation_unit() ()
> #3  0x0086b125 in compile_file() ()
> #4  0x011a4ad3 in toplev::main(int, char**) ()
> #5  0x011c5743 in main ()
> 
> $ gcc -o t t.c -flto -g 
> lto-wrapper.exe: fatal error: simple_object_copy_lto_debug_sections not
> implemented: Invalid argument
> 
> compilation terminated.
> c:/home/botcazou/anod-wave/x86_64-windows/gcc-gcc-head/install/bin/../
> libexec/gcc/x86_64-pc-mingw32/8.0.1/ld.exe: error: lto-wrapper failed
> collect2.exe: error: ld returned 1 exit status

can you inspect the object file and see whether there's a
.gnu.debuglto_.debug_info section?  Or I guess more easily break in
dwarf2out_early_finish and see whether/why debug_info_level isn't properly
unset.

Ah, quite naturally this doesn't work as the early_finish hook is called
very much earlier...  I wonder why this works on darwin and if it has
additional bad side-effects there (disabling debug for the non-LTO path?)

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #8 from Eric Botcazou  ---
There are still debuglto sections in the primary object file:

  3 .gnu.debuglto_.debug_info 0094     
026c  2**2
  CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA, EXCLUDE
  4 .gnu.debuglto_.debug_abbrev 002c     
0300  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA, EXCLUDE
  5 .gnu.debuglto_.debug_str      
  2**2
  ALLOC, LOAD, READONLY, DATA, EXCLUDE

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #7 from Eric Botcazou  ---
This doesn't seem to work:

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from terminal]
Starting program:
c:\home\botcazou\anod-wave\x86_64-windows\gcc-gcc-head\install\libexec\gcc\x86_64-pc-mingw32\8.0.1\cc1.exe
-quiet -v -iprefix
c:homebotcazouanod-wavex86_64-windowsgcc-gcc-headinstallbin../lib/gcc/x86_64-pc-mingw32/8.0.1/
t.c -quiet -dumpbase t.c "-mtune=generic" "-march=x86-64" -auxbase t -g
-version -flto -o C:tmpcc6RiDxZ.s
[New Thread 16284.0x1968]

Breakpoint 1, 0x00b4b4b0 in i386_pe_asm_lto_start() ()
(gdb) bt
#0  0x00b4b4b0 in i386_pe_asm_lto_start() ()
#1  0x005318bc in symbol_table::compile() [clone .part.74] ()
#2  0x005b in symbol_table::finalize_compilation_unit() ()
#3  0x0086b125 in compile_file() ()
#4  0x011a4ad3 in toplev::main(int, char**) ()
#5  0x011c5743 in main ()

$ gcc -o t t.c -flto -g 
lto-wrapper.exe: fatal error: simple_object_copy_lto_debug_sections not
implemented: Invalid argument

compilation terminated.
c:/home/botcazou/anod-wave/x86_64-windows/gcc-gcc-head/install/bin/../libexec/gcc/x86_64-pc-mingw32/8.0.1/ld.exe:
error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #6 from Eric Botcazou  ---
Created attachment 43893
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43893=edit
Darwin-ish tentative fix

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Eric Botcazou  changed:

   What|Removed |Added

 CC||ebotcazou at gcc dot gnu.org

--- Comment #5 from Eric Botcazou  ---
> Let's make sure we "fix" this.

I'm testing the Darwin-ish approach...

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #4 from Richard Biener  ---
Let's make sure we "fix" this.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-06 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

--- Comment #3 from rguenther at suse dot de  ---
On Fri, 6 Apr 2018, ktietz at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238
> 
> Kai Tietz  changed:
> 
>What|Removed |Added
> 
>  CC||ktietz at gcc dot gnu.org
> 
> --- Comment #2 from Kai Tietz  ---
> as intermediate the duplication of darwin's logic is fine. Nevertheless I 
> would
> prefer proper support of COFF here.

Of course.  I asked for help here (similar for Mach-O and darwin) about
one and a half years ago.

The proposed mitigation should get you about as much debug info with LTO
as in the pre-early-LTO debug era.  So all you should (in theory) get
is no "better" debug...

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-06 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Kai Tietz  changed:

   What|Removed |Added

 CC||ktietz at gcc dot gnu.org

--- Comment #2 from Kai Tietz  ---
as intermediate the duplication of darwin's logic is fine. Nevertheless I would
prefer proper support of COFF here.

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ktietz at gcc dot 
gnu.org

[Bug target/85238] [8 Regression] lto-wrapper: fatal error: simple_object_copy_lto_debug_sections not implemented: Invalid argument on Cygwin

2018-04-06 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85238

Richard Biener  changed:

   What|Removed |Added

 Target||cygwin, mingw
 Status|UNCONFIRMED |NEW
   Keywords||lto
   Last reconfirmed||2018-04-06
  Component|lto |target
 CC||jyong at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|lto-wrapper: fatal error:   |[8 Regression] lto-wrapper:
   |simple_object_copy_lto_debu |fatal error:
   |g_sections not implemented: |simple_object_copy_lto_debu
   |Invalid argument  on Cygwin |g_sections not implemented:
   ||Invalid argument  on Cygwin
   Target Milestone|--- |8.0

--- Comment #1 from Richard Biener  ---
That's expected.  On darwin that was mitigated with

2018-03-02  Richard Biener  

PR target/82005
* config/darwin.c (saved_debug_info_level): New static global.
(darwin_asm_lto_start): Disable debug info generation for LTO out.
(darwin_asm_lto_end): Restore debug info generation settings.

so mingw/cygwin need to do sth similar and define the TARGET_ASM_LTO_START/END
hooks, see config/darwin.[ch] for examples.

Or, of course, implement COFF support for
simple_object_copy_lto_debug_sections.