<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/glibc.git, branch zack/dont-install-libio-h</title>
<subtitle>sourceware.org: git/glibc.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/'/>
<entry>
<title>Don't install libio.h or _G_config.h.</title>
<updated>2017-08-23T11:52:27+00:00</updated>
<author>
<name>Zack Weinberg</name>
<email>zackw@panix.com</email>
</author>
<published>2017-04-20T15:21:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=6d350b3b179175b52172bd2cdd7de62186b3860d'/>
<id>6d350b3b179175b52172bd2cdd7de62186b3860d</id>
<content type='text'>
This is an experimental patch which removes libio.h (and _G_config.h)
from the set of application-exposed headers.  After this change, the
public stdio.h does not define any symbols whose names begin with _G_
nor _IO_, except that when optimizing, the guts of struct _IO_FILE and
three of the flag constants are visible (see bits/stdio.h and
bits/types/FILE_internals.h).  There is a small amount of code
duplication in bits/stdio.h, of macro bodies from libio.h that are no
longer available.  A number of internal .c files that were manually
doing PLT bypass for flockfile/funlockfile can now rely on
include/stdio.h to do it for them.

It passes the testsuite on x86_64-linux, but it needs a great deal of
additional testing; in particular I'm almost certain I broke the
support for old-format (GLIBC_2.0) struct _IO_FILE, which is
configured out on this target.  Testing this properly would require
someone to get their hands on _really_ old binaries, compiled against
glibc 2.0, possibly statically-linked-but-using-NSS.  Unfortunately,
libc.so cannot be expected to be binary identical.

However, this should be ready to feed into archive rebuilds to find
out what applications break.

Substantial clean-ups to the libio implementation are possible if this
sticks, but I haven't done 'em; this is intended to be minimal.

	* libio/Makefile: Don't install libio.h or _G_config.h.  Do install
	bits/types/FILE_internals.h, bits/types/cookie_io_functions_t.h,
	and bits/types/__fpos_t.h.

	* libio/stdio.h: Don't include libio.h.  Get __gnuc_va_list
	directly from stdarg.h, __fpos_t and __fpos64_t from
	bits/types/__fpos_t.h, and the cookie types from
	bits/types/cookie_io_functions_t.h.  Change all uses of
	_G_va_list, _G_fpos_t, _G_fpos64_t, _IO_FILE,
	_IO_cookie_io_functions_t, and _IO_ssize_t to __gnuc_va_list,
	__fpos_t, __fpos64_t, FILE, cookie_io_functions_t, and __ssize_t
	respectively.
	Do not define getc nor putc as macros.
	Define BUFSIZ as literal 8192.

	* libio/bits/types/FILE_internals.h: New header. Provide complete
	definition of struct _IO_FILE (the complete version) here.
	Duplicate definitions of _IO_EOF_SEEN, _IO_ERR_SEEN, and _IO_USER_LOCK
	here, with value assertions if they are already defined.
	* libio/bits/types/__fpos_t.h: New header. Define __fpos_t and
	__fpos64_t here.
	* libio/bits/types/cookie_io_functions_t.h: New header.  Define
	cookie_read_function_t, cookie_write_function_t,
	cookie_seek_function_t, cookie_close_function_t, and
	cookie_io_functions_t here.

	* libio/libio.h: Include features.h first thing, then error out if
	either _LIBC or __USE_GNU is not defined, or if _ISOMAC is
	defined.  Inline all of _G_config.h except _G_HAVE_MREMAP here.
	Get definitions of __mbstate_t, __fpos_t, __fpos64_t, struct
	_IO_FILE, and the cookie-related types from the relevant
	bits/types headers.  Get definition of NULL from stddef.h.
	Make all #ifdef _LIBC and #if __GNUC__ &gt;= (2,3) blocks
	unconditional.  Remove all #if 0 and #ifdef __cplusplus blocks.
	Change all uses of _G_va_list, _G_fpos_t, and _G_fpos64_t to
	__gnuc_va_list, __fpos_t, __fpos64_t respectively.  Provide
	definitions of _STDIO_USES_IOSTREAM, __HAVE_COLUMN,
	_IO_file_flags, __io_read_fn, __io_write_fn, __io_seek_fn,
	__io_close_fn, _IO_cookie_io_functions_t for the sake of the
	implementation.  When _IO_USE_OLD_IO_FILE is defined, define
	struct _IO_FILE_old.
	* libio/libioP.h: When _IO_USE_OLD_IO_FILE is defined, define
	struct _IO_FILE_old_plus.  Only declare _IO_old_file_init_internal
	when _IO_USE_OLD_IO_FILE is defined, and have it take an
	argument of type struct _IO_FILE_old_plus.
	* libio/oldfileops.c: Change all uses of _IO_FILE to _IO_FILE_old,
	_IO_FILE_plus to _IO_FILE_old_plus, _IO_FILE_complete to _IO_FILE,
	and _IO_FILE_complete_plus to _IO_FILE_plus.  Then adjust types
	to match caller/callee's expectations.
	* libio/oldiofdopen.c, libio/oldiofopen.c, libio/oldiopopen.c
	* libio/oldstdfiles.c: Likewise.
	* sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h:
	Only provide definition or non-definition of _G_HAVE_MREMAP.

	* sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c: Delete file.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Remove iovfscanf.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Define
	__nldbl__IO_vsprintf as alias to __nldbl_vsprintf instead of
	the other way around.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h:
	Change all uses of _G_va_list to __gnuc_va_list.  Remove
	NLDBL_DECL for _IO_vfscanf.
	* sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-scanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c:
	Use __nldbl_vfscanf, not __nldbl__IO_vfscanf.

	* libio/bits/stdio.h: Add multiple-inclusion guard. Include
	bits/types/FILE_internals.h. Declare __uflow and __overflow here.
	Remove redundant __USE_EXTERN_INLINES ifdef.  Change all uses of
	_G_va_list to __gnuc_va_list and _IO_ssize_t to __ssize_t.
	(getchar): Use getc, not _IO_getc.
	(__getc_unlocked, __putc_unlocked): New inlines, duplicating the
	bodies of _IO_getc_unlocked and	_IO_putc_unlocked.
	(fgetc_unlocked, getc_unlocked, getchar_unlocked, fread_unlocked):
	Use __getc_unlocked.
	(fputc_unlocked, putc_unlocked, putchar_unlocked, fwrite_unlocked):
	Use __putc_unlocked.
	(feof_unlocked): Duplicate the body of _IO_feof_unlocked here.
	(ferror_unlocked): Duplicate the body of _IO_ferror_unlocked here.
	* libio/bits/stdio2.h: Change all uses of _G_va_list to __gnuc_va_list.
	(fread_unlocked): Use __getc_unlocked.
	* libio/bits/types/FILE.h, libio/bits/types/__FILE.h: Explain in
	comments why the name _IO_FILE is used.

	* include/stdio.h: Change all uses of _G_va_list to __gnuc_va_list,
	_IO_ssize_t to __size_t, _IO_FILE to FILE, and _IO_fpos_t to __fpos_t.
	When IS_IN (libc), redirect flockfile and funlockfile to
	__flockfile and __funlockfile respectively.
	When _IO_MTSAFE_IO and not _ISOMAC, include stdio-lock.h before
	stdio.h proper.
	* include/stdio_ext.h: Include bits/types/FILE_internals.h for the
	sake of the inline definition of __fsetlocking.
	* include/libio.h: Adjust #ifdef nest to activate multiple-include
	optimization.
	* include/bits/types/FILE_internals.h, include/bits/types/__fpos_t.h
	* include/bits/types/cookie_io_functions_t.h: New trivial wrappers.
	* include/bits/stdio.h:	New wrapper; mark __uflow and __overflow
	as hidden for intra-libc callers.

	* csu/init.c: Include libio.h, not _G_config.h.

	* grp/fgetgrent_r.c, grp/putgrent.c, gshadow/fgetsgent_r.c
	* gshadow/putsgent.c, misc/getpass.c, misc/getttyent.c
	* misc/mntent_r.c, posix/getopt.c, pwd/fgetpwent_r.c
	* shadow/fgetspent_r.c, shadow/putspent.c:
	Don't include libio/iolibio.h.  Don't redefine flockfile or
	funlockfile.  Don't use _IO_flockfile or _IO_funlockfile.

	* libio/__fbufsize.c, libio/__flbf.c, libio/__fpending.c
	* libio/__freadable.c, libio/__freading.c, libio/__fwritable.c
	* libio/__fwriting.c, malloc/malloc.c: Include libio.h.
	* misc/err.c: Include libio.h. Don't redefine flockfile or funlockfile.

	* stdio-common/tstgetln.c: Include sys/types.h. Don't redefine ssize_t.
	* conform/data/stdio.h-data: va_list may be defined as __gnuc_va_list,
	not _G_va_list.
	* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove _G_config.h.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is an experimental patch which removes libio.h (and _G_config.h)
from the set of application-exposed headers.  After this change, the
public stdio.h does not define any symbols whose names begin with _G_
nor _IO_, except that when optimizing, the guts of struct _IO_FILE and
three of the flag constants are visible (see bits/stdio.h and
bits/types/FILE_internals.h).  There is a small amount of code
duplication in bits/stdio.h, of macro bodies from libio.h that are no
longer available.  A number of internal .c files that were manually
doing PLT bypass for flockfile/funlockfile can now rely on
include/stdio.h to do it for them.

It passes the testsuite on x86_64-linux, but it needs a great deal of
additional testing; in particular I'm almost certain I broke the
support for old-format (GLIBC_2.0) struct _IO_FILE, which is
configured out on this target.  Testing this properly would require
someone to get their hands on _really_ old binaries, compiled against
glibc 2.0, possibly statically-linked-but-using-NSS.  Unfortunately,
libc.so cannot be expected to be binary identical.

However, this should be ready to feed into archive rebuilds to find
out what applications break.

Substantial clean-ups to the libio implementation are possible if this
sticks, but I haven't done 'em; this is intended to be minimal.

	* libio/Makefile: Don't install libio.h or _G_config.h.  Do install
	bits/types/FILE_internals.h, bits/types/cookie_io_functions_t.h,
	and bits/types/__fpos_t.h.

	* libio/stdio.h: Don't include libio.h.  Get __gnuc_va_list
	directly from stdarg.h, __fpos_t and __fpos64_t from
	bits/types/__fpos_t.h, and the cookie types from
	bits/types/cookie_io_functions_t.h.  Change all uses of
	_G_va_list, _G_fpos_t, _G_fpos64_t, _IO_FILE,
	_IO_cookie_io_functions_t, and _IO_ssize_t to __gnuc_va_list,
	__fpos_t, __fpos64_t, FILE, cookie_io_functions_t, and __ssize_t
	respectively.
	Do not define getc nor putc as macros.
	Define BUFSIZ as literal 8192.

	* libio/bits/types/FILE_internals.h: New header. Provide complete
	definition of struct _IO_FILE (the complete version) here.
	Duplicate definitions of _IO_EOF_SEEN, _IO_ERR_SEEN, and _IO_USER_LOCK
	here, with value assertions if they are already defined.
	* libio/bits/types/__fpos_t.h: New header. Define __fpos_t and
	__fpos64_t here.
	* libio/bits/types/cookie_io_functions_t.h: New header.  Define
	cookie_read_function_t, cookie_write_function_t,
	cookie_seek_function_t, cookie_close_function_t, and
	cookie_io_functions_t here.

	* libio/libio.h: Include features.h first thing, then error out if
	either _LIBC or __USE_GNU is not defined, or if _ISOMAC is
	defined.  Inline all of _G_config.h except _G_HAVE_MREMAP here.
	Get definitions of __mbstate_t, __fpos_t, __fpos64_t, struct
	_IO_FILE, and the cookie-related types from the relevant
	bits/types headers.  Get definition of NULL from stddef.h.
	Make all #ifdef _LIBC and #if __GNUC__ &gt;= (2,3) blocks
	unconditional.  Remove all #if 0 and #ifdef __cplusplus blocks.
	Change all uses of _G_va_list, _G_fpos_t, and _G_fpos64_t to
	__gnuc_va_list, __fpos_t, __fpos64_t respectively.  Provide
	definitions of _STDIO_USES_IOSTREAM, __HAVE_COLUMN,
	_IO_file_flags, __io_read_fn, __io_write_fn, __io_seek_fn,
	__io_close_fn, _IO_cookie_io_functions_t for the sake of the
	implementation.  When _IO_USE_OLD_IO_FILE is defined, define
	struct _IO_FILE_old.
	* libio/libioP.h: When _IO_USE_OLD_IO_FILE is defined, define
	struct _IO_FILE_old_plus.  Only declare _IO_old_file_init_internal
	when _IO_USE_OLD_IO_FILE is defined, and have it take an
	argument of type struct _IO_FILE_old_plus.
	* libio/oldfileops.c: Change all uses of _IO_FILE to _IO_FILE_old,
	_IO_FILE_plus to _IO_FILE_old_plus, _IO_FILE_complete to _IO_FILE,
	and _IO_FILE_complete_plus to _IO_FILE_plus.  Then adjust types
	to match caller/callee's expectations.
	* libio/oldiofdopen.c, libio/oldiofopen.c, libio/oldiopopen.c
	* libio/oldstdfiles.c: Likewise.
	* sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h:
	Only provide definition or non-definition of _G_HAVE_MREMAP.

	* sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c: Delete file.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Remove iovfscanf.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Define
	__nldbl__IO_vsprintf as alias to __nldbl_vsprintf instead of
	the other way around.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h:
	Change all uses of _G_va_list to __gnuc_va_list.  Remove
	NLDBL_DECL for _IO_vfscanf.
	* sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-scanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c
	* sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c:
	Use __nldbl_vfscanf, not __nldbl__IO_vfscanf.

	* libio/bits/stdio.h: Add multiple-inclusion guard. Include
	bits/types/FILE_internals.h. Declare __uflow and __overflow here.
	Remove redundant __USE_EXTERN_INLINES ifdef.  Change all uses of
	_G_va_list to __gnuc_va_list and _IO_ssize_t to __ssize_t.
	(getchar): Use getc, not _IO_getc.
	(__getc_unlocked, __putc_unlocked): New inlines, duplicating the
	bodies of _IO_getc_unlocked and	_IO_putc_unlocked.
	(fgetc_unlocked, getc_unlocked, getchar_unlocked, fread_unlocked):
	Use __getc_unlocked.
	(fputc_unlocked, putc_unlocked, putchar_unlocked, fwrite_unlocked):
	Use __putc_unlocked.
	(feof_unlocked): Duplicate the body of _IO_feof_unlocked here.
	(ferror_unlocked): Duplicate the body of _IO_ferror_unlocked here.
	* libio/bits/stdio2.h: Change all uses of _G_va_list to __gnuc_va_list.
	(fread_unlocked): Use __getc_unlocked.
	* libio/bits/types/FILE.h, libio/bits/types/__FILE.h: Explain in
	comments why the name _IO_FILE is used.

	* include/stdio.h: Change all uses of _G_va_list to __gnuc_va_list,
	_IO_ssize_t to __size_t, _IO_FILE to FILE, and _IO_fpos_t to __fpos_t.
	When IS_IN (libc), redirect flockfile and funlockfile to
	__flockfile and __funlockfile respectively.
	When _IO_MTSAFE_IO and not _ISOMAC, include stdio-lock.h before
	stdio.h proper.
	* include/stdio_ext.h: Include bits/types/FILE_internals.h for the
	sake of the inline definition of __fsetlocking.
	* include/libio.h: Adjust #ifdef nest to activate multiple-include
	optimization.
	* include/bits/types/FILE_internals.h, include/bits/types/__fpos_t.h
	* include/bits/types/cookie_io_functions_t.h: New trivial wrappers.
	* include/bits/stdio.h:	New wrapper; mark __uflow and __overflow
	as hidden for intra-libc callers.

	* csu/init.c: Include libio.h, not _G_config.h.

	* grp/fgetgrent_r.c, grp/putgrent.c, gshadow/fgetsgent_r.c
	* gshadow/putsgent.c, misc/getpass.c, misc/getttyent.c
	* misc/mntent_r.c, posix/getopt.c, pwd/fgetpwent_r.c
	* shadow/fgetspent_r.c, shadow/putspent.c:
	Don't include libio/iolibio.h.  Don't redefine flockfile or
	funlockfile.  Don't use _IO_flockfile or _IO_funlockfile.

	* libio/__fbufsize.c, libio/__flbf.c, libio/__fpending.c
	* libio/__freadable.c, libio/__freading.c, libio/__fwritable.c
	* libio/__fwriting.c, malloc/malloc.c: Include libio.h.
	* misc/err.c: Include libio.h. Don't redefine flockfile or funlockfile.

	* stdio-common/tstgetln.c: Include sys/types.h. Don't redefine ssize_t.
	* conform/data/stdio.h-data: va_list may be defined as __gnuc_va_list,
	not _G_va_list.
	* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove _G_config.h.
</pre>
</div>
</content>
</entry>
<entry>
<title>aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistent</title>
<updated>2017-08-22T23:22:05+00:00</updated>
<author>
<name>Steve Ellcey</name>
<email>sellcey@caviumnetworks.com</email>
</author>
<published>2017-08-22T23:22:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=5a706f649de3952271930a8340db4ca8aa50f485'/>
<id>5a706f649de3952271930a8340db4ca8aa50f485</id>
<content type='text'>
	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic):
	Use PTR_REG macro in cmp instruction.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	* sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic):
	Use PTR_REG macro in cmp instruction.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix remaining return type of ifunc resolver declaration</title>
<updated>2017-08-22T22:08:27+00:00</updated>
<author>
<name>Gabriel F. T. Gomes</name>
<email>gftg@linux.vnet.ibm.com</email>
</author>
<published>2017-08-22T17:01:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=b513da7e80febbbfb8e58282075018652b6f7273'/>
<id>b513da7e80febbbfb8e58282075018652b6f7273</id>
<content type='text'>
Since Martin Sebor's commit

commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2
Author: Martin Sebor &lt;msebor@redhat.com&gt;
Date:   Tue Aug 22 09:35:23 2017 -0600

    Declare ifunc resolver to return a pointer to the same type as the target
    function to help GCC detect incompatibilities between the two when it's
    enhanced to do so.

builds for powerpc64le fail in the declaration of some ifunc resolvers,
because the ifunc is declared with unmatching return types.  One of the
declarations comes from the __ifunc_resolver macro, which was patched by
the aforementioned commit:

    /* Helper / base  macros for indirect function symbols.  */
    #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
      classifier inhibit_stack_protector                                   \
      __typeof (type_name) *name##_ifunc (arg)                             \

whereas the other comes from the unpatched __ifunc macro when
HAVE_GCC_IFUNC is not defined:

    # define __ifunc(type_name, name, expr, arg, init)                     \
      extern __typeof (type_name) name;                                    \
      void *name##_ifunc (arg) __asm__ (#name);                            \

This patch changes the return type of the ifunc resolver in the __ifunc
macro, so that it matches the return type of the target function,
similarly to what the aforementioned commit does.

Tested for powerpc64le and s390x with unpatched GCC.

	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
	Change the return type of the ifunc resolver to match the return
	type of the target function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since Martin Sebor's commit

commit ee4e992ebe5f9712faedeefe8958b67d61eaa0f2
Author: Martin Sebor &lt;msebor@redhat.com&gt;
Date:   Tue Aug 22 09:35:23 2017 -0600

    Declare ifunc resolver to return a pointer to the same type as the target
    function to help GCC detect incompatibilities between the two when it's
    enhanced to do so.

builds for powerpc64le fail in the declaration of some ifunc resolvers,
because the ifunc is declared with unmatching return types.  One of the
declarations comes from the __ifunc_resolver macro, which was patched by
the aforementioned commit:

    /* Helper / base  macros for indirect function symbols.  */
    #define __ifunc_resolver(type_name, name, expr, arg, init, classifier) \
      classifier inhibit_stack_protector                                   \
      __typeof (type_name) *name##_ifunc (arg)                             \

whereas the other comes from the unpatched __ifunc macro when
HAVE_GCC_IFUNC is not defined:

    # define __ifunc(type_name, name, expr, arg, init)                     \
      extern __typeof (type_name) name;                                    \
      void *name##_ifunc (arg) __asm__ (#name);                            \

This patch changes the return type of the ifunc resolver in the __ifunc
macro, so that it matches the return type of the target function,
similarly to what the aforementioned commit does.

Tested for powerpc64le and s390x with unpatched GCC.

	* include/libc-symbols.h: [!defined HAVE_GCC_IFUNC] (__ifunc):
	Change the return type of the ifunc resolver to match the return
	type of the target function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove p{read,write}{v} and fallocate from x86 auto-generation list</title>
<updated>2017-08-22T20:27:18+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2016-07-19T13:23:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=b70b6026a05c18e76f7f0640feb88cd69cbae2de'/>
<id>b70b6026a05c18e76f7f0640feb88cd69cbae2de</id>
<content type='text'>
With {INLINE,INTERNAL}_SYSCALL macros fixed for 64-bits arguments on x32,
we can remove the p{read,write}{v} from auto-generation list.

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (pread64): Remove.
	(preadv64): Likewise.
	(pwrite64(: Likewise.
	(pwritev64): Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With {INLINE,INTERNAL}_SYSCALL macros fixed for 64-bits arguments on x32,
we can remove the p{read,write}{v} from auto-generation list.

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (pread64): Remove.
	(preadv64): Likewise.
	(pwrite64(: Likewise.
	(pwritev64): Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix {INLINE,INTERNAL}_SYSCALL macros for x32</title>
<updated>2017-08-22T20:27:02+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.com</email>
</author>
<published>2016-07-13T09:50:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=78ca091cdd2ca1db94cc5ff27613f75237b8bc8f'/>
<id>78ca091cdd2ca1db94cc5ff27613f75237b8bc8f</id>
<content type='text'>
The problem for x32 is the {INTERNAL,INLINE}_SYSCALL C macros explicit
cast the arguments to 'long int', thus passing as 32 bits arguments
that should be passed to 64 bits.

Previous x32 implementation uses the auto-generated syscalls from
assembly macros (syscalls.list), so the {INTERNAL,INLINE}_SYSCALL
macros are never used with 64 bit argument in x32 (which are
internally broken for this ILP).

To fix it I used a strategy similar to MIPS64n32 (although both
ABI differs for some syscalls on how top pass 64-bits arguments)
where argument types for kernel call are defined using GCC extension
'typeof' with a arithmetic operation.  This allows 64-bits arguments
to be defined while 32-bits argument will still passed as 32-bits.

I also cleanup the {INLINE,INTERNAL}_SYSCALL definition by defining
'inline_syscallX' instead of constructing the argument passing using
macros (it adds some readability) and removed the ununsed
INTERNAL_SYSCALL_NCS_TYPES define (since the patch idea is exactly to
avoid requiric explicit types passing).

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/sysdep.h
	(INTERNAL_SYSCALL_NCS_TYPES): Remove define.
	(LOAD_ARGS_0): Likewise.
	(LOAD_ARGS_1): Likewise.
	(LOAD_ARGS_2): Likewise.
	(LOAD_ARGS_3): Likewise.
	(LOAD_ARGS_4): Likewise.
	(LOAD_ARGS_5): Likewise.
	(LOAD_ARGS_6): Likewise.
	(LOAD_REGS_0): Likewise.
	(LOAD_REGS_1): Likewise.
	(LOAD_REGS_2): Likewise.
	(LOAD_REGS_3): Likewise.
	(LOAD_REGS_4): Likewise.
	(LOAD_REGS_5): Likewise.
	(LOAD_REGS_6): Likewise.
	(ASM_ARGS_0): Likewise.
	(ASM_ARGS_1): Likewise.
	(ASM_ARGS_2): Likewise.
	(ASM_ARGS_3): Likewise.
	(ASM_ARGS_4): Likewise.
	(ASM_ARGS_5): Likewise.
	(ASM_ARGS_6): Likewise.
	(LOAD_ARGS_TYPES_1): Likewise.
	(LOAD_ARGS_TYPES_2): Likewise.
	(LOAD_ARGS_TYPES_3): Likewise.
	(LOAD_ARGS_TYPES_4): Likewise.
	(LOAD_ARGS_TYPES_5): Likewise.
	(LOAD_ARGS_TYPES_6): Likewise.
	(LOAD_REGS_TYPES_1): Likewise.
	(LOAD_REGS_TYPES_2): Likewise.
	(LOAD_REGS_TYPES_3): Likewise.
	(LOAD_REGS_TYPES_4): Likewise.
	(LOAD_REGS_TYPES_5): Likewise.
	(LOAD_REGS_TYPES_6): Likewise.
	(TYPEFY): New define.
	(ARGIFY): Likewise.
	(internal_syscall0): Likewise.
	(internal_syscall1): Likewise.
	(internal_syscall2): Likewise.
	(internal_syscall3): Likewise.
	(internal_syscall4): Likewise.
	(internal_syscall5): Likewise.
	(internal_syscall6): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/times.c
	(INTERNAL_SYSCALL_NCS): Remove define.
	(internal_syscall1): Add define.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem for x32 is the {INTERNAL,INLINE}_SYSCALL C macros explicit
cast the arguments to 'long int', thus passing as 32 bits arguments
that should be passed to 64 bits.

Previous x32 implementation uses the auto-generated syscalls from
assembly macros (syscalls.list), so the {INTERNAL,INLINE}_SYSCALL
macros are never used with 64 bit argument in x32 (which are
internally broken for this ILP).

To fix it I used a strategy similar to MIPS64n32 (although both
ABI differs for some syscalls on how top pass 64-bits arguments)
where argument types for kernel call are defined using GCC extension
'typeof' with a arithmetic operation.  This allows 64-bits arguments
to be defined while 32-bits argument will still passed as 32-bits.

I also cleanup the {INLINE,INTERNAL}_SYSCALL definition by defining
'inline_syscallX' instead of constructing the argument passing using
macros (it adds some readability) and removed the ununsed
INTERNAL_SYSCALL_NCS_TYPES define (since the patch idea is exactly to
avoid requiric explicit types passing).

Tested on x86_64 and x32.

	* sysdeps/unix/sysv/linux/x86_64/sysdep.h
	(INTERNAL_SYSCALL_NCS_TYPES): Remove define.
	(LOAD_ARGS_0): Likewise.
	(LOAD_ARGS_1): Likewise.
	(LOAD_ARGS_2): Likewise.
	(LOAD_ARGS_3): Likewise.
	(LOAD_ARGS_4): Likewise.
	(LOAD_ARGS_5): Likewise.
	(LOAD_ARGS_6): Likewise.
	(LOAD_REGS_0): Likewise.
	(LOAD_REGS_1): Likewise.
	(LOAD_REGS_2): Likewise.
	(LOAD_REGS_3): Likewise.
	(LOAD_REGS_4): Likewise.
	(LOAD_REGS_5): Likewise.
	(LOAD_REGS_6): Likewise.
	(ASM_ARGS_0): Likewise.
	(ASM_ARGS_1): Likewise.
	(ASM_ARGS_2): Likewise.
	(ASM_ARGS_3): Likewise.
	(ASM_ARGS_4): Likewise.
	(ASM_ARGS_5): Likewise.
	(ASM_ARGS_6): Likewise.
	(LOAD_ARGS_TYPES_1): Likewise.
	(LOAD_ARGS_TYPES_2): Likewise.
	(LOAD_ARGS_TYPES_3): Likewise.
	(LOAD_ARGS_TYPES_4): Likewise.
	(LOAD_ARGS_TYPES_5): Likewise.
	(LOAD_ARGS_TYPES_6): Likewise.
	(LOAD_REGS_TYPES_1): Likewise.
	(LOAD_REGS_TYPES_2): Likewise.
	(LOAD_REGS_TYPES_3): Likewise.
	(LOAD_REGS_TYPES_4): Likewise.
	(LOAD_REGS_TYPES_5): Likewise.
	(LOAD_REGS_TYPES_6): Likewise.
	(TYPEFY): New define.
	(ARGIFY): Likewise.
	(internal_syscall0): Likewise.
	(internal_syscall1): Likewise.
	(internal_syscall2): Likewise.
	(internal_syscall3): Likewise.
	(internal_syscall4): Likewise.
	(internal_syscall5): Likewise.
	(internal_syscall6): Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/times.c
	(INTERNAL_SYSCALL_NCS): Remove define.
	(internal_syscall1): Add define.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove duplicate inclusion of header math-svid-compat.h</title>
<updated>2017-08-22T18:24:37+00:00</updated>
<author>
<name>Gabriel F. T. Gomes</name>
<email>gftg@linux.vnet.ibm.com</email>
</author>
<published>2017-08-22T14:14:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=453a493d2b61b1eb3cadee544e6791dab45c167a'/>
<id>453a493d2b61b1eb3cadee544e6791dab45c167a</id>
<content type='text'>
The header math-svid-compat.h has been unintentionally included twice in
the wrappers for the remainder functions.  This patch removes the
duplicate inclusions.

	* math/w_remainder_compat.c: Remove duplicate inclusion of
	math-svid-compat.h.
	* math/w_remainderf_compat.c: Likewise.
	* math/w_remainderl_compat.c: Likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The header math-svid-compat.h has been unintentionally included twice in
the wrappers for the remainder functions.  This patch removes the
duplicate inclusions.

	* math/w_remainder_compat.c: Remove duplicate inclusion of
	math-svid-compat.h.
	* math/w_remainderf_compat.c: Likewise.
	* math/w_remainderl_compat.c: Likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>powerpc: Shrink ULPs for float128</title>
<updated>2017-08-22T18:04:46+00:00</updated>
<author>
<name>Gabriel F. T. Gomes</name>
<email>gftg@linux.vnet.ibm.com</email>
</author>
<published>2017-08-08T21:52:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=f2f048a533bd490013820a8037a3043c0737e216'/>
<id>f2f048a533bd490013820a8037a3043c0737e216</id>
<content type='text'>
During the development of float128 on powerpc64le, the ulps have been
generated since early versions of the patches.  On those versions, the
functions gamma and pow10 were mistakenly thought to be part of the API.
After review, the functions were removed, however the ulps for them were
carried in the ulps file.

This patch removes such entries from the ulps file, as well as it
shrinks the ulps for the cpow and lgamma functions.

Tested for powerpc64le.

	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During the development of float128 on powerpc64le, the ulps have been
generated since early versions of the patches.  On those versions, the
functions gamma and pow10 were mistakenly thought to be part of the API.
After review, the functions were removed, however the ulps for them were
carried in the ulps file.

This patch removes such entries from the ulps file, as well as it
shrinks the ulps for the cpow and lgamma functions.

Tested for powerpc64le.

	* sysdeps/powerpc/fpu/libm-test-ulps: Update.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix tgmath.h handling of complex integers (bug 21684).</title>
<updated>2017-08-22T17:55:42+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2017-08-22T17:55:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=d9bef9c0a41bc3ca4036542cbf2a7d2d0cf60237'/>
<id>d9bef9c0a41bc3ca4036542cbf2a7d2d0cf60237</id>
<content type='text'>
The tgmath.h macros return a real type not a complex type when an
argument is of complex integer type (a GNU extension) and there are no
arguments of complex floating type.  It seems clear that just as real
integers are mapped to double for tgmath.h, so complex integers should
be mapped to _Complex double.

This patch implements such a mapping.  The main complication in fixing
this bug is that the tgmath.h macros expand their arguments a large
number of times, resulting in exponential blowup of the size of the
expansion when calls to tgmath.h macros are used in the arguments of
such macros; it would be unfortunate for fixing a bug with a fairly
obscure extension to make the macros expand their arguments even more
times.  Thus, this patch optimizes the definitions of the relevant
macros.  __tgmath_real_type previously expanded its argument 7 times
and now expands it 3 times.  __tgmath_complex_type, used in place of
__tgmath_real_type only for functions that might return either real or
complex types, not for complex functions that always return real types
or always return complex types, expands its argument 5 times.  So the
sizes of the macro expansions from nested macro calls are
correspondingly reduced (remembering that each tgmath.h macro expands
__tgmath_real_type, or sometimes now __tgmath_complex_type, several
times).

Sometimes the real return type resulted from calling a complex
function and converting the result to a real type; sometimes it
resulted from calling a real function, because the logic for
determining whether arguments were real or complex, based on sizeof,
was confused by integer promotions applying to e.g. short int but not
_Complex short int.  The relevant tests are converted to use a new
macro __expr_is_real, which, by calling __builtin_classify_type rather
than comparing the results of two calls to sizeof, also reduces the
number of times macros expand their arguments.

Although there are reductions in the number of times macros expand
their arguments, I do not consider this to fix bug 21660, since a
proper fix means each macro expanding its arguments only once (via
using new compiler features designed for that purpose).

Tested for x86_64.

	[BZ #21684]
	* math/tgmath.h (__floating_type): Simplify definitions.
	(__real_integer_type): New macro.
	(__complex_integer_type): Likewise.
	(__expr_is_real): Likewise.
	(__tgmath_real_type_sub): Update comment to describe handling of
	complex types.
	(__tgmath_complex_type_sub): New macro.
	(__tgmath_complex_type): Likewise.
	[__HAVE_FLOAT128 &amp;&amp; __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__TGMATH_CF128): Use __expr_is_real.
	(__TGMATH_UNARY_REAL_IMAG): Use __tgmath_complex_type and
	__expr_is_real.
	(__TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_REAL_IMAG_RET_REAL): Use __expr_is_real.
	* math/gen-tgmath-tests.py (Type.create_type): Create complex
	integer types.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tgmath.h macros return a real type not a complex type when an
argument is of complex integer type (a GNU extension) and there are no
arguments of complex floating type.  It seems clear that just as real
integers are mapped to double for tgmath.h, so complex integers should
be mapped to _Complex double.

This patch implements such a mapping.  The main complication in fixing
this bug is that the tgmath.h macros expand their arguments a large
number of times, resulting in exponential blowup of the size of the
expansion when calls to tgmath.h macros are used in the arguments of
such macros; it would be unfortunate for fixing a bug with a fairly
obscure extension to make the macros expand their arguments even more
times.  Thus, this patch optimizes the definitions of the relevant
macros.  __tgmath_real_type previously expanded its argument 7 times
and now expands it 3 times.  __tgmath_complex_type, used in place of
__tgmath_real_type only for functions that might return either real or
complex types, not for complex functions that always return real types
or always return complex types, expands its argument 5 times.  So the
sizes of the macro expansions from nested macro calls are
correspondingly reduced (remembering that each tgmath.h macro expands
__tgmath_real_type, or sometimes now __tgmath_complex_type, several
times).

Sometimes the real return type resulted from calling a complex
function and converting the result to a real type; sometimes it
resulted from calling a real function, because the logic for
determining whether arguments were real or complex, based on sizeof,
was confused by integer promotions applying to e.g. short int but not
_Complex short int.  The relevant tests are converted to use a new
macro __expr_is_real, which, by calling __builtin_classify_type rather
than comparing the results of two calls to sizeof, also reduces the
number of times macros expand their arguments.

Although there are reductions in the number of times macros expand
their arguments, I do not consider this to fix bug 21660, since a
proper fix means each macro expanding its arguments only once (via
using new compiler features designed for that purpose).

Tested for x86_64.

	[BZ #21684]
	* math/tgmath.h (__floating_type): Simplify definitions.
	(__real_integer_type): New macro.
	(__complex_integer_type): Likewise.
	(__expr_is_real): Likewise.
	(__tgmath_real_type_sub): Update comment to describe handling of
	complex types.
	(__tgmath_complex_type_sub): New macro.
	(__tgmath_complex_type): Likewise.
	[__HAVE_FLOAT128 &amp;&amp; __GLIBC_USE (IEC_60559_TYPES_EXT)]
	(__TGMATH_CF128): Use __expr_is_real.
	(__TGMATH_UNARY_REAL_IMAG): Use __tgmath_complex_type and
	__expr_is_real.
	(__TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_REAL_IMAG_RET_REAL): Use __expr_is_real.
	* math/gen-tgmath-tests.py (Type.create_type): Create complex
	integer types.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove non cancellable sigsuspend definition</title>
<updated>2017-08-22T17:25:08+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2017-08-22T13:09:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=988f991b5069f09d793c887618e84a196b100416'/>
<id>988f991b5069f09d793c887618e84a196b100416</id>
<content type='text'>
There is no current internal usage for non cancellable sigsuspend calls.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (sigsuspend_not_cancel): remove
	macro.
	* sysdeps/mach/hurd/sigsuspend.c (sigsuspend_not_cancel): remove
	alias.
	* sysdeps/unix/sysv/linux/not-cancel.h (sigsuspend_not_cancel):
	likewise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no current internal usage for non cancellable sigsuspend calls.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* sysdeps/generic/not-cancel.h (sigsuspend_not_cancel): remove
	macro.
	* sysdeps/mach/hurd/sigsuspend.c (sigsuspend_not_cancel): remove
	alias.
	* sysdeps/unix/sysv/linux/not-cancel.h (sigsuspend_not_cancel):
	likewise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Consolidate non cancellable nanosleep call</title>
<updated>2017-08-22T17:25:08+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2017-07-03T18:54:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/glibc.git/commit/?id=6f33fd046b8e8746e2abc19db2fdfd9c668750e9'/>
<id>6f33fd046b8e8746e2abc19db2fdfd9c668750e9</id>
<content type='text'>
This patch consolidates all the non cancellable nanosleep calls to use
the __nanosleep_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Replace
	nanosleep_not_cancel with __nanosleep_nocancel.
	* sysdeps/generic/not-cancel.h (nanosleep_not_cancel): Remove macro.
	(__nanosleep_nocancel): New macro.
	* sysdeps/unix/sysv/linux/nanosleep.c (__nanosleep_nocancel): New
	function.
	* sysdeps/unix/sysv/linux/not-cancel.h (nanosleep_not_cancel): Remove
	macro.
	(__nanosleep_nocancel): New prototype.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch consolidates all the non cancellable nanosleep calls to use
the __nanosleep_nocancel identifier.  For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.

Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.

	* nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Replace
	nanosleep_not_cancel with __nanosleep_nocancel.
	* sysdeps/generic/not-cancel.h (nanosleep_not_cancel): Remove macro.
	(__nanosleep_nocancel): New macro.
	* sysdeps/unix/sysv/linux/nanosleep.c (__nanosleep_nocancel): New
	function.
	* sysdeps/unix/sysv/linux/not-cancel.h (nanosleep_not_cancel): Remove
	macro.
	(__nanosleep_nocancel): New prototype.
</pre>
</div>
</content>
</entry>
</feed>
