glibc/sysdeps
Martin Sebor 1626a1cfcd Add support for GCC 9 attribute copy.
GCC 9 has gained an enhancement to help detect attribute mismatches
between alias declarations and their targets.  It consists of a new
warning, -Wattribute-alias, an enhancement to an existing warning,
-Wmissing-attributes, and a new attribute called copy.

The purpose of the warnings is to help identify either possible bugs
(an alias declared with more restrictive attributes than its target
promises) or optimization or diagnostic opportunities (an alias target
missing some attributes that it could be declared with that might
benefit analysis and code generation).  The purpose of the new
attribute is to easily apply (almost) the same set of attributes
to one declaration as those already present on another.

As expected (and intended) the enhancement triggers warnings for
many alias declarations in Glibc code.  This change, tested on
x86_64-linux, avoids all instances of the new warnings by making
use of the attribute where appropriate.  To fully benefit from
the enhancement Glibc will need to be compiled with
 -Wattribute-alias=2 and remaining warnings reviewed and dealt with
(there are a couple of thousand but most should be straightforward
to deal with).

ChangeLog:

	* include/libc-symbols.h (__attribute_copy__): Define macro unless
	it's already defined.
	(_strong_alias): Use __attribute_copy__.
	(_weak_alias,  __hidden_ver1,  __hidden_nolink2): Same.
	* misc/sys/cdefs.h (__attribute_copy__): New macro.
	* sysdeps/x86_64/multiarch/memchr.c (memchr): Use __attribute_copy__.
	* sysdeps/x86_64/multiarch/memcmp.c (memcmp): Same.
	* sysdeps/x86_64/multiarch/mempcpy.c (mempcpy): Same.
	* sysdeps/x86_64/multiarch/memset.c (memset): Same.
	* sysdeps/x86_64/multiarch/stpcpy.c (stpcpy): Same.
	* sysdeps/x86_64/multiarch/strcat.c (strcat): Same.
	* sysdeps/x86_64/multiarch/strchr.c (strchr): Same.
	* sysdeps/x86_64/multiarch/strcmp.c (strcmp): Same.
	* sysdeps/x86_64/multiarch/strcpy.c (strcpy): Same.
	* sysdeps/x86_64/multiarch/strcspn.c (strcspn): Same.
	* sysdeps/x86_64/multiarch/strlen.c (strlen): Same.
	* sysdeps/x86_64/multiarch/strncmp.c (strncmp): Same.
	* sysdeps/x86_64/multiarch/strncpy.c (strncpy): Same.
	* sysdeps/x86_64/multiarch/strnlen.c (strnlen): Same.
	* sysdeps/x86_64/multiarch/strpbrk.c (strpbrk): Same.
	* sysdeps/x86_64/multiarch/strrchr.c (strrchr): Same.
	* sysdeps/x86_64/multiarch/strspn.c (strspn): Same.
2018-11-09 17:24:12 -07:00
..
aarch64 Remove extra space at end of line. 2018-10-16 11:02:03 -07:00
alpha Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
arm Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
generic libio: Flush stream at freopen (BZ#21037) 2018-10-02 10:01:56 -03:00
gnu hurd: Fix build 2018-10-31 09:17:05 +01:00
hppa Move SNAN_TESTS_PRESERVE_PAYLOAD out of math-tests.h. 2018-08-01 11:21:16 +00:00
htl hurd: Avoid PLTs for __pthread_get/setspecific 2018-08-09 01:28:55 +02:00
hurd Fix ISO C threads installed header and HURD assumption 2018-07-25 17:27:45 -03:00
i386 x86: Use _rdtsc intrinsic for HP_TIMING_NOW 2018-10-17 15:16:45 -07:00
ia64 i64: fix missing exp2f, log2f and powf symbols in libm.a [BZ #23822] 2018-10-26 14:39:42 +01:00
ieee754 Fix libnldbl_nonshared.a references to internal libm symbols (bug 23735). 2018-10-04 12:16:05 +00:00
init_array sysdeps/init_array: Add PREINIT_FUNCTION to crti.S 2018-01-29 10:22:26 -08:00
m68k Use trunc functions not __trunc functions in glibc libm. 2018-09-20 21:11:10 +00:00
mach posix: New function posix_spawn_file_actions_addchdir_np [BZ #17405] 2018-11-06 16:08:12 +01:00
microblaze Mark _init and _fini as hidden [BZ #23145] 2018-06-08 10:28:52 -07:00
mips MIPS: Use `.set mips2' to emulate LL/SC for the R5900 too 2018-11-01 14:36:48 +00:00
nios2 Move EXCEPTION_TESTS_* out of math-tests.h 2018-08-23 23:41:13 +00:00
nptl Fix race in pthread_mutex_lock while promoting to PTHREAD_MUTEX_ELISION_NP [BZ #23275] 2018-10-17 12:23:04 +02:00
posix posix: New function posix_spawn_file_actions_addchdir_np [BZ #17405] 2018-11-06 16:08:12 +01:00
powerpc Remove unnecessary math_private.h includes. 2018-09-28 21:53:33 +00:00
pthread hurd: fix sigevent's sigev_notify_attributes field type 2018-04-19 21:43:44 +02:00
riscv RISC-V: properly terminate call chain (bug 23125) 2018-10-30 12:07:25 +01:00
s390 S390: Regenerate ULPs. 2018-09-06 14:29:01 +02:00
sh Update SH libm-tests-ulps 2018-07-31 10:33:53 -03:00
sparc Regenerate sparc ulps. 2018-10-18 11:43:56 -07:00
unix Remove __ASSUME_SOCKETCALL. 2018-11-08 20:28:07 +00:00
wordsize-32 Use libc_hidden_* for strtoumax (bug 15105). 2018-02-28 14:16:21 +00:00
wordsize-64 Don't reduce test timeout to less than default 2018-10-17 09:34:13 +02:00
x86 Check multiple NT_GNU_PROPERTY_TYPE_0 notes [BZ #23509] 2018-11-08 10:07:10 -08:00
x86_64 Add support for GCC 9 attribute copy. 2018-11-09 17:24:12 -07:00