[glibc/zack/no-nested-includes] (46 commits) Clarify status of wait.h and sys/bitypes.h
Zack Weinberg
zack@sourceware.org
Sun May 26 16:34:00 GMT 2019
The branch 'zack/no-nested-includes' was updated to point to:
5e0a3b4... Clarify status of wait.h and sys/bitypes.h
It previously pointed to:
7ff5af4... Swap sys/poll.h with poll.h.
Diff:
!!! WARNING: THE FOLLOWING COMMITS ARE NO LONGER ACCESSIBLE (LOST):
-------------------------------------------------------------------
7ff5af4... Swap sys/poll.h with poll.h.
417fe2e... Swap sys/syslog.h with syslog.h.
94dda58... Limit the set of strings.h functions also exposed in string
4fcc0a1... DonâÂÂt include sys/cdefs.h directly from public headers.
2e7c120... DonâÂÂt include sys/select.h from sys/types.h.
be25154... Split up endian.h to minimize exposure of BYTE_ORDER.
fdedb48... Add check-obsolete-constructs checker for nested includes.
306c4c0... DonâÂÂt conditionalize declarations of ldiv_t, lldiv_t, __g
f827c86... Create bits/types headers for most remaining __T_defined ma
b151fd6... Clean up bits/types.h.
2ae203f... Simplify definition of __time64_t.
afd5af6... Add caddr_t, daddr_t, and loff_t to the set of obsolete typ
5837382... sys/types.h: DonâÂÂt define u_intN_t or register_t unless _
3b62e1b... Define register_t using bits/typesizes.h macros.
5c6e0c7... Move most headers installed by top-level Makefile to misc/.
ca537d7... Remove support for PowerPC e500 / SPE ISA extension.
commit 7ff5af432a846923a4cad0ee726ce85ebdf64118
Author: Zack Weinberg <zackw@panix.com>
Date: Sun Mar 17 09:50:36 2019 -0400
Swap sys/poll.h with poll.h.
Similarly to (sys/)syslog.h, poll.h is the header standardized by
POSIX, but we had all of its contents in sys/, for historical reasons.
This patch exchanges the contents of the two headers, and adds
multiple-include guards to all of poll.hâÂÂs bits headers.
* io/poll.h: Exchange contents with...
* io/sys/poll.h: ...this file. Adjust guard macros.
* include/poll.h: Exchange contents with...
* include/sys/poll.h: ...this file. Adjust guard macros.
* bits/poll.h, io/bits/poll2.h
* sysdeps/unix/sysv/linux/bits/poll.h
* sysdeps/unix/sysv/linux/m68k/bits/poll.h
* sysdeps/unix/sysv/linux/mips/bits/poll.h
* sysdeps/unix/sysv/linux/sparc/bits/poll.h:
Allow inclusion by poll.h, not sys/poll.h. Add multiple-
include guards where not already present.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Remove entry for poll.h; add entry for sys/poll.h.
commit 417fe2e3b33ab018447f2fbbf4b73e8bbb639f84
Author: Zack Weinberg <zackw@panix.com>
Date: Sun Mar 17 09:31:56 2019 -0400
Swap sys/syslog.h with syslog.h.
Our installed syslog.h is a trivial wrapper around sys/syslog.h, which
is where all the actual declarations are. This is backward from
POSIX, which specifies syslog.h and its contents, and does not specify
sys/syslog.h. This arrangement appears to have been inherited from
some BSD-phylum C library, and probably pre-dates any standardization
of syslog.
This patch swaps the contents of syslog.h and sys/syslog.h, so that
the actual declarations appear under the standardized name. Since it
is necessary to adjust all of syslog.hâÂÂs bits headers, I also added
multiple-include guards to those files that didnâÂÂt already have
them. (All installed headers should have multiple-include guards,
even if they are internal and only used in one public header. The
âÂÂnever include this file directlyâ #error convention doesnâÂÂt protect
against including the internal header a second time after its parent
header has already been included.)
* misc/sys/syslog.h: Exchange contents with...
* misc/syslog.h: ...this file. Adjust multiple-include guards.
* include/sys/syslog.h: Exchange contents with...
* include/syslog.h: ...this file. Adjust multiple-include guards.
* bits/syslog-path.h, misc/bits/syslog-ldbl.h
* misc/bits/syslog.h: Allow inclusion by syslog.h, not sys/syslog.h.
Add multiple-include guard where not already present.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Add new group for sys/ headers that do nothing but include a
top-level header with the same basename, containing entry for
sys/syslog.h; remove entry for syslog.h.
commit 94dda58a954e5a96d3ffefd25700661d25aa4dd9
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 21:01:12 2019 -0400
Limit the set of strings.h functions also exposed in string.h.
As someone who can remember when you might not be able to include both
string.h and strings.h at the same time, I kinda resent that strings.h
still exists and is the only standard source for str(n)casecmp(_l) and
ffs. I think itâÂÂs right that we expose those functions from string.h.
However, thereâÂÂs no reason we need to keep exposing the other obsolete
functions that strings.h declares from string.h.
This patch creates <bits/strings_x2k8.h>, which declares the
non-obsolete functions whose official home is strings.h. strings.h
includes it unconditionally, and string.h includes it under
__USE_MISC, instead of strings.h.
Two tests of the obsolete strings.h functions had to be adjusted.
* string/strings.h (strcasecmp, strncasecmp, strcasecmp_l)
(strncasecmp_l, ffs, ffsl, ffsll): Move declarations to...
* string/bits/strings_x2k8.h: ... this new file.
* string/Makefile: Install bits/strings_x2k8.h.
* include/bits/strings_x2k8h: New wrapper.
* string/string.h: Include bits/strings_x2k8.h instead of
strings.h.
* debug/tst-chk1.c, string/test-string.h: Include strings.h.
* scripts/check-obsolete-constructs.py: string.h is no longer
expected to include strings.h.
commit 4fcc0a149e2216d2c50c72184a2b2ea35da1ab1d
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 14:31:08 2019 -0400
DonâÂÂt include sys/cdefs.h directly from public headers.
The convention throughout glibc is that every public header includes
features.h directly, as its first action, and relies on features.h to
include sys/cdefs.h. In a few places, though, itâÂÂs been done the
other way around, usually in headers that were copied from a BSD
source (where the convention is exactly the opposite). This patch
makes all installed headers match the glibc convention.
This patch also corrects a bug in glob.h: it may declare size_t
without notifying stddef.h that it has done this, so e.g.
#define _XOPEN_SOURCE 700
#include <glob.h>
#include <stddef.h>
int dummy;
declares size_t twice, which is invalid prior to C2011. I wasnâÂÂt able
to persuade gcc 8 to issue an error, even with -std=c89 -Wsystem-headers,
but clang is not so lenient.
* posix/glob.h: Include features.h, not sys/cdefs.h.
When __USE_XOPEN || USE_XOPEN2K8, include stddef.h for size_t;
otherwise, issue an immediate #error if __SIZE_TYPE__ is not
available. Use __gsize_t, not __size_t, as an impl-namespace
alternative name for size_t.
* conform/data/glob.h-data: Adjust to match.
* inet/netinet/igmp.h, mach/lock-intern.h, misc/ar.h
* misc/sys/auxv.h, resolv/resolv.h, socket/sys/un.h
* sunrpc/rpc/auth_des.h, sunrpc/rpc/rpc_msg.h
* sysdeps/generic/memcopy.h, sysdeps/generic/netinet/tcp.h
* sysdeps/htl/pthread.h, sysdeps/mach/hurd/net/ethernet.h
* sysdeps/mach/hurd/net/if_arp.h: Include features.h, not sys/cdefs.h.
* scripts/check-obsolete-constructs.py: Remove most whitelist
entries for sys/cdefs.h.
commit 2e7c1201471461479853e85992f62bfd608a5fff
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 12:35:25 2019 -0400
DonâÂÂt include sys/select.h from sys/types.h.
This is supposedly present for BSD compatibility, but the current
generation of BSDs is not consistent about it: FreeBSD does, OpenBSD
doesnâÂÂt, NetBSD exposes only fd_set and the FD_* macros. Programs
that need to wait for any of multiple I/O events have several
alternatives to select nowadays, so I think it makes sense to expose
select only to programs that specifically want it.
Only a few places within our own code are affected. A few test
programs need to include sys/select.h explicitly, as does rpc/svc.h.
sysdeps/nptl/thread_db.h needs to declare sigset_t, and
sysdeps/unix/sysv/linux/pselect.c was including sys/poll.h instead of
sys/select.h, which is probably a copy-and-paste error. sys/socket.h
needs to forward-declare struct timespec under __USE_GNU, because
recvmmsg has a struct timespec * argument; IâÂÂm open to the possibility
of having it fully declare struct timespec.
I considered taking sys/select.h out of sys/time.h as well, but POSIX
not only explicitly allows this inclusion, it requires sys/time.h to
declare almost everything that sys/select.h declares. It doesnâÂÂt seem
worth creating another bits header just to prevent sys/time.h from
declaring pselect, sigset_t, and struct timespec.
* posix/sys/types.h: DonâÂÂt include sys/select.h.
* scripts/check-obsolete-constructs.py: Remove whitelist entry
for sys/types.h -> sys/select.h. Adjust commentary re
sys/time.h -> sys/select.h.
* socket/sys/socket.h: When __USE_GNU, forward-declare struct timespec.
* misc/tst-fdset.c, nptl/tst-cancel4.c, scripts/check-c++-types.sh
* sunrpc/rpc/svc.h: Include sys/select.h.
* sysdeps/nptl/thread_db.h: Include bits/types/sigset_t.h.
* sysdeps/unix/sysv/linux/pselect.c: Include sys/select.h,
not sys/poll.h.
commit be2515491a6ebd9c43974594eb4913ec0a3d6dec
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Mar 15 09:02:24 2019 -0400
Split up endian.h to minimize exposure of BYTE_ORDER.
With only two exceptions (sys/types.h and sys/param.h, both of which
historically might have defined BYTE_ORDER) the public headers that
include <endian.h> only want to be able to test __BYTE_ORDER against
__*_ENDIAN.
This patch creates a new bits/endian.h that can be included by any
header that wants to be able to test __BYTE_ORDER and/or
__FLOAT_WORD_ORDER against the __*_ENDIAN constants, or needs
__LONG_LONG_PAIR. It only defines macros in the implementation
namespace.
The existing bits/endian.h (which could not be included independently
of endian.h, and only defines __BYTE_ORDER and maybe __FLOAT_WORD_ORDER)
is renamed to bits/endianness.h. I also took the opportunity to
canonicalize the form of this header, which we are stuck with having
one copy of per architecture. Since they are so short, this means git
doesnâÂÂt understand that they were renamed from existing headers, sigh.
endian.h itself is a nonstandard header and its only remaining use
from a standard header is guarded by __USE_MISC, so I dropped the
__USE_MISC conditionals from around all of the public-namespace things
it defines. (This means, an application that requests strict library
conformance but includes endian.h will still see the definition of
BYTE_ORDER.)
A few changes to specific bits/endian(ness).h variants deserve
mention:
- sysdeps/unix/sysv/linux/ia64/bits/endian.h is moved to
sysdeps/ia64/bits/endianness.h. If I remember correctly, ia64 did
have selectable endianness, but we have assembly code in
sysdeps/ia64 that assumes itâÂÂs little-endian, so there is no reason
to treat the ia64 endianness.h as linux-specific.
- The C-SKY port does not fully support big-endian mode, but I do
not think this is sufficient reason to make csky/bits/endian(ness).h
error out if __CSKYBE__ is defined, so it now defines __BYTE_ORDER
appropriately for whichever mode the compiler is in.
- The PowerPC port had extra logic in its bits/endian.h to detect a
broken compiler, which strikes me as unnecessary, so I removed it.
- The only files that defined __FLOAT_WORD_ORDER always defined it to
the same value as __BYTE_ORDER, so I removed those definitions.
The SH bits/endian(ness).h had comments inconsistent with the
actual setting of __FLOAT_WORD_ORDER, which I also removed.
- I *removed* copyright boilerplate from the few bits/endian(ness).h
headers that had it; these files record a single fact in a fashion
dictated by an external spec, so I do not think they are copyrightable.
As long as I was changing every copy of ieee754.h in the tree, I
noticed that only the MIPS variant includes float.h, so I removed that
as well.
* string/endian.h: Unconditionally define LITTLE_ENDIAN,
BIG_ENDIAN, PDP_ENDIAN, and BYTE_ORDER. Condition byteswapping
macros only on !__ASSEMBLER__. Move the definitions of
__BIG_ENDIAN, __LITTLE_ENDIAN, __PDP_ENDIAN, __FLOAT_WORD_ORDER,
and __LONG_LONG_PAIR to...
* string/bits/endian.h: ...this new file, which includes
the renamed header bits/endianness.h for the definition of
__BYTE_ORDER and possibly __FLOAT_WORD_ORDER.
* string/Makefile: Install bits/endianness.h.
* include/bits/endian.h: New wrapper.
* bits/endian.h: Rename to bits/endianness.h.
Add multiple-include guard. Rewrite the comment explaining what
the machine-specific variants of this file should do.
* sysdeps/unix/sysv/linux/ia64/bits/endian.h:
Move to sysdeps/ia64.
* sysdeps/aarch64/bits/endian.h
* sysdeps/alpha/bits/endian.h
* sysdeps/arm/bits/endian.h
* sysdeps/csky/bits/endian.h
* sysdeps/hppa/bits/endian.h
* sysdeps/ia64/bits/endian.h
* sysdeps/m68k/bits/endian.h
* sysdeps/microblaze/bits/endian.h
* sysdeps/mips/bits/endian.h
* sysdeps/nios2/bits/endian.h
* sysdeps/powerpc/bits/endian.h
* sysdeps/riscv/bits/endian.h
* sysdeps/s390/bits/endian.h
* sysdeps/sh/bits/endian.h
* sysdeps/sparc/bits/endian.h
* sysdeps/x86/bits/endian.h:
Rename to endianness.h; canonicalize form of file; remove
redundant definitions of __FLOAT_WORD_ORDER.
* sysdeps/csky/bits/endianness.h: Do not error out if __CSKYEB__
is defined.
* sysdeps/powerpc/bits/endianness.h: Remove logic to check for
broken compilers.
* ctype/ctype.h
* inet/netinet/in.h
* resolv/arpa/nameser_compat.h
* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
* sysdeps/csky/nptl/bits/pthreadtypes-arch.h
* sysdeps/ia64/ieee754.h
* sysdeps/ieee754/ieee754.h
* sysdeps/ieee754/ldbl-128/ieee754.h
* sysdeps/ieee754/ldbl-128ibm/ieee754.h
* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
* sysdeps/mips/ieee754/ieee754.h
* sysdeps/mips/nptl/bits/pthreadtypes-arch.h
* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
* sysdeps/nptl/pthread.h
* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
* sysdeps/sh/nptl/bits/pthreadtypes-arch.h
* sysdeps/sparc/sparc32/ieee754.h
* sysdeps/unix/sysv/linux/generic/bits/stat.h
* sysdeps/unix/sysv/linux/generic/bits/statfs.h
* sysdeps/unix/sysv/linux/sys/acct.h
* wctype/bits/wctype-wchar.h:
Include bits/endian.h, not endian.h.
* sysdeps/unix/sysv/linux/hppa/pthread.h: DonâÂÂt include endian.h.
* sysdeps/mips/ieee754/ieee754.h: DonâÂÂt include float.h.
* scripts/check-obsolete-constructs.h: Remove most of the
whitelist entries for endian.h and float.h.
commit fdedb484e4e5f86fafb77e143e05857db78de071
Author: Zack Weinberg <zackw@panix.com>
Date: Thu Mar 14 21:03:23 2019 -0400
Add check-obsolete-constructs checker for nested includes.
As a first step toward minimizing the number of public headers that
include other public headers, add a checker to check-obsolete-constructs
that will error out on any such inclusion thatâÂÂs not on a whitelist.
The whitelist is initialized to all of the nested inclusions that
already exist; subsequent patches will remove nested inclusions and
shrink the whitelist, hopefully to the point where we only have
nested inclusions as mandated by the relevant standards.
* scripts/check-obsolete-constructs.py
(UNIVERSAL_ALLOWED_INCLUDES, HEADER_ALLOWED_INCLUDES)
(SYSDEP_ALLOWED_INCLUDES, NESTED_INCLUDES_EXEMPT_RE)
(get_allowed_nested, NestedIncludeCheckerWhitelistOnly)
(NestedIncludeChecker): New.
(HeaderChecker): Instantiate and run a NestedIncludeChecker
for each header.
commit 306c4c00529b074838b5e61523aac24c226dce00
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
DonâÂÂt conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
DonâÂÂt define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
commit f827c86b13e5f7f2b9ce3e3da41969c6bf5bcbb0
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 20:54:02 2019 -0500
Create bits/types headers for most remaining __T_defined macros.
This doesn't exactly fit the theme but as long as I'm tinkering with
sys/types.h it makes sense to go through and create single-declaration
bits/types/ headers for all of the remaining cases where we have
two or more headers declaring a public type.
The remaining uses of the original __T_defined idiom are:
__error_t_defined in files shared with gnulib, which probably has to
remain as is; ____gwchar_t_defined in inttypes.h, which may not be
necessary anymore and should be addressed separately, and
__ldiv_t_defined and __lldiv_t_defined in stdlib.h, ditto.
Our handling of LFS types is a little inconsistent: some headers
declare both off_t and off64_t (for instance) when
_LARGEFILE64_SOURCE, others will only declare off_t regardless of
_LARGEFILE64_SOURCE. I don't know if this was intentional or not.
I am tempted to centralize responsibility for _LARGEFILE64_SOURCE as
well as _FILE_OFFSET_BITS=64 in bits/types/off_t.h (etc) so that any
header that declares off_t will automatically also declare off64_t
when _LARGEFILE64_SOURCE.
sunrpc/rpc/types.h is special, because it is included in files
compiled by the *build* compiler (cross-rpcgen-objs), and therefore it
cannot unconditionally assume bits/types headers are available. What
I did was have it include the appropriate bits/types headers only if
including sys/types.h did not cause __BIT_TYPES_DEFINED__ to be
defined. This will do the right thing when an installed rpc/types.h
is included by application code compiled without __USE_MISC in effect.
During the build, we rely on the fact that we compile all of our own
code with __USE_MISC in effect. This is fragile, but should be
acceptable for code that's no longer built by default anyway.
scripts/check-obsolete-constructs.py ensures that only sys/types.h and
rpc/types.h include the bits/types/ headers that define obsolete types.
* posix/bits/types/blkcnt64_t.h
* posix/bits/types/blkcnt_t.h
* posix/bits/types/blksize_t.h
* posix/bits/types/dev_t.h
* posix/bits/types/fsblkcnt64_t.h
* posix/bits/types/fsblkcnt_t.h
* posix/bits/types/fsfilcnt64_t.h
* posix/bits/types/fsfilcnt_t.h
* posix/bits/types/fsid_t.h
* posix/bits/types/gid_t.h
* posix/bits/types/id_t.h
* posix/bits/types/ino64_t.h
* posix/bits/types/ino_t.h
* posix/bits/types/intptr_t.h
* posix/bits/types/key_t.h
* posix/bits/types/loff_t.h
* posix/bits/types/mode_t.h
* posix/bits/types/nlink_t.h
* posix/bits/types/off64_t.h
* posix/bits/types/off_t.h
* posix/bits/types/pid_t.h
* posix/bits/types/socklen_t.h
* posix/bits/types/ssize_t.h
* posix/bits/types/suseconds_t.h
* posix/bits/types/uid_t.h
* posix/bits/types/useconds_t.h:
New single-declaration headers for standard types canonically
defined by sys/types.h, sys/socket.h, or inttypes.h but also
exposed by other headers under some circumstances. Code moved
from posix/sys/types.h, socket/sys/socket.h, stdlib/inttypes.h
as appropriate.
* posix/bits/types/uint.h
* posix/bits/types/u_int.h
* posix/bits/types/u_intN_t.h
* posix/bits/types/caddr_t.h
* posix/bits/types/daddr_t.h
* posix/bits/types/loff_t.h
* posix/bits/types/register_t.h:
Similarly, but for obsolete BSD-derived types whose canonical
home is sys/types.h. Some of these headers define more than
one type.
* posix/Makefile (headers): Install the above new headers.
Rewrap the list.
* posix/sys/types.h: All definitions of public types now
accomplished using the above new headers. Consolidate
groups of definitions controlled by the same feature
selection macros.
* inet/arpa/inet.h, bits/socket.h
* sysdeps/mach/hurd/bits/socket.h
* sysdeps/unix/sysv/linux/bits/socket.h:
Use bits/types/socklen_t.h.
* dirent/dirent.h: Use bits/types/ino_t.h and bits/types/ino64_t.h.
* grp/grp.h: Use bits/types/gid_t.h.
* io/fcntl.h: Use bits/types/mode_t.h, bits/types/off_t.h,
bits/types/pid_t.h, and bits/types/off64_t.h.
* io/sys/stat.h: Use bits/types/dev_t.h, bits/types/gid_t.h,
bits/types/ino_t.h, bits/types/mode_t.h, bits/types/nlink_t.h,
bits/types/off_t.h, bits/types/uid_t.h, and bits/types/blkcnt_t.h.
* libio/stdio.h: Use bits/types/off_t.h, bits/types/off64_t.h,
and bits/types/ssize_t.h.
* misc/sys/mman.h: Use bits/types/off_t.h and bits/types/mode_t.h.
* misc/sys/select.h: Use bits/types/suseconds_t.h.
* posix/sched.h: Use bits/types/pid_t.h.
* posix/sys/wait.h: Use bits/types/pid_t.h and bits/types/id_t.h.
* posix/unistd.h: Use bits/types/gid_t.h, bits/types/uid_t.h,
bits/types/off_t.h, bits/types/off64_t.h, bits/types/useconds_t.h,
bits/types/intptr_t.h, and bits/types/socklen_t.h.
* pwd/pwd.h: Use bits/types/gid_t.h and bits/types/uid_t.h.
* resource/sys/resource.h: Use bits/types/id_t.h.
* signal/signal.h: Use bits/types/pid_t.h and bits/types/uid_t.h.
* stdlib/monetary.h: Use bits/types/ssize_t.h.
* sysdeps/gnu/utmpx.h: Use bits/types/pid_t.h.
* sysvipc/sys/ipc.h: Use bits/types/uid_t.h, bits/types/gid_t.h,
bits/types/mode_t.h, and bits/types/key_t.h.
* sysvipc/sys/msg.h: Use bits/types/pid_t.h and bits/types/ssize_t.h.
* sysvipc/sys/shm.h: Use bits/types/pid_t.h.
* termios/termios.h: Use bits/types/pid_t.h.
* time/sys/time.h: Use bits/types/suseconds_t.h.
* time/time.h: Use bits/types/pid_t.h.
* sunrpc/rpc/types.h: Consolidate all #includes at the top of
the file. If __BIT_TYPES_DEFINED__ is not defined after
including sys/types.h, also include bits/types/caddr_t.h,
bits/types/daddr_t.h, bits/types/fsid_t.h, and bits/types/u_int.h.
* scripts/check-obsolete-constructs.py (OBSOLETE_TYPE_HDR_RE_): New.
(ObsoleteIndirectDefinitionsAllowed): New; allows inclusion of
bits/types/ headers that define obsolete typedefs, but not
direct definitions of those types.
(ObsoleteNotAllowed, ObsoletePrivateDefinitionsAllowed)
(ObsoletePublicDefinitionsAllowed): Do not allow inclusion of
bits/types/ headers that define obsolete typedefs.
* include/bits/types/blkcnt64_t.h
* include/bits/types/blkcnt_t.h
* include/bits/types/blksize_t.h
* include/bits/types/caddr_t.h
* include/bits/types/daddr_t.h
* include/bits/types/dev_t.h
* include/bits/types/fsblkcnt64_t.h
* include/bits/types/fsblkcnt_t.h
* include/bits/types/fsfilcnt64_t.h
* include/bits/types/fsfilcnt_t.h
* include/bits/types/fsid_t.h
* include/bits/types/gid_t.h
* include/bits/types/id_t.h
* include/bits/types/ino64_t.h
* include/bits/types/ino_t.h
* include/bits/types/intptr_t.h
* include/bits/types/key_t.h
* include/bits/types/loff_t.h
* include/bits/types/mode_t.h
* include/bits/types/nlink_t.h
* include/bits/types/off64_t.h
* include/bits/types/off_t.h
* include/bits/types/pid_t.h
* include/bits/types/register_t.h
* include/bits/types/socklen_t.h
* include/bits/types/ssize_t.h
* include/bits/types/suseconds_t.h
* include/bits/types/u_char.h
* include/bits/types/u_intN_t.h
* include/bits/types/uchar.h
* include/bits/types/uid_t.h
* include/bits/types/useconds_t.h: New wrappers.
commit b151fd67ecf3ea3b11e2fa3f5d45cc1a250ea4a6
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 18:01:48 2019 -0500
Clean up bits/types.h.
This makes four linked changes to bits/types.h. First, we use
__(u)?int(16|32|64)_t to define __[SU](16|32|64)_TYPE. In addition
to reducing the amount of ifdeffage, this means __STD_TYPE is no longer
necessary, since gcc -std=c89 will complain about âÂÂtypedef long long foo_tâÂÂ
but not âÂÂtypedef __int64_t foo_tâÂÂ, even if the underlying type
of __int64_t is long long.
Second, we eliminate __UQUAD_TYPE and __SQUAD_TYPE from the set of
macros bits/typesizes.h should use to define __FOO_T_TYPE macros,
since they are always the same as __U64_TYPE and __S64_TYPE
respectively.
Third, we remove __u_char, __u_short, __u_int, __u_long, __u_quad_t,
and __quad_t, we add __uintptr_t, and we define __intmax_t and
__uintmax_t as __int64_t and __uint64_t.
Fourth, we reorganize the list of typedefs into groups by the
standard (if any) that defines them, and sort them alphabetically within
each group.
* posix/bits/types.h: Move #error for __WORDSIZE neither 32 nor 64
to first group of conditionals on __WORDSIZE, and make it more
explicit. Update commentary. Define all __foo_t types with
regular âÂÂtypedefâÂÂ. Reorganize all __foo_t types into the same
groups that sys/types.h uses.
(__u_char, __u_short, __u_int, __u_long, __quad_t, __u_quad_t)
(__UQUAD_TYPE, __SQUAD_TYPE, __STD_TYPE): DonâÂÂt define.
(__S16_TYPE): Define unconditionally as __int16_t.
(__U16_TYPE): Define unconditionally as __uint16_t.
(__S32_TYPE): Define unconditionally as __int32_t.
(__U32_TYPE): Define unconditionally as __uint32_t.
(__S64_TYPE): Define unconditionally as __int64_t.
(__U64_TYPE): Define unconditionally as __uint64_t.
(__intmax_t): Define unconditionally as __int64_t.
(__uintmax_t): Define unconditionally as __uint64_t.
(__uintptr_t): New typedef.
* bits/time64.h
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
Replace all uses of __UQUAD_TYPE with __U64_TYPE, and all
uses of __SQUAD_TYPE with __S64_TYPE.
* posix/sys/types.h, rpc/sys/types.h
(u_char): Define as unsigned char.
(u_short): Define as unsigned short.
(u_int): Define as unsigned int.
(u_long): Define as unsigned long.
(quad_t): Define as __int64_t.
(u_quad_t): Define as __uint64_t.
* stdlib/stdint.h (intptr_t): Define as __intptr_t.
(uintptr_t): Define as __uintptr_t.
* scripts/check-obsolete-constructs.py: Update allowed
definitions for the obsolete types. No longer allow
__STD_TYPE as an alias for typedef.
commit 2ae203f13b4f529074c2f70910a98cdd40054f31
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 16:01:38 2019 -0500
Simplify definition of __time64_t.
bits/time64.h always sets __TIME64_T_TYPE to be __time_t when
__TIMESIZE == 64, so we can unconditionally use __TIME64_T_TYPE to
define __time64_t; we donâÂÂt need another conditional in bits/types.h.
Also move the definition of __time64_t next to the definition of
__time_t.
* posix/bits/types.h (__time64_t): Unconditionally define
as __TIME64_T_TYPE. Move definition next to __time_t.
commit afd5af61dcae1cca1e37e8e58ec720089ff42231
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 11:59:02 2019 -0500
Add caddr_t, daddr_t, and loff_t to the set of obsolete typedefs.
caddr_t is a BSD-derived alias for âÂÂchar *âÂÂ, obsoleted by the
introduction of âÂÂvoid *â in C89 (!) daddr_t is a âÂÂdisk address,âÂÂ
but itâÂÂs always defined as âÂÂintâÂÂ, making it too small for modern
disks and tapes. loff_t is another name for off64_t, from early
drafts of LFS. All three are already only exposed by sys/types.h
under __USE_MISC.
This patch adds them to the set of types that shall not be used in
installed headers (enforced by check-obsolete-constructs.py) and
expunges all remaining uses, internally as well as in installed
headers. Since __DADDR_T_TYPE is always defined as __S32_TYPE, and
daddr_t is obsolete so thereâÂÂs no need to worry about future
variation, the patch also removes __DADDR_T_TYPE from the set of
macros that bits/typesizes.h is required to define. Instead
bits/types.h always defines __daddr_t as __S32_TYPE, and the
definition is moved to a more logical location within the file, next
to __caddr_t.
ItâÂÂs always safe to change (__)loff_t to the matching (__)off64_t;
in a few internal files, I removed an unnecessary __ prefix.
daddr_t is only used for struct ustat, which is obsoleted by struct
statvfs and we already donâÂÂt declare it in public headers, and for an
ioctl parameter block in sys/mtio.h (which may or may not be obsolete,
I canâÂÂt tell). In sys/mtio.h I replaced both uses with âÂÂintâ to match
the use of bare âÂÂlong intâ for most of the other fields of that
structure. In misc/ustat.c, the definition of struct ustat is not
actually necessary so I removed it entirely. In
sysdeps/unix/sysv/linux/ustat.c a definition is necessary but only
because INLINE_SYSCALL_CALL doesnâÂÂt work (on at least x86) when an
argument is a pointer to an incomplete type, so I substituted a dummy
definition.
Most of the internal uses of caddr_t are in the sunrpc and nis
directories, and since most of that code is obsolete, I mechanically
replaced them with char * rather than consider whether void * might
make more sense. Because âÂÂconst caddr_t fooâ is semantically
different from âÂÂconst char *fooâ (in the first case âÂÂfooâ itself is
const but the memory pointed to isnâÂÂt, in the second case the memory
pointed to is const but âÂÂfooâ isnâÂÂt) this change exposed some
const-correctness errors in sunrpc, which I fixed minimally. Outside
of sunrpc and nis, I put a little more thought into whether uses of
caddr_t should be void * instead.
* scripts/check-obsolete-constructs.py: Add caddr_t, daddr_t,
and loff_t to the set of obsolete types forbidden in public
headers.
* posix/bits/types.h: Unconditionally define __daddr_t as
__S32_TYPE. Move definition of __daddr_t next to definition
of __caddr_t.
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
DonâÂÂt define __DADDR_T_TYPE.
* sysdeps/gnu/sys/mtio.h (struct mtget): Change all uses of
__daddr_t to int.
* misc/ustat.c: Remove definition of struct ustat; only
forward-declare it.
* sysdeps/unix/sysv/linux/ustat.c: Replace fields of
struct ustat with a size-preserving dummy field.
* hurd/Makefile (migheaderpipe): Rewrite loff_t as __off64_t.
* hurd/fd-read.c (_hurd_fd_read): Use off64_t instead of loff_t.
* hurd/fd-write.c (hurd_fd_write): Use off64_t instead of loff_t.
* hurd/hurd/fd.h (_hurd_fd_read, _hurd_fd_write): Declare
using __off64_t instead of __loff_t.
* support/xunistd.h (xcopy_file_range): Declare using off64_t
instead of loff_t.
* sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
* sysdeps/unix/sysv/linux/lseek.c
* sysdeps/unix/sysv/linux/lseek64.c
* sysdeps/unix/sysv/linux/splice.c
Throughout, use off64_t instead of loff_t.
* sysdeps/unix/sysv/linux/sys/quota.h
(dqoff): Use __off64_t instead of __loff_t.
(quotactl): Declare using char * instead of caddr_t.
* sysdeps/unix/sysv/linux/test-errno-linux.c
(do_test): Cast to char * instead of caddr_t when calling quotactl.
* elf/dl-map-segments.h (_dl_map_segments): Cast to void *
instead of caddr_t when calling __mprotect and __mmap.
* elf/dl-minimal.c (malloc): Declare page as char *, not caddr_t.
* elf/dl-reloc.c (_dl_relocate_object): Declare textrels.start
as char *, not caddr_t. Cast to char *, not caddr_t, in
pointer arithmetic.
* intl/loadmsgcat.c: Remove two unnecessary casts to caddr_t
when calling munmap. Change a third cast to target void *
instead and add a comment explaining why this one is necessary.
* locale/loadlocale.c (_nl_load_locale): Use NULL instead of
`(caddr_t)0`, and remove an unnecessary cast to caddr_t when
calling munmap.
(_nl_unload_locale): Change casts when calling free and munmap
to target char *, and add a comment explaining why they are
necessary.
* sysdeps/gnu/net/if.h
(struct ifreq): Declare ifru_data as char *, not __caddr_t.
(struct ifconf): Declare ifcu_buf as char *, not __caddr_t.
* nis/nis_add.c
* nis/nis_call.c
* nis/nis_callback.c
* nis/nis_checkpoint.c
* nis/nis_findserv.c
* nis/nis_intern.h
* nis/nis_lookup.c
* nis/nis_mkdir.c
* nis/nis_modify.c
* nis/nis_ping.c
* nis/nis_remove.c
* nis/nis_rmdir.c
* nis/nis_server.c
* nis/nis_table.c
* nis/nis_util.c
* nis/nss_nisplus/nisplus-grp.c
* nis/nss_nisplus/nisplus-pwd.c
* nis/rpcsvc/nis_callback.h
* nis/rpcsvc/yp.h
* nis/ypclnt.c
* sunrpc/auth_des.c
* sunrpc/auth_unix.c
* sunrpc/authdes_prot.c
* sunrpc/authuxprot.c
* sunrpc/clnt_raw.c
* sunrpc/clnt_tcp.c
* sunrpc/clnt_udp.c
* sunrpc/clnt_unix.c
* sunrpc/key_call.c
* sunrpc/pm_getmaps.c
* sunrpc/pm_getport.c
* sunrpc/pmap_clnt.c
* sunrpc/pmap_prot2.c
* sunrpc/pmap_rmt.c
* sunrpc/proto.h
* sunrpc/rpc/auth.h
* sunrpc/rpc/clnt.h
* sunrpc/rpc/pmap_clnt.h
* sunrpc/rpc/pmap_rmt.h
* sunrpc/rpc/rpc_msg.h
* sunrpc/rpc/svc.h
* sunrpc/rpc/xdr.h
* sunrpc/rpc_clntout.c
* sunrpc/rpc_cmsg.c
* sunrpc/rpc_hout.c
* sunrpc/rpc_prot.c
* sunrpc/rpc_sample.c
* sunrpc/rpc_svcout.c
* sunrpc/svc.c
* sunrpc/svc_authux.c
* sunrpc/svc_raw.c
* sunrpc/svc_tcp.c
* sunrpc/svc_udp.c
* sunrpc/svc_unix.c
* sunrpc/xdr.c
* sunrpc/xdr_array.c
* sunrpc/xdr_mem.c
* sunrpc/xdr_rec.c
* sunrpc/xdr_ref.c
* sunrpc/xdr_sizeof.c
* sunrpc/xdr_stdio.c:
Mechanically replace all uses of caddr_t with char *.
* sunrpc/xdr_mem.c (xdrmem_create): Cast away const when
setting xdrs->x_private and xdrs->x_base.
* sunrpc/xdr_stdio.c (xdrstdio_getbytes): Correct argument
types in definition to match prototype.
commit 5837382f661e82d8b2ecf89d44d31768bc2fa5eb
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Feb 18 21:00:34 2019 -0500
sys/types.h: DonâÂÂt define u_intN_t or register_t unless __USE_MISC.
sys/types.h unconditionally defines u_int8_t, u_int16_t, u_int32_t,
u_int64_t, and register_t. These are not part of any standard. The
u_intXX_t types are superseded by C99âÂÂs uintXX_t types (defined in
stdint.h). IâÂÂm not aware of a standardized exact equivalent of
register_t, but also IâÂÂve never seen anyone use it for anything.
I could be persuaded to leave that one alone.
sys/types.h also unconditionally defines int8_t, int16_t, int32_t, and
int64_t, which are the same as the C99 exact-width signed types in
stdint.h. POSIX doesnâÂÂt require these to appear in sys/types.h, so in
principle they ought to be brought under __USE_MISC also. But, when I
tried that it broke about two dozen files just in our own source tree,
and POSIX doesnâÂÂt *forbid* sys/types.h to define these types, so I
think we should leave them alone.
* posix/sys/types.h (u_int8_t, u_int16_t, u_int32_t, u_int64_t)
(register_t): Move under #ifdef __USE_MISC.
Consolidate adjacent #ifdef __USE_MISC blocks.
* scripts/check_obsolete_constructs.py: Add register_t to the
set of obsolete typedefs that our headers should not use
(but sys/types.h may still define).
commit 3b62e1b0911535b41c84bd63b3f0d8dd1611ff7b
Author: Zack Weinberg <zackw@panix.com>
Date: Tue Feb 19 08:45:22 2019 -0500
Define register_t using bits/typesizes.h macros.
Currently register_t is, unlike all other types in sys/types.h,
defined using a GCC extension (__attribute__((mode(word)))), falling
back to âÂÂintâ if the extension is unavailable. This is a potential
ABI compatibility hazard for people using non-GNU compilers with
glibc. ItâÂÂs also unnecessary; the bits/typesizes.h mechanism can
handle all of the existing variation in the definition. In most
cases, defining __REGISTER_T_TYPE as __SWORD_TYPE is sufficient.
Special handling is necessary for MIPS n32 and x86-64 x32, where
__SWORD_TYPE is âÂÂintâ and the appropriate type for register_t is
âÂÂlong longâÂÂ. Unfortunately, this means we need to create a new
bits/typesizes.h variant for linux/mips. This variant is based
on the top-level bits/typesizes.h, not linux/generic/bits/typesizes.h,
to match the existing MIPS ABIs.
Tested using build-many-glibcs. The c++-types test confirms that the
physical type of register_t does not change on any supported platform.
* posix/sys/types.h: Typedef register_t as __register_t.
* posix/bits/types.h: Typedef __register_t using __REGISTER_T_TYPE.
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h:
Define __REGISTER_T_TYPE as __SWORD_TYPE.
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h:
New file (copied from bits/typesizes.h).
Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and n64 ABIs.
Define __REGISTER_T_TYPE as __SQUAD_TYPE for n32.
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and 64-bit ABIs.
Define __REGISTER_T_TYPE as __SQUAD_TYPE for x32.
commit 5c6e0c779fc931edbc6e9647994bc40233d9f81c
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Feb 23 19:08:54 2019 -0500
Move most headers installed by top-level Makefile to misc/.
The Makefile glue to run tests on installed headers is currently
duplicated between the top-level Makefile and Rules, because the
top-level Makefile doesn't read Rules but does install some headers.
This patch moves most of the headers installed by the top-level Makefile
to misc/ (chosen arbitrarily; I'm open to putting them somewhere else
if reviewers feel it would be better) and removes the duplicated logic
from the top-level Makefile. I believe this also means that none of
the headers in include/ are installed headers anymore.
gnu/lib-names*.h are still generated by code in Makerules and installed
by the top-level Makefile. I tried to move them to misc/ as well, but
that broke the generation process in a manner that didn't make any sense
so I gave up. The tests performed on installed headers are not
especially useful for gnu/lib-names*.h so I think we can live with this
for now.
* include/bits/xopen_lim.h
* include/features.h
* include/gnu-versions.h
* include/gnu/libc-version.h
* include/limits.h
* include/stdc-predef.h
* include/values.h:
Move to misc/ and replace with a trivial wrapper.
* Makefile (headers): Remove all headers moved to misc/.
Don't set a vpath for %.h.
(check-installed-headers-c.out, check-installed-headers-cxx.out)
(check-wrapper-headers.out): Remove rules.
* misc/Makefile (headers): Add all of the above headers and
sort the list.
* sysdeps/mach/hurd/bits/errno.h: Regenerate.
commit ca537d7a89c383eae1987daf6f60b521f1c39ea4
Author: Zack Weinberg <zackw@panix.com>
Date: Thu May 16 13:34:27 2019 -0400
Remove support for PowerPC e500 / SPE ISA extension.
GCC 9 dropped support for the e500 variation of PowerPC, so I suggest
we should follow suit.
This patch was developed by grepping for âÂÂe500âÂÂ, âÂÂ__SPE__âÂÂ, and
âÂÂ__NO_FPRS__âÂÂ, and may not eliminate every vestige of e500 support.
Also, I left most uses of __NO_FPRS__ alone, as it was not clear to me
whether they might be relevant to normal embedded PowerPC with
soft-float.
Tested by attempting to configure with
CC=powerpc-x-linux-gnu-gcc --host=powerpc-x-linux-gnuspe
(this errors out, as intended) and by cross-building with
CC=powerpc-x-linux-gnu-gcc --host=powerpc-x-linux-gnu
(this still works).
--
* sysdeps/powerpc/preconfigure: Error out on powerpc-*-*gnuspe*
host type.
* scripts/build-many-glibcs.py: Remove powerpc-*-linux-gnuspe
and powerpc-*-linux-gnuspe-e500v1 from list of build configurations.
* sysdeps/powerpc/powerpc32/e500: Recursively delete.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500: Recursively delete.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h:
Delete.
* sysdeps/powerpc/fpu_control.h: Remove e500 code.
Issue an #error if used with an e500 compiler.
* sysdeps/powerpc/powerpc32/__longjmp_common.S
* sysdeps/powerpc/powerpc32/setjmp_common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
Remove e500 code.
* sysdeps/unix/sysv/linux/powerpc/elision-lock.c
* sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
Remove __SPE__ ifndefs.
Summary of changes (added commits):
-----------------------------------
5e0a3b4... Clarify status of wait.h and sys/bitypes.h
0d7629c... Don't include sys/types.h 8/n: Linux debugger headers
bea480d... Don't include sys/types.h 7/n: Linux misc
8ba85a7... Don't include sys/types.h 6/n: sys/epoll.h
cf6819b... Don't include sys/types.h 5/n: misc nonstandard headers
3b6eff6... Fixup for Don't include sys/types.h 1/n
b4dc8be... fixup for an uncertain patch
3c2904e... fixup probably for Don't include sys/select.h from sys/type
efb7444... fixup for sys/un.h: don't include string.h
6e3cceb... Don't include sys/types.h 3a/n: fixups for utmp{,x}.h
9c85db1... Don't include sys/types.h 4/n: sys/mtio.h
8fb0f23... DonâÂÂt include sys/types.h 3/n: utmp{,x}.h
7601868... sys/un.h: DonâÂÂt include string.h for strlen.
aac27ab... DonâÂÂt include sys/types.h from POSIX headers (2/n): net,
e4f5de2... Don't include sys/types.h from POSIX headers (1/n)
4bfa306... DonâÂÂt include sys/select.h from sys/types.h.
c94860e... Split up endian.h to minimize exposure of BYTE_ORDER.
7bbccaf... Limit the set of strings.h functions also exposed in string
f8b98ee... DonâÂÂt include sys/cdefs.h directly from public headers.
7b9c6f4... Swap sys/poll.h with poll.h.
d505962... Swap sys/syslog.h with syslog.h.
3c5201f... Add check-obsolete-constructs checker for nested includes.
69411ab... DonâÂÂt conditionalize declarations of ldiv_t, lldiv_t, __g
c0a0bc0... Create bits/types headers for most remaining __T_defined ma
2601711... Clean up bits/types.h.
f85c66a... Simplify definition of __time64_t.
3b8d660... Add caddr_t, daddr_t, and loff_t to the set of obsolete typ
ad4d473... sys/types.h: DonâÂÂt define u_intN_t or register_t unless _
86ec3f7... Define register_t using bits/typesizes.h macros.
11945db... Move most headers installed by top-level Makefile to misc/.
cb755ee... Add ChangeLog entry for previous commit.
a053e87... Remove support for PowerPC SPE extension (powerpc*-*-*gnusp
46ae073... Improve string benchtest timing
004e52f... sysvipc: Add missing bit of semtimedop s390 consolidation
c9c15ac... wcsmbs: Fix data race in __wcsmbs_clone_conv [BZ #24584]
7e740ab... libio: Fix gconv-related memory leak [BZ #24583]
09e1b0e... libio: Remove codecvt vtable [BZ #24588]
75c5157... support: Expose sbindir as support_sbindir_prefix
b62bb3b... support: Add missing EOL terminators on timespec
ff6bec7... support: Correct confusing comment
236c18e... sysvipc: Consolidate semtimedop s390
dfba907... sysvipc: Fix compat msgctl (BZ#24570)
1388600... Add NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from Linux 5.1 to
1f50f2a... Small tcache improvements
fef7c63... manual: Document O_DIRECTORY
5f161b2... Update kernel-features.h files for Linux 5.1.
commit 5e0a3b437d8cf30215017bd03567f6892abea8bb
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 12:31:23 2019 -0400
Clarify status of wait.h and sys/bitypes.h
These headers are like sys/poll.h and sys/syslog.h: they are backward
compatibility names for other headers. Clarify this by adjusting their
position within the HEADER_ALLOWED_INCLUDES table.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Move entries for sys/bitypes.h and wait.h next to entries for
sys/poll.h and sys/syslog.h, and update the commentary for that
group of headers.
commit 0d7629caf2df59fffda2be01f5da95901642d1c0
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 12:30:46 2019 -0400
Don't include sys/types.h 8/n: Linux debugger headers
The debugger interface headers are a mess and I only have so much
patience for them. This does the bare minimum required for
thread_db.h, sys/procfs.h, and sys/user.h, which are at least
nominally cross-platform interfaces, to avoid including sys/types.h,
sys/time.h, and/or signal.h. Exposure of sys/ucontext.h is reduced
but not eliminated. Cross-architecture consistency should be improved.
* sysdeps/nptl/sys/procfs.h: Include features.h and bits/types.h,
not sys/types.h.
* sysdeps/nptl/thread_db.h: DonâÂÂt include sys/types.h.
* sysdeps/nptl/proc_service.h: Include stddef.h for size_t.
Include bits/types/pid_t.h.
* sysdeps/unix/sysv/linux/sys/procfs.h: Include bits/types.h and
bits/types/struct_timeval.h, not sys/time.h or sys/types.h.
* sysdeps/unix/sysv/linux/aarch64/bits/procfs.h: Add multiple
inclusion guard. Include bits/types.h. Correct a comment.
* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h:
Add multiple inclusion guard. Include sys/ucontext.h.
* sysdeps/unix/sysv/linux/alpha/bits/procfs.h:
Add multiple inclusion guard. DonâÂÂt include signal.h or
sys/ucontext.h.
* sysdeps/unix/sysv/linux/alpha/sys/user.h:
Include features.h. Include stddef.h for size_t. Move
inclusion of asm/reg.h above documentation comment.
* sysdeps/unix/sysv/linux/arm/bits/procfs.h: Add multiple
inclusion guard. Improve commentary.
* sysdeps/unix/sysv/linux/arm/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/csky/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/hppa/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/ia64/bits/procfs.h: Add multiple
inclusion guard. Include sys/ucontext.h, not signal.h.
* sysdeps/unix/sysv/linux/ia64/sys/user.h: DonâÂÂt include
sys/types.h. Include stddef.h for size_t.
* sysdeps/unix/sysv/linux/m68k/bits/procfs.h: Add multiple
inclusion guard. Improve commentary.
* sysdeps/unix/sysv/linux/m68k/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/microblaze/bits/procfs.h: Add multiple
inclusion guard. Improve commentary.
* sysdeps/unix/sysv/linux/microblaze/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/mips/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/mips/sys/user.h: Include features.h.
Define __need_size_t before including stddef.h. Move inclusion
of sgidefs.h below standard headers.
* sysdeps/unix/sysv/linux/nios2/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/nios2/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/powerpc/bits/procfs.h: Add multiple
inclusion guard. DonâÂÂt include signal.h or sys/ucontext.h.
Include bits/wordsize.h and asm/elf.h. Adjust conditional for
whether to provide various fallback definitions.
* sysdeps/unix/sysv/linux/powerpc/sys/user.h: Include features.h.
Define __need_size_t before including stddef.h.
* sysdeps/unix/sysv/linux/riscv/bits/procfs.h: Add multiple
inclusion guard. Add comment noting potential problems with
use of sys/ucontext.h.
* sysdeps/unix/sysv/linux/s390/bits/procfs.h: Add multiple
inclusion guard. Add comment noting potential problems with
use of sys/ucontext.h.
* sysdeps/unix/sysv/linux/s390/sys/user.h: Include features.h.
* sysdeps/unix/sysv/linux/sh/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/sh/sys/user.h: Include features.h.
Define __need_size_t before including stddef.h. Include
asm/ptrace after above two headers.
* sysdeps/unix/sysv/linux/sparc/bits/procfs.h: Add multiple
inclusion guard. DonâÂÂt include signal.h or sys/ucontext.h.
* sysdeps/unix/sysv/linux/sparc/sys/user.h: Include features.h.
Define __need_size_t before including stddef.h.
* sysdeps/unix/sysv/linux/x86/bits/procfs.h: Add multiple
inclusion guard.
* sysdeps/unix/sysv/linux/x86/sys/user.h: Include features.h.
* scripts/check-obsolete-constructs.py
(HEADER_ALLOWED_INCLUDES, SYSDEP_ALLOWED_INCLUDES): Update.
commit bea480d688bd535ea0170c980753c53baa9f8f4c
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 12:08:40 2019 -0400
Don't include sys/types.h 7/n: Linux misc
These headers only have Linux-specific incarnations and can easily
avoid including sys/types.h.
* sysdeps/unix/sysv/linux/alpha/sys/acct.h: Style fix.
* sysdeps/unix/sysv/linux/sys/acct.h: Include features.h
and bits/stdint-uintn.h. Don't include sys/types.h, stdint.h,
or bits/types/time_t.h.
* sysdeps/unix/sysv/linux/sys/fsuid.h
* sysdeps/unix/sysv/linux/sys/quota.h
Include bits/types.h, not sys/types.h.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Update.
commit 8ba85a77a5b70086599850969f3e6256907eaca3
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 12:06:13 2019 -0400
Don't include sys/types.h 6/n: sys/epoll.h
I thought I was going to need to change all of the arch-specific
bits/epoll.h headers as well, but it turned out not to be necessary.
I still took the opportunity to give them all multiple inclusion
guards.
* sysdeps/unix/sysv/linux/sys/epoll.h: DonâÂÂt include stdint.h
or sys/types.h. Do include features.h and bits/types.h.
(union epoll_data, struct epoll_event): Use __uint32_t and
__uint64_t for field types.
* sysdeps/unix/sysv/linux/alpha/bits/epoll.h
* sysdeps/unix/sysv/linux/bits/epoll.h
* sysdeps/unix/sysv/linux/hppa/bits/epoll.h
* sysdeps/unix/sysv/linux/mips/bits/epoll.h
* sysdeps/unix/sysv/linux/sparc/bits/epoll.h
* sysdeps/unix/sysv/linux/x86/bits/epoll.h:
Add multiple inclusion guard.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Update.
commit cf6819bb624a6a952428d8d77480b0e9972d510c
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:49:25 2019 -0400
Don't include sys/types.h 5/n: misc nonstandard headers
Many nonstandard headers can also easily avoid including sys/types.h.
* elf/link.h, inet/aliases.h, misc/sys/xattr.h:
Don't include sys/types.h. Include stddef.h for size_t.
* gmon/sys/gmon.h: Don't include sys/types.h.
* gmon/sys/profil.h: Don't include sys/types.h.
Include stddef.h for size_t. Include bits/types/struct_timeval.h.
* io/fts.h: Don't include sys/types.h.
Include bits/types/dev_t.h, bits/types/ino_t.h, bits/types/ino64_t.h,
and bits/types/nlink_t.h.
* io/sys/sendfile.h: Don't include sys/types.h.
Include stddef.h for size_t.
Include bits/types.h, bits/types/off_t.h, and bits/types/ssize_t.h.
* stdlib/sys/random.h: Don't include sys/types.h.
Include stddef.h for size_t.
Include bits/types/ssize_t.h.
* gmon/tst-sprofil.h: Include sys/time.h.
* sysdeps/mach/hurd/sendfile.c: Include sys/types.h.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): Update.
commit 3b6eff6f195749a07f8c13cad0ff384aad334ffa
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:14:13 2019 -0400
Fixup for Don't include sys/types.h 1/n
1/n partially mitigates Hurd-specific bug 23088 and therefore some
xfail annotations can be removed.
* sysdeps/mach/hurd/i386/Makefile: Remove test-xfail-*/*/conform
for semaphore.h, ftw.h, and sys/uio.h.
commit b4dc8be2d7dfcff67063ce36f63b64eb6b629fd0
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:11:33 2019 -0400
fixup for an uncertain patch
I'm not sure which public header change requires dl-fileid.h to change
in this way.
* sysdeps/posix/dl-fileid.h (r_file_id): Use __dev_t and __ino64_t
for field types.
commit 3c2904e1b4ed93cf04789b7a1d78408fa9137f4a
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:07:20 2019 -0400
fixup probably for Don't include sys/select.h from sys/types.h
Not including sys/select.h from sys/types.h means that sys/types.h
also no longer defines anything from sys/time.h, and a couple of
files were relying on that.
(pthread_join_common.c should be using clock_gettime instead of
gettimeofday, but that's out of scope for this patch series.)
* nptl/pthread_join_common.c, sysdeps/unix/sysv/linux/dl-vdso.h:
Include sys/time.h.
commit efb7444b0f8a0277dafb49d06c9d1c231418d041
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 11:02:27 2019 -0400
fixup for sys/un.h: don't include string.h
1) For a valid prototype of strlen, sys/un.h must define size_t.
2) Some old RPC code was relying on sys/un.h to provide all of string.h.
* socket/sys/un.h: Include stddef.h for size_t.
* nis/nis_domain_of.c, nis/yp_xdr.c, sunrpc/svc.c: Include string.h.
commit 6e3ccebdc581628eee22ee30788159eaa38e0c59
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 10:44:34 2019 -0400
Don't include sys/types.h 3a/n: fixups for utmp{,x}.h
The conform tests expect utmpx.h to define time_t and suseconds_t.
These are the public names for the types of the fields of struct timeval,
and utmpx.h is required to define struct timeval, so this is a reasonable
expectation even though POSIX doesn't _explicitly_ say it's also required
to define time_t and suseconds_t.
utmp.h is not a standard header but it makes sense for it to be as consistent
with utmpx.h as possible, especially in our implementation where /var/log/utmp
and /var/log/utmpx have the same format.
* login/utmp.h, login/utmpx.h: Include bits/types/suseconds_t.h
and bits/types/time_t.h.
commit 9c85db187d07ad9023c1e08b980198ee06fad111
Author: Zack Weinberg <zackw@panix.com>
Date: Sun May 26 10:43:50 2019 -0400
Don't include sys/types.h 4/n: sys/mtio.h
sys/mtio.h is another header that's unnecessarily in sysdeps/; the
only version we have is sysdeps/gnu/sys/mtio.h. Move to misc, and
remove its unnecessary inclusion of sys/types.h while we're at it.
This header uses the _IO* macros and therefore needs to continue
including sys/ioctl.h for now.
* sysdeps/gnu/sys/mtio.h: Move to misc/sys/mtio.h.
Don't include sys/types.h.
* sysdeps/gnu/Makefile: Don't add anything to sysdep_headers
for the misc directory.
* misc/Makefile (headers): Add sys/mtio.h.
* include/sys/mtio.h: New wrapper.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): Update.
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch zack/no-nested-includes
# Your branch and 'origin/zack/no-nested-includes' have diverged,
# and have 35 and 16 different commits each, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
# new file: include/sys/mtio.h
# modified: misc/Makefile
# renamed: sysdeps/gnu/sys/mtio.h -> misc/sys/mtio.h
# modified: sysdeps/gnu/Makefile
#
# Changes not staged for commit:
# modified: elf/link.h
# modified: gmon/sys/gmon.h
# modified: gmon/sys/profil.h
# modified: gmon/tst-sprofil.c
# modified: inet/aliases.h
# modified: io/fts.h
# modified: io/sys/sendfile.h
# modified: login/utmp.h
# modified: login/utmpx.h
# modified: misc/sys/xattr.h
# modified: nis/nis_domain_of.c
# modified: nis/yp_xdr.c
# modified: nptl/pthread_join_common.c
# modified: scripts/check-obsolete-constructs.py
# modified: socket/sys/un.h
# modified: stdlib/sys/random.h
# modified: sunrpc/svc.c
# modified: sysdeps/mach/hurd/i386/Makefile
# modified: sysdeps/mach/hurd/sendfile.c
# modified: sysdeps/nptl/proc_service.h
# modified: sysdeps/nptl/sys/procfs.h
# modified: sysdeps/nptl/thread_db.h
# modified: sysdeps/posix/dl-fileid.h
# modified: sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/aarch64/sys/user.h
# modified: sysdeps/unix/sysv/linux/alpha/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
# modified: sysdeps/unix/sysv/linux/alpha/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/alpha/sys/acct.h
# modified: sysdeps/unix/sysv/linux/alpha/sys/user.h
# modified: sysdeps/unix/sysv/linux/arm/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/arm/sys/user.h
# modified: sysdeps/unix/sysv/linux/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/csky/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/dl-vdso.h
# modified: sysdeps/unix/sysv/linux/hppa/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/hppa/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/ia64/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/ia64/sys/user.h
# modified: sysdeps/unix/sysv/linux/m68k/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/m68k/sys/user.h
# modified: sysdeps/unix/sysv/linux/microblaze/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/microblaze/sys/user.h
# modified: sysdeps/unix/sysv/linux/mips/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/mips/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/mips/sys/user.h
# modified: sysdeps/unix/sysv/linux/nios2/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/nios2/sys/user.h
# modified: sysdeps/unix/sysv/linux/powerpc/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/powerpc/sys/user.h
# modified: sysdeps/unix/sysv/linux/riscv/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/s390/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/s390/sys/user.h
# modified: sysdeps/unix/sysv/linux/sh/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/sh/sys/user.h
# modified: sysdeps/unix/sysv/linux/sparc/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/sparc/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/sparc/sys/user.h
# modified: sysdeps/unix/sysv/linux/sys/acct.h
# modified: sysdeps/unix/sysv/linux/sys/epoll.h
# modified: sysdeps/unix/sysv/linux/sys/fsuid.h
# modified: sysdeps/unix/sysv/linux/sys/procfs.h
# modified: sysdeps/unix/sysv/linux/sys/quota.h
# modified: sysdeps/unix/sysv/linux/x86/bits/epoll.h
# modified: sysdeps/unix/sysv/linux/x86/bits/procfs.h
# modified: sysdeps/unix/sysv/linux/x86/sys/user.h
#
commit 8fb0f23ba17c484d62f55ff99e714ef940058156
Author: Zack Weinberg <zackw@panix.com>
Date: Wed May 22 15:37:30 2019 -0400
DonâÂÂt include sys/types.h 3/n: utmp{,x}.h
utmp.h and utmpx.h are also set up for system-dependence that is no
longer necessary. In fact, I think we might be able to fold their
respective bits headers into the primary headers and make them not
system-dependent at all. The remaining variation is between
s390*-*-linux* and everything else, and it appears to me that the s390
versions of the bits headers are actually the headers that everyone
should be using. The only difference is that the s390 headers
unconditionally use 64-bit quantities for lastlog.ll_time,
utmp{,x}.ut_tv, and utmp{,x}.ut_session, whereas the generic headers
use either 64- or 32-bit quantities depending on __WORDSIZE_TIME64_COMPAT32.
I could be wrong, but I donâÂÂt think it makes sense for programs with
64-bit and 32-bit time_t to have different ideas of the layout of a
structures that are copied directly to and from a shared file on disk.
Anyway, I didnâÂÂt fix that now; it should be its own patch. What I did
do, in addition to pruning the headers included by utmp.h, utmpx.h,
bits/utmp.h, and bits/utmpx.h, is some cleanup of a distinction
between GNU and non-GNU systems that is no longer relevant. This
patch is smaller than it looks, because git doesnâÂÂt understand what
actually happened with bits/utmp.h and sysdeps/gnu/bits/utmp.h. The
true set of deletions and renames is:
rm bits/utmp.h
mv sysdeps/gnu/bits/utmp.h bits/utmp.h
mv sysdeps/gnu/bits/utmpx.h bits/utmpx.h
mv sysdeps/gnu/utmpx.h login/utmpx.h
I also made the inclusion of utmpx.h and the utmpx routines
unconditional in login/Makefile.
* bits/utmp.h: Delete file.
* sysdeps/gnu/bits/utmp.h: Move to bits/utmp.h.
Add multiple include guard.
DonâÂÂt include paths.h, sys/time.h, or sys/types.h.
DonâÂÂt use struct timeval.
Use __intN_t for consistency with bits/utmpx.h.
* sysdeps/unix/sysv/linux/s390/bits/utmp.h: Add multiple include guard.
DonâÂÂt include paths.h, sys/time.h, sys/types.h, or bits/wordsize.h.
DonâÂÂt use struct timeval.
Use __intN_t for consistency with bits/utmpx.h.
Use __time64_t unconditionally for lastlog.ll_time.
Use __int64_t unconditionally for utmp.ut_session.
Adjust indentation and blank lines to match bits/utmp.h.
* sysdeps/gnu/bits/utmpx.h: Move to bits/utmpx.h.
Add multiple include guard.
DonâÂÂt include paths.h, sys/time.h, bits/types.h, or bits/wordsize.h.
DonâÂÂt define _PATH_UTMPX or _PATH_WTMPX.
DonâÂÂt use struct timeval.
Use pid_t for consistency with bits/utmp.h.
* sysdeps/unix/sysv/linux/s390/bits/utmpx.h: Add multiple include guard.
DonâÂÂt define _PATH_UTMPX or _PATH_WTMPX.
DonâÂÂt include paths.h, sys/time.h, bits/types.h, or bits/wordsize.h.
DonâÂÂt define _PATH_UTMPX or _PATH_WTMPX.
DonâÂÂt use struct timeval.
Use pid_t for consistency with bits/utmp.h.
Use __int64_t unconditionally for utmpx.ut_session.
* login/utmp.h: DonâÂÂt include sys/types.h.
Do include paths.h, bits/types.h, bits/types/pid_t.h, and
bits/types/struct_timeval.h.
Move __BEGIN_DECLS to enclose only prototypes.
* sysdeps/gnu/utmpx.h: Move to login/utmpx.h.
DonâÂÂt include sys/time.h.
Do include bits/types.h and bits/types/struct_timeval.h.
When __USE_GNU, include paths.h and define _PATH_UTMPX and _PATH_WTMPX.
* login/Makefile (headers): Add utmpx.h and bits/utmpx.h.
(routines): Add endutxent, getutmp, getutmpx, getutxent,
getutxid, getutxline, pututxline, setutxent, updwtmpx, and
utmpxname. Reorganize.
* sysdeps/gnu/Makefile: Do not add anything to sysdep_routines
or sysdep_headers when subdir == login.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): Update.
commit 7601868f254a09a17045ec4d6a0fceeceb99aea8
Author: Zack Weinberg <zackw@panix.com>
Date: Wed May 22 12:03:57 2019 -0400
sys/un.h: DonâÂÂt include string.h for strlen.
sys/un.h needs strlen in order to define SUN_LEN, but does not need
any of the other things declared by string.h; the path of least
resistance is to prototype strlen locally.
Also, the construct being used to get the size of everything up to the
sun_path member contains a formal dereference of a null pointer and
therefore has undefined behavior. Replace with __SOCKADDR_COMMON_SIZE.
* sys/un.h [__USE_MISC]: DonâÂÂt include string.h. Prototype
strlen locally. Use __SOCKADDR_COMMON_SIZE for size of
leading members of struct sockaddr_un.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): Update.
commit aac27aba947198f7d85e8a424ce433a8df731e78
Author: Zack Weinberg <zackw@panix.com>
Date: Wed May 22 09:32:46 2019 -0400
DonâÂÂt include sys/types.h from POSIX headers (2/n): net, netinet
This patch changes net/if.h, netinet/in_systm.h, netinet/ip.h, and
netinet/tcp.h to avoid including sys/types.h and/or stdint.h. They
primarily wanted these headers for the uintN_t types; all of them
except net/if.h now include <bits/stdint-uintn.h> instead, which means
they expose the uintN_t types. We could go further and have them use
__uintN_t types instead but IâÂÂm not sure that would be better.
None of these headers are supposed to include <sys/socket.h> or
<netinet/in.h> either, but they all need struct sockaddr and/or
struct sockaddr_in. I am not sure whether I will get to that in
this patch series.
While I was at it, I noticed that all of these headers exist only in
sysdeps/generic and sysdeps/gnu. This means they arenâÂÂt really
system-dependent and can be repatriated to the directories that
install them.
* sysdeps/generic/netinet/in_systm.h: Rename to
inet/netinet/in_systm.h. Include bits/stdint-uintn.h,
not sys/types.h or stdint.h.
* sysdeps/generic/netinet/ip.h: Rename to
inet/netinet/ip.h. Include bits/stdint-uintn.h and
bits/endian.h, not sys/types.h.
* sysdeps/gnu/netinet/tcp.h: Rename to
inet/netinet/tcp.h. Include bits/stdint-uintn.h and
bits/endian.h, not sys/types.h or stdint.h.
* sydeps/gnu/net/if.h: Rename to socket/net/if.h.
DonâÂÂt include sys/types.h.
* include/net/if.h: Include socket/net/if.h, rather than
whatever the next net/if.h on the include path is.
* include/netinet/in_systm.h, include/netinet/ip.h
* include/netinet/tcp.h: New trivial wrappers.
* sysdeps/generic/net/if.h: Delete, never used.
* sysdeps/generic/netinet/tcp.h: Delete, never used.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES): Update.
commit e4f5de2e46a1fbe45206914e4bf4ca4864b22fc1
Author: Zack Weinberg <zackw@panix.com>
Date: Tue May 21 19:05:39 2019 -0400
Don't include sys/types.h from POSIX headers (1/n)
Many POSIX headers are including sys/types.h when they are only supposed
to expose a small number of types from that header. There will be several
patches in this sub-series; this one does the easiest cases.
* io/ftw.h: Don't include sys/types.h.
* misc/sys/uio.h: Don't include sys/types.h.
Include bits/types.h and bits/types/ssize_t.h.
Include stddef.h for size_t.
* posix/spawn.h: Don't include sys/types.h.
Include bits/types.h, bits/types/mode_t.h, and bits/types/pid_t.h.
* rt/aio.h: Don't include sys/types.h.
Include bits/types.h, bits/pthreadtypes.h, and bits/types/ssize_t.h.
Include stddef.h for size_t.
* sysdeps/pthread/semaphore.h: Don't include sys/types.h.
* sysdeps/unix/sysv/linux/bits/uio-ext.h: Use __pid_t, not pid_t.
* scripts/check-obsolete-constructs.py
(HEADER_ALLOWED_INCLUDES): Update.
commit 4bfa3065977721c2b6a4bbef569618e481750286
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 12:35:25 2019 -0400
DonâÂÂt include sys/select.h from sys/types.h.
This is supposedly present for BSD compatibility, but the current
generation of BSDs is not consistent about it: FreeBSD does, OpenBSD
doesnâÂÂt, NetBSD exposes only fd_set and the FD_* macros. Programs
that need to wait for any of multiple I/O events have several
alternatives to select nowadays, so I think it makes sense to expose
select only to programs that specifically want it.
Only a few places within our own code are affected. A few test
programs need to include sys/select.h explicitly, as does rpc/svc.h.
sysdeps/nptl/thread_db.h needs to declare sigset_t, and
sysdeps/unix/sysv/linux/pselect.c was including sys/poll.h instead of
sys/select.h, which is probably a copy-and-paste error. sys/socket.h
needs to forward-declare struct timespec under __USE_GNU, because
recvmmsg has a struct timespec * argument; IâÂÂm open to the possibility
of having it fully declare struct timespec.
I considered taking sys/select.h out of sys/time.h as well, but POSIX
not only explicitly allows this inclusion, it requires sys/time.h to
declare almost everything that sys/select.h declares. It doesnâÂÂt seem
worth creating another bits header just to prevent sys/time.h from
declaring pselect, sigset_t, and struct timespec.
* posix/sys/types.h: DonâÂÂt include sys/select.h.
* scripts/check-obsolete-constructs.py: Remove whitelist entry
for sys/types.h -> sys/select.h. Adjust commentary re
sys/time.h -> sys/select.h.
* socket/sys/socket.h: When __USE_GNU, forward-declare struct timespec.
* misc/tst-fdset.c, nptl/tst-cancel4.c, scripts/check-c++-types.sh
* sunrpc/rpc/svc.h: Include sys/select.h.
* sysdeps/nptl/thread_db.h: Include bits/types/sigset_t.h.
* sysdeps/unix/sysv/linux/pselect.c: Include sys/select.h,
not sys/poll.h.
commit c94860e5bb5c7b1393c14ae49d117b818cc7e5a1
Author: Zack Weinberg <zackw@panix.com>
Date: Fri Mar 15 09:02:24 2019 -0400
Split up endian.h to minimize exposure of BYTE_ORDER.
With only two exceptions (sys/types.h and sys/param.h, both of which
historically might have defined BYTE_ORDER) the public headers that
include <endian.h> only want to be able to test __BYTE_ORDER against
__*_ENDIAN.
This patch creates a new bits/endian.h that can be included by any
header that wants to be able to test __BYTE_ORDER and/or
__FLOAT_WORD_ORDER against the __*_ENDIAN constants, or needs
__LONG_LONG_PAIR. It only defines macros in the implementation
namespace.
The existing bits/endian.h (which could not be included independently
of endian.h, and only defines __BYTE_ORDER and maybe __FLOAT_WORD_ORDER)
is renamed to bits/endianness.h. I also took the opportunity to
canonicalize the form of this header, which we are stuck with having
one copy of per architecture. Since they are so short, this means git
doesnâÂÂt understand that they were renamed from existing headers, sigh.
endian.h itself is a nonstandard header and its only remaining use
from a standard header is guarded by __USE_MISC, so I dropped the
__USE_MISC conditionals from around all of the public-namespace things
it defines. (This means, an application that requests strict library
conformance but includes endian.h will still see the definition of
BYTE_ORDER.)
A few changes to specific bits/endian(ness).h variants deserve
mention:
- sysdeps/unix/sysv/linux/ia64/bits/endian.h is moved to
sysdeps/ia64/bits/endianness.h. If I remember correctly, ia64 did
have selectable endianness, but we have assembly code in
sysdeps/ia64 that assumes itâÂÂs little-endian, so there is no reason
to treat the ia64 endianness.h as linux-specific.
- The C-SKY port does not fully support big-endian mode, but I do
not think this is sufficient reason to make csky/bits/endian(ness).h
error out if __CSKYBE__ is defined, so it now defines __BYTE_ORDER
appropriately for whichever mode the compiler is in.
- The PowerPC port had extra logic in its bits/endian.h to detect a
broken compiler, which strikes me as unnecessary, so I removed it.
- The only files that defined __FLOAT_WORD_ORDER always defined it to
the same value as __BYTE_ORDER, so I removed those definitions.
The SH bits/endian(ness).h had comments inconsistent with the
actual setting of __FLOAT_WORD_ORDER, which I also removed.
- I *removed* copyright boilerplate from the few bits/endian(ness).h
headers that had it; these files record a single fact in a fashion
dictated by an external spec, so I do not think they are copyrightable.
As long as I was changing every copy of ieee754.h in the tree, I
noticed that only the MIPS variant includes float.h, because it uses
LDBL_MANT_DIG to decide among three different versions of
ieee854_long_double. This patch makes it not include float.h when
GCCâÂÂs intrinsic __LDBL_MANT_DIG__ is available.
* string/endian.h: Unconditionally define LITTLE_ENDIAN,
BIG_ENDIAN, PDP_ENDIAN, and BYTE_ORDER. Condition byteswapping
macros only on !__ASSEMBLER__. Move the definitions of
__BIG_ENDIAN, __LITTLE_ENDIAN, __PDP_ENDIAN, __FLOAT_WORD_ORDER,
and __LONG_LONG_PAIR to...
* string/bits/endian.h: ...this new file, which includes
the renamed header bits/endianness.h for the definition of
__BYTE_ORDER and possibly __FLOAT_WORD_ORDER.
* string/Makefile: Install bits/endianness.h.
* include/bits/endian.h: New wrapper.
* bits/endian.h: Rename to bits/endianness.h.
Add multiple-include guard. Rewrite the comment explaining what
the machine-specific variants of this file should do.
* sysdeps/unix/sysv/linux/ia64/bits/endian.h:
Move to sysdeps/ia64.
* sysdeps/aarch64/bits/endian.h
* sysdeps/alpha/bits/endian.h
* sysdeps/arm/bits/endian.h
* sysdeps/csky/bits/endian.h
* sysdeps/hppa/bits/endian.h
* sysdeps/ia64/bits/endian.h
* sysdeps/m68k/bits/endian.h
* sysdeps/microblaze/bits/endian.h
* sysdeps/mips/bits/endian.h
* sysdeps/nios2/bits/endian.h
* sysdeps/powerpc/bits/endian.h
* sysdeps/riscv/bits/endian.h
* sysdeps/s390/bits/endian.h
* sysdeps/sh/bits/endian.h
* sysdeps/sparc/bits/endian.h
* sysdeps/x86/bits/endian.h:
Rename to endianness.h; canonicalize form of file; remove
redundant definitions of __FLOAT_WORD_ORDER.
* sysdeps/csky/bits/endianness.h: Do not error out if __CSKYEB__
is defined.
* sysdeps/powerpc/bits/endianness.h: Remove logic to check for
broken compilers.
* ctype/ctype.h
* inet/netinet/in.h
* resolv/arpa/nameser_compat.h
* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
* sysdeps/csky/nptl/bits/pthreadtypes-arch.h
* sysdeps/ia64/ieee754.h
* sysdeps/ieee754/ieee754.h
* sysdeps/ieee754/ldbl-128/ieee754.h
* sysdeps/ieee754/ldbl-128ibm/ieee754.h
* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
* sysdeps/mips/ieee754/ieee754.h
* sysdeps/mips/nptl/bits/pthreadtypes-arch.h
* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
* sysdeps/nptl/pthread.h
* sysdeps/riscv/nptl/bits/pthreadtypes-arch.h
* sysdeps/sh/nptl/bits/pthreadtypes-arch.h
* sysdeps/sparc/sparc32/ieee754.h
* sysdeps/unix/sysv/linux/generic/bits/stat.h
* sysdeps/unix/sysv/linux/generic/bits/statfs.h
* sysdeps/unix/sysv/linux/sys/acct.h
* wctype/bits/wctype-wchar.h:
Include bits/endian.h, not endian.h.
* sysdeps/unix/sysv/linux/hppa/pthread.h: DonâÂÂt include endian.h.
* sysdeps/mips/ieee754/ieee754.h: Use __LDBL_MANT_DIG__
in ifdefs, instead of LDBL_MANT_DIG. Only include float.h
when __LDBL_MANT_DIG__ is not predefined, in which case
define __LDBL_MANT_DIG__ to equal LDBL_MANT_DIG.
* scripts/check-obsolete-constructs.h: Remove most of the
whitelist entries for endian.h and float.h.
commit 7bbccaf5c38075f93bec5b02b5c4c503a4045dcd
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 21:01:12 2019 -0400
Limit the set of strings.h functions also exposed in string.h.
As someone who can remember when you might not be able to include both
string.h and strings.h at the same time, it annoys me that strings.h
still exists and is the only standard source for str(n)casecmp(_l) and
ffs. I think itâÂÂs right that we expose those functions from string.h.
However, thereâÂÂs no reason we need to keep exposing the other obsolete
functions that strings.h declares from string.h.
This patch creates <bits/strings_x2k8.h>, which declares the
non-obsolete functions whose official home is strings.h. strings.h
includes it unconditionally, and string.h includes it under
__USE_MISC, instead of strings.h.
Two tests of the obsolete strings.h functions had to be adjusted.
* string/strings.h (strcasecmp, strncasecmp, strcasecmp_l)
(strncasecmp_l, ffs, ffsl, ffsll): Move declarations to...
* string/bits/strings_x2k8.h: ... this new file.
* string/Makefile: Install bits/strings_x2k8.h.
* include/bits/strings_x2k8h: New wrapper.
* string/string.h: Include bits/strings_x2k8.h instead of
strings.h.
* debug/tst-chk1.c, string/test-string.h: Include strings.h.
* scripts/check-obsolete-constructs.py: string.h is no longer
expected to include strings.h.
* sysdeps/i386/i686/multiarch/bcopy.c
* sysdeps/i386/i686/multiarch/bzero.c
* sysdeps/i386/i686/multiarch/ifunc-impl-list.c
* sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
* sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c
* sysdeps/powerpc/powerpc64/multiarch/bcopy.c
* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
* sysdeps/s390/bzero.c
* sysdeps/s390/multiarch/ifunc-impl-list.c
* sysdeps/sparc/sparc64/multiarch/bzero.c
* sysdeps/sparc/sparc64/multiarch/ifunc-impl-list.c:
Include strings.h.
commit f8b98ee3faf2763aa3ad4df9b50e3d199c45b5a5
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 16 14:31:08 2019 -0400
DonâÂÂt include sys/cdefs.h directly from public headers.
The convention throughout glibc is that every public header includes
features.h directly, as its first action, and relies on features.h to
include sys/cdefs.h. In a few places, though, itâÂÂs been done the
other way around, usually in headers that were copied from a BSD
source (where the convention is exactly the opposite). This patch
makes all installed headers match the glibc convention.
This patch also corrects a bug in glob.h: it may declare size_t
without notifying stddef.h that it has done this, so e.g.
#define _XOPEN_SOURCE 700
#include <glob.h>
#include <stddef.h>
int dummy;
declares size_t twice, which is invalid prior to C2011. I wasnâÂÂt able
to persuade gcc 8 to issue an error, even with -std=c89 -Wsystem-headers,
but clang is not so lenient.
* posix/glob.h: Include features.h, not sys/cdefs.h.
When __USE_XOPEN || USE_XOPEN2K8, include stddef.h for size_t;
otherwise, issue an immediate #error if __SIZE_TYPE__ is not
available. Use __gsize_t, not __size_t, as an impl-namespace
alternative name for size_t.
* conform/data/glob.h-data: Adjust to match.
* inet/netinet/igmp.h, mach/lock-intern.h, misc/ar.h
* misc/sys/auxv.h, resolv/resolv.h, socket/sys/un.h
* sunrpc/rpc/auth_des.h, sunrpc/rpc/rpc_msg.h
* sysdeps/generic/memcopy.h, sysdeps/generic/netinet/tcp.h
* sysdeps/htl/pthread.h, sysdeps/mach/hurd/net/ethernet.h
* sysdeps/mach/hurd/net/if_arp.h: Include features.h, not sys/cdefs.h.
* scripts/check-obsolete-constructs.py: Remove most whitelist
entries for sys/cdefs.h.
commit 7b9c6f47ba88c3e558d798fb64c5451b2719cdfd
Author: Zack Weinberg <zackw@panix.com>
Date: Sun Mar 17 09:50:36 2019 -0400
Swap sys/poll.h with poll.h.
Similarly to (sys/)syslog.h, poll.h is the header standardized by
POSIX, but we had all of its contents in sys/, for historical reasons.
This patch exchanges the contents of the two headers, and adds
multiple-include guards to all of poll.hâÂÂs bits headers.
* io/poll.h: Exchange contents with...
* io/sys/poll.h: ...this file. Adjust guard macros.
* include/poll.h: Exchange contents with...
* include/sys/poll.h: ...this file. Adjust guard macros.
* bits/poll.h, io/bits/poll2.h
* sysdeps/unix/sysv/linux/bits/poll.h
* sysdeps/unix/sysv/linux/m68k/bits/poll.h
* sysdeps/unix/sysv/linux/mips/bits/poll.h
* sysdeps/unix/sysv/linux/sparc/bits/poll.h:
Allow inclusion by poll.h, not sys/poll.h. Add multiple-
include guards where not already present.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Remove entry for poll.h; add entry for sys/poll.h.
commit d5059620e1bd93bf5c1ef99d7de33aa04a629335
Author: Zack Weinberg <zackw@panix.com>
Date: Sun Mar 17 09:31:56 2019 -0400
Swap sys/syslog.h with syslog.h.
Our installed syslog.h is a trivial wrapper around sys/syslog.h, which
is where all the actual declarations are. This is backward from
POSIX, which specifies syslog.h and its contents, and does not specify
sys/syslog.h. This arrangement appears to have been inherited from
some BSD-phylum C library, and probably pre-dates any standardization
of syslog.
This patch swaps the contents of syslog.h and sys/syslog.h, so that
the actual declarations appear under the standardized name. Since it
is necessary to adjust all of syslog.hâÂÂs bits headers, I also added
multiple-include guards to those files that didnâÂÂt already have
them. (All installed headers should have multiple-include guards,
even if they are internal and only used in one public header. The
âÂÂnever include this file directlyâ #error convention doesnâÂÂt protect
against including the internal header a second time after its parent
header has already been included.)
* misc/sys/syslog.h: Exchange contents with...
* misc/syslog.h: ...this file. Adjust multiple-include guards.
* include/sys/syslog.h: Exchange contents with...
* include/syslog.h: ...this file. Adjust multiple-include guards.
* bits/syslog-path.h, misc/bits/syslog-ldbl.h
* misc/bits/syslog.h: Allow inclusion by syslog.h, not sys/syslog.h.
Add multiple-include guard where not already present.
* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES):
Add new group for sys/ headers that do nothing but include a
top-level header with the same basename, containing entry for
sys/syslog.h; remove entry for syslog.h.
commit 3c5201f8c59161f1c5577110b38834f409d6a44d
Author: Zack Weinberg <zackw@panix.com>
Date: Thu Mar 14 21:03:23 2019 -0400
Add check-obsolete-constructs checker for nested includes.
As a first step toward minimizing the number of public headers that
include other public headers, add a checker to check-obsolete-constructs
that will error out on any such inclusion thatâÂÂs not on a whitelist.
The whitelist is initialized to all of the nested inclusions that
already exist; subsequent patches will remove nested inclusions and
shrink the whitelist, hopefully to the point where we only have
nested inclusions as mandated by the relevant standards.
Hurd headers and Sun RPC headers and interface definitions are exempt
from these checks. The former is because minimizing their
cross-inclusions would require making Hurd-specific design decisions,
which I feel is best left to the Hurd maintainers. The latter is
because they are obsolete in glibc; cleanups should be done under the
auspices of TIRPC.
* scripts/check-obsolete-constructs.py
(UNIVERSAL_ALLOWED_INCLUDES, HEADER_ALLOWED_INCLUDES)
(SYSDEP_ALLOWED_INCLUDES, NESTED_INCLUDES_EXEMPT_RE)
(get_allowed_nested, NestedIncludeCheckerWhitelistOnly)
(NestedIncludeChecker): New.
(HeaderChecker): Instantiate and run a NestedIncludeChecker
for each header.
commit 69411ab1f82999d0f99ea02312b1ed40ff1005de
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 21:18:56 2019 -0500
DonâÂÂt conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t.
The declarations of ldiv_t, lldiv_t, and __gwchar_t are all wrapped in
__foo_t_defined conditionals, despite there being only one header in
glibc that declares them. I checked codesearch.debian.net and only
found one other program that refers to the __foo_t_defined
conditionals: u-boot provides its own definition of ldiv_t if
__ldiv_t_defined is not defined by stdlib.h. I conclude that the
conditionals are not necessary, but the definitions of
__ldiv_t_defined and __lldiv_t_defined should be preserved.
* stdlib/inttypes.h: Unconditionally define __gwchar_t.
DonâÂÂt define ____gwchar_t_defined.
* stdlib/stdlib.h: Unconditionally define ldiv_t.
Condition lldiv_t only on __USE_ISOC99.
commit c0a0bc0fc0ea68e9b3710257a4cbe401e2b6917e
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 20:54:02 2019 -0500
Create bits/types headers for most remaining __T_defined macros.
This doesn't exactly fit the theme but as long as I'm tinkering with
sys/types.h it makes sense to go through and create single-declaration
bits/types/ headers for all of the remaining cases where we have
two or more headers declaring a public type.
The remaining uses of the original __T_defined idiom are:
__error_t_defined in files shared with gnulib, which probably has to
remain as is; ____gwchar_t_defined in inttypes.h, which may not be
necessary anymore and should be addressed separately, and
__ldiv_t_defined and __lldiv_t_defined in stdlib.h, ditto.
Our handling of LFS types is a little inconsistent: some headers
declare both off_t and off64_t (for instance) when
_LARGEFILE64_SOURCE, others will only declare off_t regardless of
_LARGEFILE64_SOURCE. I don't know if this was intentional or not.
I am tempted to centralize responsibility for _LARGEFILE64_SOURCE as
well as _FILE_OFFSET_BITS=64 in bits/types/off_t.h (etc) so that any
header that declares off_t will automatically also declare off64_t
when _LARGEFILE64_SOURCE.
sunrpc/rpc/types.h is special, because it is included in files
compiled by the *build* compiler (cross-rpcgen-objs), and therefore it
cannot unconditionally assume bits/types headers are available. What
I did was have it include the appropriate bits/types headers only if
including sys/types.h did not cause __BIT_TYPES_DEFINED__ to be
defined. This will do the right thing when an installed rpc/types.h
is included by application code compiled without __USE_MISC in effect.
During the build, we rely on the fact that we compile all of our own
code with __USE_MISC in effect. This is fragile, but should be
acceptable for code that's no longer built by default anyway.
scripts/check-obsolete-constructs.py ensures that only sys/types.h and
rpc/types.h include the bits/types/ headers that define obsolete types.
* posix/bits/types/blkcnt64_t.h
* posix/bits/types/blkcnt_t.h
* posix/bits/types/blksize_t.h
* posix/bits/types/dev_t.h
* posix/bits/types/fsblkcnt64_t.h
* posix/bits/types/fsblkcnt_t.h
* posix/bits/types/fsfilcnt64_t.h
* posix/bits/types/fsfilcnt_t.h
* posix/bits/types/fsid_t.h
* posix/bits/types/gid_t.h
* posix/bits/types/id_t.h
* posix/bits/types/ino64_t.h
* posix/bits/types/ino_t.h
* posix/bits/types/intptr_t.h
* posix/bits/types/key_t.h
* posix/bits/types/loff_t.h
* posix/bits/types/mode_t.h
* posix/bits/types/nlink_t.h
* posix/bits/types/off64_t.h
* posix/bits/types/off_t.h
* posix/bits/types/pid_t.h
* posix/bits/types/socklen_t.h
* posix/bits/types/ssize_t.h
* posix/bits/types/suseconds_t.h
* posix/bits/types/uid_t.h
* posix/bits/types/useconds_t.h:
New single-declaration headers for standard types canonically
defined by sys/types.h, sys/socket.h, or inttypes.h but also
exposed by other headers under some circumstances. Code moved
from posix/sys/types.h, socket/sys/socket.h, stdlib/inttypes.h
as appropriate.
* posix/bits/types/uint.h
* posix/bits/types/u_int.h
* posix/bits/types/u_intN_t.h
* posix/bits/types/caddr_t.h
* posix/bits/types/daddr_t.h
* posix/bits/types/loff_t.h
* posix/bits/types/register_t.h:
Similarly, but for obsolete BSD-derived types whose canonical
home is sys/types.h. Some of these headers define more than
one type.
* posix/Makefile (headers): Install the above new headers.
Rewrap the list.
* posix/sys/types.h: All definitions of public types now
accomplished using the above new headers. Consolidate
groups of definitions controlled by the same feature
selection macros.
* inet/arpa/inet.h, bits/socket.h
* sysdeps/mach/hurd/bits/socket.h
* sysdeps/unix/sysv/linux/bits/socket.h:
Use bits/types/socklen_t.h.
* dirent/dirent.h: Use bits/types/ino_t.h and bits/types/ino64_t.h.
* grp/grp.h: Use bits/types/gid_t.h.
* io/fcntl.h: Use bits/types/mode_t.h, bits/types/off_t.h,
bits/types/pid_t.h, and bits/types/off64_t.h.
* io/sys/stat.h: Use bits/types/dev_t.h, bits/types/gid_t.h,
bits/types/ino_t.h, bits/types/mode_t.h, bits/types/nlink_t.h,
bits/types/off_t.h, bits/types/uid_t.h, and bits/types/blkcnt_t.h.
* libio/stdio.h: Use bits/types/off_t.h, bits/types/off64_t.h,
and bits/types/ssize_t.h.
* misc/sys/mman.h: Use bits/types/off_t.h and bits/types/mode_t.h.
* misc/sys/select.h: Use bits/types/suseconds_t.h.
* posix/sched.h: Use bits/types/pid_t.h.
* posix/sys/wait.h: Use bits/types/pid_t.h and bits/types/id_t.h.
* posix/unistd.h: Use bits/types/gid_t.h, bits/types/uid_t.h,
bits/types/off_t.h, bits/types/off64_t.h, bits/types/useconds_t.h,
bits/types/intptr_t.h, and bits/types/socklen_t.h.
* pwd/pwd.h: Use bits/types/gid_t.h and bits/types/uid_t.h.
* resource/sys/resource.h: Use bits/types/id_t.h.
* signal/signal.h: Use bits/types/pid_t.h and bits/types/uid_t.h.
* stdlib/monetary.h: Use bits/types/ssize_t.h.
* sysdeps/gnu/utmpx.h: Use bits/types/pid_t.h.
* sysvipc/sys/ipc.h: Use bits/types/uid_t.h, bits/types/gid_t.h,
bits/types/mode_t.h, and bits/types/key_t.h.
* sysvipc/sys/msg.h: Use bits/types/pid_t.h and bits/types/ssize_t.h.
* sysvipc/sys/shm.h: Use bits/types/pid_t.h.
* termios/termios.h: Use bits/types/pid_t.h.
* time/sys/time.h: Use bits/types/suseconds_t.h.
* time/time.h: Use bits/types/pid_t.h.
* sunrpc/rpc/types.h: Consolidate all #includes at the top of
the file. If __BIT_TYPES_DEFINED__ is not defined after
including sys/types.h, also include bits/types/caddr_t.h,
bits/types/daddr_t.h, bits/types/fsid_t.h, and bits/types/u_int.h.
* scripts/check-obsolete-constructs.py (OBSOLETE_TYPE_HDR_RE_): New.
(ObsoleteIndirectDefinitionsAllowed): New; allows inclusion of
bits/types/ headers that define obsolete typedefs, but not
direct definitions of those types.
(ObsoleteNotAllowed, ObsoletePrivateDefinitionsAllowed)
(ObsoletePublicDefinitionsAllowed): Do not allow inclusion of
bits/types/ headers that define obsolete typedefs.
* include/bits/types/blkcnt64_t.h
* include/bits/types/blkcnt_t.h
* include/bits/types/blksize_t.h
* include/bits/types/caddr_t.h
* include/bits/types/daddr_t.h
* include/bits/types/dev_t.h
* include/bits/types/fsblkcnt64_t.h
* include/bits/types/fsblkcnt_t.h
* include/bits/types/fsfilcnt64_t.h
* include/bits/types/fsfilcnt_t.h
* include/bits/types/fsid_t.h
* include/bits/types/gid_t.h
* include/bits/types/id_t.h
* include/bits/types/ino64_t.h
* include/bits/types/ino_t.h
* include/bits/types/intptr_t.h
* include/bits/types/key_t.h
* include/bits/types/loff_t.h
* include/bits/types/mode_t.h
* include/bits/types/nlink_t.h
* include/bits/types/off64_t.h
* include/bits/types/off_t.h
* include/bits/types/pid_t.h
* include/bits/types/register_t.h
* include/bits/types/socklen_t.h
* include/bits/types/ssize_t.h
* include/bits/types/suseconds_t.h
* include/bits/types/u_char.h
* include/bits/types/u_intN_t.h
* include/bits/types/uchar.h
* include/bits/types/uid_t.h
* include/bits/types/useconds_t.h: New wrappers.
commit 260171192a1acc7c23e31259e10aaab892649a74
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 18:01:48 2019 -0500
Clean up bits/types.h.
This makes four linked changes to bits/types.h. First, we use
__(u)?int(16|32|64)_t to define __[SU](16|32|64)_TYPE. In addition
to reducing the amount of ifdeffage, this means __STD_TYPE is no longer
necessary, since gcc -std=c89 will complain about âÂÂtypedef long long foo_tâÂÂ
but not âÂÂtypedef __int64_t foo_tâÂÂ, even if the underlying type
of __int64_t is long long.
Second, we eliminate __UQUAD_TYPE and __SQUAD_TYPE from the set of
macros bits/typesizes.h should use to define __FOO_T_TYPE macros,
since they are always the same as __U64_TYPE and __S64_TYPE
respectively.
Third, we remove __u_char, __u_short, __u_int, __u_long, __u_quad_t,
and __quad_t, we add __uintptr_t, and we define __intmax_t and
__uintmax_t as __int64_t and __uint64_t.
Fourth, we reorganize the list of typedefs into groups by the
standard (if any) that defines them, and sort them alphabetically within
each group.
* posix/bits/types.h: Move #error for __WORDSIZE neither 32 nor 64
to first group of conditionals on __WORDSIZE, and make it more
explicit. Update commentary. Define all __foo_t types with
regular âÂÂtypedefâÂÂ. Reorganize all __foo_t types into the same
groups that sys/types.h uses.
(__u_char, __u_short, __u_int, __u_long, __quad_t, __u_quad_t)
(__UQUAD_TYPE, __SQUAD_TYPE, __STD_TYPE): DonâÂÂt define.
(__S16_TYPE): Define unconditionally as __int16_t.
(__U16_TYPE): Define unconditionally as __uint16_t.
(__S32_TYPE): Define unconditionally as __int32_t.
(__U32_TYPE): Define unconditionally as __uint32_t.
(__S64_TYPE): Define unconditionally as __int64_t.
(__U64_TYPE): Define unconditionally as __uint64_t.
(__intmax_t): Define unconditionally as __int64_t.
(__uintmax_t): Define unconditionally as __uint64_t.
(__uintptr_t): New typedef.
* bits/time64.h
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
Replace all uses of __UQUAD_TYPE with __U64_TYPE, and all
uses of __SQUAD_TYPE with __S64_TYPE.
* posix/sys/types.h, rpc/sys/types.h
(u_char): Define as unsigned char.
(u_short): Define as unsigned short.
(u_int): Define as unsigned int.
(u_long): Define as unsigned long.
(quad_t): Define as __int64_t.
(u_quad_t): Define as __uint64_t.
* stdlib/stdint.h (intptr_t): Define as __intptr_t.
(uintptr_t): Define as __uintptr_t.
* scripts/check-obsolete-constructs.py: Update allowed
definitions for the obsolete types. No longer allow
__STD_TYPE as an alias for typedef.
commit f85c66a2e067ff92f71d8b67ed5ce736d3f5b3b2
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 16:01:38 2019 -0500
Simplify definition of __time64_t.
bits/time64.h always sets __TIME64_T_TYPE to be __time_t when
__TIMESIZE == 64, so we can unconditionally use __TIME64_T_TYPE to
define __time64_t; we donâÂÂt need another conditional in bits/types.h.
Also move the definition of __time64_t next to the definition of
__time_t.
* posix/bits/types.h (__time64_t): Unconditionally define
as __TIME64_T_TYPE. Move definition next to __time_t.
commit 3b8d6607e30754f2b0679acc782f9c67d85902f5
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Mar 9 11:59:02 2019 -0500
Add caddr_t, daddr_t, and loff_t to the set of obsolete typedefs.
caddr_t is a BSD-derived alias for âÂÂchar *âÂÂ, obsoleted by the
introduction of âÂÂvoid *â in C89 (!) daddr_t is a âÂÂdisk address,âÂÂ
but itâÂÂs always defined as âÂÂintâÂÂ, making it too small for modern
disks and tapes. loff_t is another name for off64_t, from early
drafts of LFS. All three are already only exposed by sys/types.h
under __USE_MISC.
This patch adds them to the set of types that shall not be used in
installed headers (enforced by check-obsolete-constructs.py) and
expunges all remaining uses, internally as well as in installed
headers. Since __DADDR_T_TYPE is always defined as __S32_TYPE, and
daddr_t is obsolete so thereâÂÂs no need to worry about future
variation, the patch also removes __DADDR_T_TYPE from the set of
macros that bits/typesizes.h is required to define. Instead
bits/types.h always defines __daddr_t as __S32_TYPE, and the
definition is moved to a more logical location within the file, next
to __caddr_t.
ItâÂÂs always safe to change (__)loff_t to the matching (__)off64_t;
in a few internal files, I removed an unnecessary __ prefix.
daddr_t is only used for struct ustat, which is obsoleted by struct
statvfs and we already donâÂÂt declare it in public headers, and for an
ioctl parameter block in sys/mtio.h (which may or may not be obsolete,
I canâÂÂt tell). In sys/mtio.h I replaced both uses with âÂÂintâ to match
the use of bare âÂÂlong intâ for most of the other fields of that
structure. In misc/ustat.c, the definition of struct ustat is not
actually necessary so I removed it entirely. In
sysdeps/unix/sysv/linux/ustat.c a definition is necessary but only
because INLINE_SYSCALL_CALL doesnâÂÂt work (on at least x86) when an
argument is a pointer to an incomplete type, so I substituted a dummy
definition.
Most of the internal uses of caddr_t are in the sunrpc and nis
directories, and since most of that code is obsolete, I mechanically
replaced them with char * rather than consider whether void * might
make more sense. Because âÂÂconst caddr_t fooâ is semantically
different from âÂÂconst char *fooâ (in the first case âÂÂfooâ itself is
const but the memory pointed to isnâÂÂt, in the second case the memory
pointed to is const but âÂÂfooâ isnâÂÂt) this change exposed some
const-correctness errors in sunrpc, which I fixed minimally. Outside
of sunrpc and nis, I put a little more thought into whether uses of
caddr_t should be void * instead.
* scripts/check-obsolete-constructs.py: Add caddr_t, daddr_t,
and loff_t to the set of obsolete types forbidden in public
headers.
* posix/bits/types.h: Unconditionally define __daddr_t as
__S32_TYPE. Move definition of __daddr_t next to definition
of __caddr_t.
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
DonâÂÂt define __DADDR_T_TYPE.
* sysdeps/gnu/sys/mtio.h (struct mtget): Change all uses of
__daddr_t to int.
* misc/ustat.c: Remove definition of struct ustat; only
forward-declare it.
* sysdeps/unix/sysv/linux/ustat.c: Replace fields of
struct ustat with a size-preserving dummy field.
* hurd/Makefile (migheaderpipe): Rewrite loff_t as __off64_t.
* hurd/fd-read.c (_hurd_fd_read): Use off64_t instead of loff_t.
* hurd/fd-write.c (hurd_fd_write): Use off64_t instead of loff_t.
* hurd/hurd/fd.h (_hurd_fd_read, _hurd_fd_write): Declare
using __off64_t instead of __loff_t.
* support/xunistd.h (xcopy_file_range): Declare using off64_t
instead of loff_t.
* sysdeps/unix/sysv/linux/generic/wordsize-32/overflow.h
* sysdeps/unix/sysv/linux/lseek.c
* sysdeps/unix/sysv/linux/lseek64.c
* sysdeps/unix/sysv/linux/splice.c
Throughout, use off64_t instead of loff_t.
* sysdeps/unix/sysv/linux/sys/quota.h
(dqoff): Use __off64_t instead of __loff_t.
(quotactl): Declare using char * instead of caddr_t.
* sysdeps/unix/sysv/linux/test-errno-linux.c
(do_test): Cast to char * instead of caddr_t when calling quotactl.
* elf/dl-map-segments.h (_dl_map_segments): Cast to void *
instead of caddr_t when calling __mprotect and __mmap.
* elf/dl-minimal.c (malloc): Declare page as char *, not caddr_t.
* elf/dl-reloc.c (_dl_relocate_object): Declare textrels.start
as char *, not caddr_t. Cast to char *, not caddr_t, in
pointer arithmetic.
* intl/loadmsgcat.c: Remove two unnecessary casts to caddr_t
when calling munmap. Change a third cast to target void *
instead and add a comment explaining why this one is necessary.
* locale/loadlocale.c (_nl_load_locale): Use NULL instead of
`(caddr_t)0`, and remove an unnecessary cast to caddr_t when
calling munmap.
(_nl_unload_locale): Change casts when calling free and munmap
to target char *, and add a comment explaining why they are
necessary.
* sysdeps/gnu/net/if.h
(struct ifreq): Declare ifru_data as char *, not __caddr_t.
(struct ifconf): Declare ifcu_buf as char *, not __caddr_t.
* nis/nis_add.c
* nis/nis_call.c
* nis/nis_callback.c
* nis/nis_checkpoint.c
* nis/nis_findserv.c
* nis/nis_intern.h
* nis/nis_lookup.c
* nis/nis_mkdir.c
* nis/nis_modify.c
* nis/nis_ping.c
* nis/nis_remove.c
* nis/nis_rmdir.c
* nis/nis_server.c
* nis/nis_table.c
* nis/nis_util.c
* nis/nss_nisplus/nisplus-grp.c
* nis/nss_nisplus/nisplus-pwd.c
* nis/rpcsvc/nis_callback.h
* nis/rpcsvc/yp.h
* nis/ypclnt.c
* sunrpc/auth_des.c
* sunrpc/auth_unix.c
* sunrpc/authdes_prot.c
* sunrpc/authuxprot.c
* sunrpc/clnt_raw.c
* sunrpc/clnt_tcp.c
* sunrpc/clnt_udp.c
* sunrpc/clnt_unix.c
* sunrpc/key_call.c
* sunrpc/pm_getmaps.c
* sunrpc/pm_getport.c
* sunrpc/pmap_clnt.c
* sunrpc/pmap_prot2.c
* sunrpc/pmap_rmt.c
* sunrpc/proto.h
* sunrpc/rpc/auth.h
* sunrpc/rpc/clnt.h
* sunrpc/rpc/pmap_clnt.h
* sunrpc/rpc/pmap_rmt.h
* sunrpc/rpc/rpc_msg.h
* sunrpc/rpc/svc.h
* sunrpc/rpc/xdr.h
* sunrpc/rpc_clntout.c
* sunrpc/rpc_cmsg.c
* sunrpc/rpc_hout.c
* sunrpc/rpc_prot.c
* sunrpc/rpc_sample.c
* sunrpc/rpc_svcout.c
* sunrpc/svc.c
* sunrpc/svc_authux.c
* sunrpc/svc_raw.c
* sunrpc/svc_tcp.c
* sunrpc/svc_udp.c
* sunrpc/svc_unix.c
* sunrpc/xdr.c
* sunrpc/xdr_array.c
* sunrpc/xdr_mem.c
* sunrpc/xdr_rec.c
* sunrpc/xdr_ref.c
* sunrpc/xdr_sizeof.c
* sunrpc/xdr_stdio.c:
Mechanically replace all uses of caddr_t with char *.
* sunrpc/xdr_mem.c (xdrmem_create): Cast away const when
setting xdrs->x_private and xdrs->x_base.
* sunrpc/xdr_stdio.c (xdrstdio_getbytes): Correct argument
types in definition to match prototype.
commit ad4d473af1f3e62421488c6dc55b4a48376450b9
Author: Zack Weinberg <zackw@panix.com>
Date: Mon Feb 18 21:00:34 2019 -0500
sys/types.h: DonâÂÂt define u_intN_t or register_t unless __USE_MISC.
sys/types.h unconditionally defines u_int8_t, u_int16_t, u_int32_t,
u_int64_t, and register_t. These are not part of any standard. The
u_intXX_t types are superseded by C99âÂÂs uintXX_t types (defined in
stdint.h). IâÂÂm not aware of a standardized exact equivalent of
register_t, but also IâÂÂve never seen anyone use it for anything.
I could be persuaded to leave that one alone.
sys/types.h also unconditionally defines int8_t, int16_t, int32_t, and
int64_t, which are the same as the C99 exact-width signed types in
stdint.h. POSIX doesnâÂÂt require these to appear in sys/types.h, so in
principle they ought to be brought under __USE_MISC also. But, when I
tried that it broke about two dozen files just in our own source tree,
and POSIX doesnâÂÂt *forbid* sys/types.h to define these types, so I
think we should leave them alone.
* posix/sys/types.h (u_int8_t, u_int16_t, u_int32_t, u_int64_t)
(register_t): Move under #ifdef __USE_MISC.
Consolidate adjacent #ifdef __USE_MISC blocks.
* scripts/check_obsolete_constructs.py: Add register_t to the
set of obsolete typedefs that our headers should not use
(but sys/types.h may still define).
commit 86ec3f7bccd663ea5ffe75afd0bb022edf7e5ad0
Author: Zack Weinberg <zackw@panix.com>
Date: Tue Feb 19 08:45:22 2019 -0500
Define register_t using bits/typesizes.h macros.
Currently register_t is, unlike all other types in sys/types.h,
defined using a GCC extension (__attribute__((mode(word)))), falling
back to âÂÂintâ if the extension is unavailable. This is a potential
ABI compatibility hazard for people using non-GNU compilers with
glibc. ItâÂÂs also unnecessary; the bits/typesizes.h mechanism can
handle all of the existing variation in the definition. In most
cases, defining __REGISTER_T_TYPE as __SWORD_TYPE is sufficient.
Special handling is necessary for MIPS n32 and x86-64 x32, where
__SWORD_TYPE is âÂÂintâ and the appropriate type for register_t is
âÂÂlong longâÂÂ. Unfortunately, this means we need to create a new
bits/typesizes.h variant for linux/mips. This variant is based
on the top-level bits/typesizes.h, not linux/generic/bits/typesizes.h,
to match the existing MIPS ABIs.
Tested using build-many-glibcs. The c++-types test confirms that the
physical type of register_t does not change on any supported platform.
* posix/sys/types.h: Typedef register_t as __register_t.
* posix/bits/types.h: Typedef __register_t using __REGISTER_T_TYPE.
* bits/typesizes.h
* sysdeps/mach/hurd/bits/typesizes.h
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h:
Define __REGISTER_T_TYPE as __SWORD_TYPE.
* sysdeps/unix/sysv/linux/mips/bits/typesizes.h:
New file (copied from bits/typesizes.h).
Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and n64 ABIs.
Define __REGISTER_T_TYPE as __SQUAD_TYPE for n32.
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h:
Define __REGISTER_T_TYPE as __SWORD_TYPE for o32 and 64-bit ABIs.
Define __REGISTER_T_TYPE as __SQUAD_TYPE for x32.
commit 11945dbb61c386b1670d38c86d7e3a6da9d2fa11
Author: Zack Weinberg <zackw@panix.com>
Date: Sat Feb 23 19:08:54 2019 -0500
Move most headers installed by top-level Makefile to misc/.
The Makefile glue to run tests on installed headers is currently
duplicated between the top-level Makefile and Rules, because the
top-level Makefile doesn't read Rules but does install some headers.
This patch moves most of the headers installed by the top-level Makefile
to misc/ (chosen arbitrarily; I'm open to putting them somewhere else
if reviewers feel it would be better) and removes the duplicated logic
from the top-level Makefile. I believe this also means that none of
the headers in include/ are installed headers anymore.
gnu/lib-names*.h are still generated by code in Makerules and installed
by the top-level Makefile. I tried to move them to misc/ as well, but
that broke the generation process in a manner that didn't make any sense
so I gave up. The tests performed on installed headers are not
especially useful for gnu/lib-names*.h so I think we can live with this
for now.
* include/bits/xopen_lim.h
* include/features.h
* include/gnu-versions.h
* include/gnu/libc-version.h
* include/limits.h
* include/stdc-predef.h
* include/values.h:
Move to misc/ and replace with a trivial wrapper.
* Makefile (headers): Remove all headers moved to misc/.
Don't set a vpath for %.h.
(check-installed-headers-c.out, check-installed-headers-cxx.out)
(check-wrapper-headers.out): Remove rules.
* misc/Makefile (headers): Add all of the above headers and
sort the list.
* sysdeps/mach/hurd/bits/errno.h: Regenerate.
commit cb755eede7abad9515d2194313ae3f9e1011791d
Author: Zack Weinberg <zackw@panix.com>
Date: Wed May 22 15:09:32 2019 -0400
Add ChangeLog entry for previous commit.
commit a053e878494080f7070cf92890e546057236c9c9
Author: Zack Weinberg <zackw@panix.com>
Date: Thu May 16 13:34:27 2019 -0400
Remove support for PowerPC SPE extension (powerpc*-*-*gnuspe*).
GCC 9 dropped support for the SPE extensions to PowerPC, which means
powerpc*-*-*gnuspe* configurations are no longer buildable with that
compiler. This ISA extension was peculiar to the âÂÂe500â line of
embedded PowerPC chips, which, as far as I can tell, are no longer
being manufactured, so I think we should follow suit.
This patch was developed by grepping for âÂÂe500âÂÂ, âÂÂ__SPE__âÂÂ, and
âÂÂ__NO_FPRS__âÂÂ, and may not eliminate every vestige of SPE support.
Most uses of __NO_FPRS__ are left alone, as they are relevant to
normal embedded PowerPC with soft-float.
* sysdeps/powerpc/preconfigure: Error out on powerpc-*-*gnuspe*
host type.
* scripts/build-many-glibcs.py: Remove powerpc-*-linux-gnuspe
and powerpc-*-linux-gnuspe-e500v1 from list of build configurations.
* sysdeps/powerpc/powerpc32/e500: Recursively delete.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/e500: Recursively delete.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/context-e500.h:
Delete.
* sysdeps/powerpc/fpu_control.h: Remove SPE variant.
Issue an #error if used with a compiler in SPE-float mode.
* sysdeps/powerpc/powerpc32/__longjmp_common.S
* sysdeps/powerpc/powerpc32/setjmp_common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/getcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/setcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/swapcontext.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
* sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S:
Remove code to preserve SPE register state.
* sysdeps/unix/sysv/linux/powerpc/elision-lock.c
* sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
Remove __SPE__ ifndefs.
commit 46ae07324b1cd50fbf8f37a076d6babcfca7c510
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date: Tue May 21 15:19:06 2019 +0100
Improve string benchtest timing
Improve string benchtest timing. Many tests run for 0.01s which is way too
short to give accurate results. Other tests take over 40 seconds which is
way too long. Significantly increase the iterations of the short running
tests. Reduce number of alignment variations in the long running memcpy walk
tests so they take less than 5 seconds.
As a result most tests take at least 0.1s and all finish within 5 seconds.
* benchtests/bench-memcpy-random.c (do_one_test): Use medium iterations.
* benchtests/bench-memcpy-walk.c (test_main): Reduce alignment tests.
* benchtests/bench-memmem.c (do_one_test): Use small iterations.
* benchtests/bench-memmove-walk.c (test_main): Reduce alignment tests.
* benchtests/bench-memset-walk.c (test_main): Reduce alignment tests.
* benchtests/bench-strcasestr.c (do_one_test): Use small iterations.
* benchtests/bench-string.h (INNER_LOOP_ITERS): Increase iterations.
(INNER_LOOP_ITERS_MEDIUM): New define.
(INNER_LOOP_ITERS_SMALL): New define.
* benchtests/bench-strpbrk.c (do_one_test): Use medium iterations.
* benchtests/bench-strsep.c (do_one_test): Use small iterations.
* benchtests/bench-strspn.c (do_one_test): Use medium iterations.
* benchtests/bench-strstr.c (do_one_test): Use small iterations.
* benchtests/bench-strtok.c (do_one_test): Use small iterations.
commit 004e52febf30012abeafb696a4f16aedd75aeb83
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue May 21 10:40:31 2019 -0300
sysvipc: Add missing bit of semtimedop s390 consolidation
This patch add the missing SEMTIMEDOP_IPC_ARGS definions on powerpc
and sparc ipc_priv.h.
Checked on powerpc64le-linux-gnu and with a build for sparc64-linux-gnu.
* sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (SEMTIMEDOP_IPC_ARGS):
New define.
* sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
(SEMTIMEDOP_IPC_ARGS): Likewise.
commit c9c15ac3162d10a999bf71418fd710bf5676175e
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue May 21 10:19:46 2019 +0200
wcsmbs: Fix data race in __wcsmbs_clone_conv [BZ #24584]
This also adds an overflow check and documents the synchronization
requirement in <gconv.h>.
commit 7e740ab2e7be7d83b75513aa406e0b10875f7f9c
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue May 21 10:34:21 2019 +0200
libio: Fix gconv-related memory leak [BZ #24583]
struct gconv_fcts for the C locale is statically allocated,
and __gconv_close_transform deallocates the steps object.
Therefore this commit introduces __wcsmbs_close_conv to avoid
freeing the statically allocated steps objects.
commit 09e1b0e3f6facc1af2dbcfef204f0aaa8718772b
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon May 20 21:54:57 2019 +0200
libio: Remove codecvt vtable [BZ #24588]
The codecvt vtable is not a real vtable because it also contains the
conversion state data. Furthermore, wide stream support was added to
GCC 3.0, after a C++ ABI bump, so there is no compatibility
requirement with libstdc++.
This change removes several unmangled function pointers which could
be used with a corrupted FILE object to redirect execution. (libio
vtable verification did not cover the codecvt vtable.)
Reviewed-by: Yann Droneaud <ydroneaud@opteya.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
commit 75c51570c710aa9c6df6b7a1e131392e1408c63f
Author: Florian Weimer <fweimer@redhat.com>
Date: Mon May 20 21:08:40 2019 +0200
support: Expose sbindir as support_sbindir_prefix
commit b62bb3bc683ab1ca5f69631f0b588a406370d5dc
Author: Mike Crowe <mac@mcrowe.com>
Date: Mon May 20 14:56:48 2019 -0300
support: Add missing EOL terminators on timespec
The original implementations of test_timespec_before_impl and
test_timespec_equal_or_after in 519839965197291924895a3988804e325035beee
were missing the backslash required for a newline.
Checked on x86_64-linux-gnu.
* support/timespec.c: Add backslash to correct newline in failure
message.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
commit ff6bec7d47b228f4ab2115676a6b7cde5542fa9d
Author: Mike Crowe <mac@mcrowe.com>
Date: Mon May 20 14:55:33 2019 -0300
support: Correct confusing comment
* support/timespec.h: Correct confusing comment.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
commit 236c18e5683028d41c2721a8b1ec45c56c953d95
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed May 15 10:23:49 2019 -0300
sysvipc: Consolidate semtimedop s390
This patch consolidates the s390-32 semtimedop implementation by defining
a arch-specific SEMTIMEDOP_IPC_ARGS to rearrange the arguments expected
by s390 Linux kABI. The idea is to avoid have multiples semtimedop
implementation changes for Linux v5.1 change to enable wire-up sysvipc
support.
Checked with a s390-linux-gnu and s390x-linux-gnu and checking that
resulting semtimedop objects did not change.
* sysdeps/unix/sysv/linux/ipc_priv.h (SEMTIMEDOP_IPC_ARGS): New
define.
* sysdpes/unix/sysv/linux/s390/ipc_priv.h: New file.
* sysdeps/unix/sysv/linux/s390/semtimedop.c: Remove file.
* sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Use
SEMTIMEDOP_IPC_ARGS for calls with __NR_ipc.
commit dfba907fedcb0e95af735a2d064761559f703ab6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue May 14 15:01:32 2019 -0300
sysvipc: Fix compat msgctl (BZ#24570)
The __IPC64 flags is meant to be used to enable the new sysv struct
format when the architectures supports it (ARCH_WANT_IPC_PARSE_VERSION
config flag on Linux kernel).
This currently issue only affects alpha.
[BZ #24570]
* sysdeps/unix/sysv/linux/msgctl.c (__old_msgctl): Remove __IPC_64
usage.
commit 1388600877a8db404459682e9842cd55975409ba
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon May 20 11:51:58 2019 +0000
Add NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from Linux 5.1 to elf.h.
This patch adds the new NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from
Linux 5.1 to glibc's elf.h.
Tested for x86_64.
* elf/elf.h (NT_ARM_PACA_KEYS): New macro.
(NT_ARM_PACG_KEYS): Likewise.
commit 1f50f2ad854c84ead522bfc7331b46dbe6057d53
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date: Fri May 17 18:16:20 2019 +0100
Small tcache improvements
Change the tcache->counts[] entries to uint16_t - this removes
the limit set by char and allows a larger tcache. Remove a few
redundant asserts.
bench-malloc-thread with 4 threads is ~15% faster on Cortex-A72.
Reviewed-by: DJ Delorie <dj@redhat.com>
* malloc/malloc.c (MAX_TCACHE_COUNT): Increase to UINT16_MAX.
(tcache_put): Remove redundant assert.
(tcache_get): Remove redundant asserts.
(__libc_malloc): Check tcache count is not zero.
* manual/tunables.texi (glibc.malloc.tcache_count): Update maximum.
commit fef7c63cd5a5a3150dc9465687359351afab5010
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri May 17 11:14:52 2019 +0200
manual: Document O_DIRECTORY
commit 5f161b2398fc610ebcc65591155faacfa32a2e03
Author: Joseph Myers <joseph@codesourcery.com>
Date: Thu May 16 20:03:39 2019 +0000
Update kernel-features.h files for Linux 5.1.
Linux 5.1 adds missing syscalls to the syscall table for many Linux
kernel architectures. This patch updates the kernel-features.h
headers accordingly. __ASSUME_DIRECT_SYSVIPC_SYSCALLS is not updated
because of the differences between new and old syscalls described in
<https://sourceware.org/ml/libc-alpha/2019-05/msg00235.html>. The
statfs64 structure used by alpha matches what the new kernel syscalls
use.
Tested with build-many-glibcs.py.
* sysdeps/unix/sysv/linux/alpha/kernel-features.h
(__ASSUME_STATFS64): Only undefine if [__LINUX_KERNEL_VERSION <
0x050100].
* sysdeps/unix/sysv/linux/ia64/kernel-features.h (__ASSUME_STATX):
Likewise.
* sysdeps/unix/sysv/linux/sh/kernel-features.h
(__ASSUME_STATX): Likewise.
More information about the Glibc-cvs
mailing list