binutils-gdb/sim
Tsukasa OI dd6c5a9217 sim, sim/{m32c,ppc,rl78}: Use getopt_long
Because of a Libiberty hack, getopt on GNU libc (2.25 or earlier) is
currently unusable on sim, causing a regression on CentOS 7.

This is caused as follows:

1.  If HAVE_DECL_GETOPT is defined (getopt declaration with known prototype
    is detected while configuration), a declaration of getopt in
    "include/getopt.h" is suppressed.
    The author started to define HAVE_DECL_GETOPT in sim with the commit
    340aa4f687 ("sim: Check known getopt definition existence").
2.  GNU libc (2.25 or earlier)'s <unistd.h> includes <getopt.h> with a
    special purpose macro defined to declare only getopt function but due
    to include path (not tested while configuration), it causes <unistd.h>
    to include Libiberty's "include/getopt.h".
3.  If both 1. and 2. are satisfied, despite that <unistd.h> tries to
    declare getopt by including <getopt.h>, "include/getopt.h" does not do
    so, causing getopt function undeclared.

Getting rid of "include/getopt.h" (e.g. renaming this header file) is the
best solution to avoid hacking but as a short-term solution, this commit
replaces getopt with getopt_long under sim/.
2022-10-29 05:39:52 +00:00
..
aarch64 sim/aarch64: remove two unused functions 2022-10-24 17:20:29 +01:00
arm sim: fixes for libopcodes styled disassembler 2022-04-04 22:41:24 +01:00
avr Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
bfin sim: remove use of PTR 2022-05-13 14:32:54 +09:30
bpf sim: gdbinit: hoist setup to common code 2022-02-21 13:57:33 -05:00
common sim/cgen: initialize variable at creation in engine_run_n 2022-10-27 16:52:07 +01:00
cr16 Don't use BFD_VMA_FMT in gdb and sim 2022-08-06 08:03:16 +09:30
cris sim/cris: Add ATTRIBUTE_PRINTF 2022-10-11 15:18:14 +01:00
d10v Don't use BFD_VMA_FMT in gdb and sim 2022-08-06 08:03:16 +09:30
erc32 sim/erc32: avoid dereferencing type-punned pointer warnings 2022-10-19 14:32:22 +01:00
example-synacor sim: synacor: migrate to standard uintXX_t types 2022-01-06 01:17:38 -05:00
frv sim: remove use of PTR 2022-05-13 14:32:54 +09:30
ft32 Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
h8300 sim/h8300: avoid self assignment 2022-10-24 17:23:47 +01:00
igen sim, sim/{m32c,ppc,rl78}: Use getopt_long 2022-10-29 05:39:52 +00:00
iq2000 sim/iq2000: silence pointer-sign warnings 2022-10-19 14:32:22 +01:00
lm32 sim/lm32: fix some missing function declaration warnings 2022-10-24 17:24:29 +01:00
m4 sim: Link ZSTD_LIBS 2022-09-27 11:42:32 -07:00
m32c sim, sim/{m32c,ppc,rl78}: Use getopt_long 2022-10-29 05:39:52 +00:00
m32r sim: remove use of PTR 2022-05-13 14:32:54 +09:30
m68hc11 sim/m68hc11: Add ATTRIBUTE_PRINTF 2022-10-11 15:18:14 +01:00
mcore Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
microblaze Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mips sim: mips/ppc/riscv: re-add AC_CANONICAL_SYSTEM [PR sim/29439] 2022-10-23 22:51:17 +05:45
mn10300 sim: gdbinit: hoist setup to common code 2022-02-21 13:57:33 -05:00
moxie sim/moxie: add custom directory stamp rule 2022-10-11 11:22:14 +01:00
msp430 sim: msp430: migrate to standard uintXX_t types 2022-01-06 01:17:38 -05:00
or1k sim: gdbinit: hoist setup to common code 2022-02-21 13:57:33 -05:00
ppc sim, sim/{m32c,ppc,rl78}: Use getopt_long 2022-10-29 05:39:52 +00:00
pru Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
riscv sim: mips/ppc/riscv: re-add AC_CANONICAL_SYSTEM [PR sim/29439] 2022-10-23 22:51:17 +05:45
rl78 sim, sim/{m32c,ppc,rl78}: Use getopt_long 2022-10-29 05:39:52 +00:00
rx Don't use BFD_VMA_FMT in gdb and sim 2022-08-06 08:03:16 +09:30
sh sim/sh: use fabs instead of abs 2022-10-24 17:00:49 +01:00
testsuite sim: testsuite: improve parallel test processing 2022-10-26 14:38:44 +05:45
v850 Fix for v850e divq instruction 2022-04-06 11:10:40 -04:00
.gitignore sim: drop unused gentmap & nltvals.def logic 2021-11-28 13:24:00 -05:00
aclocal.m4 sim: Link ZSTD_LIBS 2022-09-27 11:42:32 -07:00
arch-subdir.mk.in sim: Remove unused CXXFLAGS substitution 2022-10-21 01:10:03 +00:00
ChangeLog-2021 sim: rename ChangeLog files to ChangeLog-2021 2021-08-17 20:27:36 -04:00
config.h.in sim: Check known getopt definition existence 2022-10-11 15:18:14 +01:00
configure sim: Check known getopt definition existence 2022-10-11 15:18:14 +01:00
configure.ac sim: Check known getopt definition existence 2022-10-11 15:18:14 +01:00
COPYING sim: clarify license text via COPYING file 2021-11-06 01:44:06 -04:00
gdbinit.in sim: gdbinit: hoist setup to common code 2022-02-21 13:57:33 -05:00
MAINTAINERS sim: Update mailing list address 2022-09-01 10:15:09 -04:00
Makefile.am Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
Makefile.in sim: testsuite: improve parallel test processing 2022-10-26 14:38:44 +05:45
README-HACKING sim: nltvals: pull target syscalls out into a dedicated source file 2021-11-28 13:23:57 -05:00