public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "sebastian.huber@embedded-brains.de" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug sim/26194] New: sim/igen generates code leading to linker errors with -fno-common (GCC 10 default)
Date: Thu, 02 Jul 2020 06:04:38 +0000	[thread overview]
Message-ID: <bug-26194-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=26194

            Bug ID: 26194
           Summary: sim/igen generates code leading to linker errors with
                    -fno-common (GCC 10 default)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: sim
          Assignee: unassigned at sourceware dot org
          Reporter: sebastian.huber@embedded-brains.de
                CC: vapier at gentoo dot org
  Target Milestone: ---

For example building the v850 simulator for the v850-rtems target results with
a GCC 10 build compiler:

make[3]: Entering directory
'/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850'
gcc -O2 -g -pipe
-I/scratch/git-rtems-source-builder/rtems/build/tmp/sb-10000/6/rtems-v850/build/rtems/6/include
-DHAVE_CONFIG_H  -DWITH_DEFAULT_ALIGNMENT=NONSTRICT_ALIGNMENT
-DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31
-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE   -DDEFAULT_INLINE=0
-DWITH_RESERVED_BITS=1  -Wall -Wdeclaration-after-statement -Wpointer-arith
-Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch
-Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement
-Wempty-body -Wmissing-parameter-type -Wold-style-declaration
-Wold-style-definition -Wformat-nonliteral   -DDEBUG
-I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850/../../newlib/libc/sys/sysnecv850
  -I. -I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850 -I../common
-I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850/../common
-I../../include
-I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850/../../include
-I../../bfd
-I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850/../../bfd
-I../../opcodes
-I../../../sourceware-mirror-binutils-gdb-4e394b2/sim/v850/../../opcodes  -g
-O2
-L/scratch/git-rtems-source-builder/rtems/build/tmp/sb-10000/6/rtems-v850/build/rtems/6/lib
-o run \
  nrun.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a 
../../libiberty/libiberty.a -ldl  -L../../zlib -lz  
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
libsim.a(idecode.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
multiple definition of `idecode_issue';
libsim.a(irun.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
libsim.a(engine.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
multiple definition of `idecode_issue';
libsim.a(irun.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
libsim.a(support.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
multiple definition of `idecode_issue';
libsim.a(irun.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
first defined here
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
libsim.a(semantics.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
multiple definition of `idecode_issue';
libsim.a(irun.o):/scratch/git-rtems-source-builder/rtems/build/v850-rtems6-gdb-4e394b2-x86_64-linux-gnu-1/build/sim/v850/idecode.h:71:
first defined here

We have:

tail ./sim/v850/idecode.h
(SIM_DESC sd,
 instruction_word instruction_0,
 instruction_address cia);

instruction_address (*idecode_issue)
(SIM_DESC sd,
 instruction_word instruction_0,
 instruction_address cia);

#endif /* _IDECODE_H_*/

This is probably generated by (sim/igen/gen-idecode.c):

void
print_idecode_issue_function_header (lf *file,
                                     const char *processor,
                                     function_decl_type decl_type,
                                     int nr_prefetched_words)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2020-07-02  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  6:04 sebastian.huber@embedded-brains.de [this message]
2020-07-02 12:35 ` [Bug sim/26194] " simark at simark dot ca
2020-07-02 15:45 ` sebastian.huber@embedded-brains.de
2020-07-02 15:58 ` simark at simark dot ca
2020-07-03 19:04 ` cvs-commit at gcc dot gnu.org
2020-07-03 19:05 ` sebastian.huber@embedded-brains.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26194-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).