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
avr
bfin
bpf
common sim/cgen: initialize variable at creation in engine_run_n 2022-10-27 16:52:07 +01:00
cr16
cris sim/cris: Add ATTRIBUTE_PRINTF 2022-10-11 15:18:14 +01:00
d10v
erc32 sim/erc32: avoid dereferencing type-punned pointer warnings 2022-10-19 14:32:22 +01:00
example-synacor
frv
ft32
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
m68hc11 sim/m68hc11: Add ATTRIBUTE_PRINTF 2022-10-11 15:18:14 +01:00
mcore
microblaze
mips sim: mips/ppc/riscv: re-add AC_CANONICAL_SYSTEM [PR sim/29439] 2022-10-23 22:51:17 +05:45
mn10300
moxie sim/moxie: add custom directory stamp rule 2022-10-11 11:22:14 +01:00
msp430
or1k
ppc sim, sim/{m32c,ppc,rl78}: Use getopt_long 2022-10-29 05:39:52 +00:00
pru
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
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
.gitignore
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
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
gdbinit.in
MAINTAINERS sim: Update mailing list address 2022-09-01 10:15:09 -04:00
Makefile.am
Makefile.in sim: testsuite: improve parallel test processing 2022-10-26 14:38:44 +05:45
README-HACKING