[Bug sim/34536] New: sim doesn't build on Solaris

"ro at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34536

            Bug ID: 34536
           Summary: sim doesn't build on Solaris
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sim
          Assignee: unassigned at sourceware dot org
          Reporter: ro at gcc dot gnu.org
                CC: vapier at gentoo dot org
  Target Milestone: ---
            Target: *-*-solaris2.11

Building sim on Solaris 11.4 with the bundled gcc 16 fails:

  CC       igen/igen.o
In file included from ../../binutils-gdb/sim/igen/igen.c:23:
/usr/include/stdlib.h:307:12: error: conflicting types for ‘getopt’; have
‘int(int,  char * const*, const char *)’
  307 | extern int getopt(int, char *const *, const char *);
      |            ^~~~~~
In file included from ../../binutils-gdb/sim/igen/igen.c:22:
../../binutils-gdb/sim/../include/getopt.h:115:12: note: previous declaration
of ‘getopt’ with type ‘int(void)’
  115 | extern int getopt ();
      |            ^~~~~~
In file included from ../../binutils-gdb/sim/igen/misc.h:36,
                 from ../../binutils-gdb/sim/igen/igen.c:25:
/usr/include/stdio.h:362:17: error: conflicting types for ‘getopt’; have
‘int(int,  char * const*, const char *)’
  362 | extern int      getopt(int, char *const *, const char *);
      |                 ^~~~~~
../../binutils-gdb/sim/../include/getopt.h:115:12: note: previous declaration
of ‘getopt’ with type ‘int(void)’
  115 | extern int getopt ();
      |            ^~~~~~

<getopt.h> is included first thing without HAVE_DECL_GETOPT having been defined
first (i.e. config.h being included either directly or via sim/common/defs.h).

This occurs with the default configure options of a gdb buildbot.  Since
there's
no point in testing sim for native-only gdb, I'm not going to pursue this but
just disable sim.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.