public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/86490] lto1: fatal error: multiple prevailing defs
       [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
@ 2020-05-26 16:01 ` joe.harvell at netscout dot com
  2020-05-26 16:13 ` joe.harvell at netscout dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: joe.harvell at netscout dot com @ 2020-05-26 16:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490

joe.harvell at netscout dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joe.harvell at netscout dot com

--- Comment #15 from joe.harvell at netscout dot com ---
I get the following error on on gcc 8.3.0 using the default bfd linker with
LTO, but only with binutils 2.27 and 2.34.  This error does not occur with
binutils 2.25.  I also get this error with gcc 10.1.0 and binutils 2.34. (It's
not possible to build gcc 10.1.0 correctly with binutils 2.25, so this is not
tested).  In all cases, there is no error when using the gold linker.

lto1: fatal error: multiple prevailing defs for ‘actual_function_name_redacted’

This function is defined in one .c file and declared with the extern keyword in
another .c file.

For the gcc 10.1.0 / binutils 2.34 case, here is what I see using lto-dump:

jharvell@grays obj$ /opt/gcc10.1/bin/lto-dump
-symbol=actual_function_name_redacted actual_c_filename_redacted_v1.o 
Symbol: actual_function_name_redacted
actual_function_name_redacted/259 (actual_function_name_redacted)
@0x7fedffb7c168
  Type: function definition analyzed
  Visibility: externally_visible public
  References: 
  Referring: 
  Read from file: actual_c_filename_redacted_v1.o
  Availability: available
  Unit id: 1
  Function flags: count:1073741824 (estimated locally)
  Called by: 
  Calls: memcpy/260 (354334800 (estimated locally),0.33 per call) 

jharvell@grays obj$ /opt/gcc10.1/bin/lto-dump
-symbol=actual_function_name_redacted actual_c_filename_redacted.o 
Symbol: actual_function_name_redacted

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/86490] lto1: fatal error: multiple prevailing defs
       [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
  2020-05-26 16:01 ` [Bug lto/86490] lto1: fatal error: multiple prevailing defs joe.harvell at netscout dot com
@ 2020-05-26 16:13 ` joe.harvell at netscout dot com
  2020-05-26 16:46 ` joe.harvell at netscout dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: joe.harvell at netscout dot com @ 2020-05-26 16:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490

--- Comment #16 from joe.harvell at netscout dot com ---
Correction on the previous comment.  I said

This function is defined in one .c file and declared with the extern keyword in
another .c file.

But in fact the extern declaration in the second .c file is removed by the
pre-processor.  So the symbol only occurs in one .c file.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/86490] lto1: fatal error: multiple prevailing defs
       [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
  2020-05-26 16:01 ` [Bug lto/86490] lto1: fatal error: multiple prevailing defs joe.harvell at netscout dot com
  2020-05-26 16:13 ` joe.harvell at netscout dot com
@ 2020-05-26 16:46 ` joe.harvell at netscout dot com
  2020-05-26 21:41 ` joe.harvell at netscout dot com
  2021-12-24 11:43 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: joe.harvell at netscout dot com @ 2020-05-26 16:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490

--- Comment #17 from joe.harvell at netscout dot com ---
It looks like this function is never called, by the way.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/86490] lto1: fatal error: multiple prevailing defs
       [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-05-26 16:46 ` joe.harvell at netscout dot com
@ 2020-05-26 21:41 ` joe.harvell at netscout dot com
  2021-12-24 11:43 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: joe.harvell at netscout dot com @ 2020-05-26 21:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490

--- Comment #18 from joe.harvell at netscout dot com ---

Sorry for the chatter...but I noticed the link command line had the same .o/.a
files multiple times (to satisfy order dependencies between them).  When I
removed the duplicates and enclosed them in -Wl,--start-group / -Wl,--end-group
everything linked fine with bfd 2.34.  Note that bfd >= 2.27 also works fine if
not using LTO.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug lto/86490] lto1: fatal error: multiple prevailing defs
       [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-05-26 21:41 ` joe.harvell at netscout dot com
@ 2021-12-24 11:43 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-24 11:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86490

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The first example still fails if used with ld from binutils 2.30 and with
-fcommon (which is not the default any more).

Moving down to a minor issue as -fno-common is now default since GCC 10.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-12-24 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-86490-4@http.gcc.gnu.org/bugzilla/>
2020-05-26 16:01 ` [Bug lto/86490] lto1: fatal error: multiple prevailing defs joe.harvell at netscout dot com
2020-05-26 16:13 ` joe.harvell at netscout dot com
2020-05-26 16:46 ` joe.harvell at netscout dot com
2020-05-26 21:41 ` joe.harvell at netscout dot com
2021-12-24 11:43 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).