diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2013-12-20 09:29:29 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2013-12-20 09:29:29 +0100 |
commit | a65dd355fb80a05215e15ae97649de52aec885e3 (patch) | |
tree | 81701bb0c6b648630f2bf1729a85d7f5eb49e67b /include | |
parent | 296a5732f94abe4d5699dc981e4ccfb950b48cee (diff) | |
parent | b4578bab30f72cddd2cf38abfb39f9c8dc892249 (diff) |
Merge branch 'baseline' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'include')
-rw-r--r-- | include/complex.h | 2 | ||||
-rw-r--r-- | include/features.h | 58 | ||||
-rw-r--r-- | include/fenv.h | 5 | ||||
-rw-r--r-- | include/libc-symbols.h | 40 | ||||
-rw-r--r-- | include/shlib-compat.h | 8 | ||||
-rw-r--r-- | include/stap-probe.h | 15 | ||||
-rw-r--r-- | include/stdc-predef.h | 25 | ||||
-rw-r--r-- | include/string.h | 1 |
8 files changed, 109 insertions, 45 deletions
diff --git a/include/complex.h b/include/complex.h index e173f1f6a3..082e71fb10 100644 --- a/include/complex.h +++ b/include/complex.h @@ -1,11 +1,13 @@ #ifndef _COMPLEX_H # include <math/complex.h> +# ifndef _ISOMAC /* Return the complex inverse hyperbolic sine of finite nonzero Z, with the imaginary part of the result subtracted from pi/2 if ADJ is nonzero. */ extern complex float __kernel_casinhf (complex float z, int adj); extern complex double __kernel_casinh (complex double z, int adj); extern complex long double __kernel_casinhl (complex long double z, int adj); +# endif #endif diff --git a/include/features.h b/include/features.h index c9be10a63e..6acd5c899d 100644 --- a/include/features.h +++ b/include/features.h @@ -41,17 +41,21 @@ _SVID_SOURCE ISO C, POSIX, and SVID things. _ATFILE_SOURCE Additional *at interfaces. _GNU_SOURCE All of the above, plus GNU extensions. + _DEFAULT_SOURCE The default set of features (taking precedence over + __STRICT_ANSI__). _REENTRANT Select additionally reentrant object. _THREAD_SAFE Same as _REENTRANT, often used by other systems. _FORTIFY_SOURCE If set to numeric value > 0 additional security measures are defined, according to level. - The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__. - If none of these are defined, the default is to have _SVID_SOURCE, - _BSD_SOURCE, and _POSIX_SOURCE set to one and _POSIX_C_SOURCE set to - 200112L. If more than one of these are defined, they accumulate. - For example __STRICT_ANSI__, _POSIX_SOURCE and _POSIX_C_SOURCE - together give you ISO C, 1003.1, and 1003.2, but nothing else. + The `-ansi' switch to the GNU C compiler, and standards conformance + options such as `-std=c99', define __STRICT_ANSI__. If none of + these are defined, or if _DEFAULT_SOURCE is defined, the default is + to have _SVID_SOURCE, _BSD_SOURCE, and _POSIX_SOURCE set to one and + _POSIX_C_SOURCE set to 200809L. If more than one of these are + defined, they accumulate. For example __STRICT_ANSI__, + _POSIX_SOURCE and _POSIX_C_SOURCE together give you ISO C, 1003.1, + and 1003.2, but nothing else. These are defined by this file and are used by the header files to decide what to declare or define: @@ -80,7 +84,6 @@ __USE_GNU Define GNU extensions. __USE_REENTRANT Define reentrant/thread-safe *_r functions. __USE_FORTIFY_LEVEL Additional security measures used, according to level. - __FAVOR_BSD Favor 4.3BSD things in cases of conflict. The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are defined by this file unconditionally. `__GNU_LIBRARY__' is provided @@ -120,7 +123,6 @@ #undef __USE_GNU #undef __USE_REENTRANT #undef __USE_FORTIFY_LEVEL -#undef __FAVOR_BSD #undef __KERNEL_STRICT_NAMES /* Suppress kernel-name space pollution unless user expressedly asks @@ -144,13 +146,6 @@ #endif -/* If _BSD_SOURCE was defined by the user, favor BSD over POSIX. */ -#if defined _BSD_SOURCE && \ - !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \ - defined _XOPEN_SOURCE || defined _GNU_SOURCE || defined _SVID_SOURCE) -# define __FAVOR_BSD 1 -#endif - /* If _GNU_SOURCE was defined by the user, turn on all the other features. */ #ifdef _GNU_SOURCE # undef _ISOC95_SOURCE @@ -169,6 +164,8 @@ # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE 1 +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE @@ -177,12 +174,19 @@ # define _ATFILE_SOURCE 1 #endif -/* If nothing (other than _GNU_SOURCE) is defined, - define _BSD_SOURCE and _SVID_SOURCE. */ -#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \ - !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \ - !defined _XOPEN_SOURCE && !defined _BSD_SOURCE && !defined _SVID_SOURCE) +/* If nothing (other than _GNU_SOURCE and _DEFAULT_SOURCE) is defined, + define _DEFAULT_SOURCE, _BSD_SOURCE and _SVID_SOURCE. */ +#if (defined _DEFAULT_SOURCE \ + || (!defined __STRICT_ANSI__ \ + && !defined _ISOC99_SOURCE \ + && !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE \ + && !defined _XOPEN_SOURCE \ + && !defined _BSD_SOURCE && !defined _SVID_SOURCE)) +# undef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +# undef _BSD_SOURCE # define _BSD_SOURCE 1 +# undef _SVID_SOURCE # define _SVID_SOURCE 1 #endif @@ -213,8 +217,18 @@ # define __USE_ISOCXX11 1 #endif -/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2 - (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */ +/* If none of the ANSI/POSIX macros are defined, or if _DEFAULT_SOURCE + is defined, use POSIX.1-2008 (or another version depending on + _XOPEN_SOURCE). */ +#ifdef _DEFAULT_SOURCE +# if !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE +# define __USE_POSIX_IMPLICITLY 1 +# endif +# undef _POSIX_SOURCE +# define _POSIX_SOURCE 1 +# undef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200809L +#endif #if ((!defined __STRICT_ANSI__ || (_XOPEN_SOURCE - 0) >= 500) && \ !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE) # define _POSIX_SOURCE 1 diff --git a/include/fenv.h b/include/fenv.h index 9f90d17090..bd2c99db96 100644 --- a/include/fenv.h +++ b/include/fenv.h @@ -1,8 +1,8 @@ #ifndef _FENV_H #include <math/fenv.h> -#include <stdbool.h> #ifndef _ISOMAC +# include <stdbool.h> /* Now define the internal interfaces. */ extern int __feclearexcept (int __excepts); @@ -16,13 +16,13 @@ extern int __feupdateenv (const fenv_t *__envp); libm_hidden_proto (feraiseexcept) libm_hidden_proto (fegetenv) +libm_hidden_proto (fegetround) libm_hidden_proto (fesetenv) libm_hidden_proto (fesetround) libm_hidden_proto (feholdexcept) libm_hidden_proto (feupdateenv) libm_hidden_proto (fetestexcept) libm_hidden_proto (feclearexcept) -#endif /* Rounding mode context. This allows functions to set/restore rounding mode only when the desired rounding mode is different from the current rounding @@ -32,5 +32,6 @@ struct rm_ctx fenv_t env; bool updated_status; }; +#endif #endif diff --git a/include/libc-symbols.h b/include/libc-symbols.h index a3b6274bad..e7c778e394 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -322,7 +322,7 @@ for linking") past the last element in SET. */ #define symbol_set_end_p(set, ptr) ((ptr) >= (void *const *) &__stop_##set) -#if DO_VERSIONING +#ifdef SHARED # define symbol_version(real, name, version) \ _symbol_version(real, name, version) # define default_symbol_version(real, name, version) \ @@ -466,14 +466,16 @@ for linking") versioned_symbol (libc, __real_foo, foo, GLIBC_2_1); libc_hidden_ver (__real_foo, foo) */ -#if defined SHARED && defined DO_VERSIONING && !defined NO_HIDDEN +#if defined SHARED && !defined NO_HIDDEN # ifndef __ASSEMBLER__ # define __hidden_proto_hiddenattr(attrs...) \ __attribute__ ((visibility ("hidden"), ##attrs)) # define hidden_proto(name, attrs...) \ - __hidden_proto (name, __GI_##name, ##attrs) -# define __hidden_proto(name, internal, attrs...) \ - extern __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ + __hidden_proto (name, , __GI_##name, ##attrs) +# define hidden_tls_proto(name, attrs...) \ + __hidden_proto (name, __thread, __GI_##name, ##attrs) +# define __hidden_proto(name, thread, internal, attrs...) \ + extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ __hidden_proto_hiddenattr (attrs); # define __hidden_asmname(name) \ __hidden_asmname1 (__USER_LABEL_PREFIX__, name) @@ -524,6 +526,7 @@ for linking") #else # ifndef __ASSEMBLER__ # define hidden_proto(name, attrs...) +# define hidden_tls_proto(name, attrs...) # else # define HIDDEN_JUMPTARGET(name) JUMPTARGET(name) # endif /* Not __ASSEMBLER__ */ @@ -538,6 +541,7 @@ for linking") #if !defined NOT_IN_libc # define libc_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libc_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libc_hidden_def(name) hidden_def (name) # define libc_hidden_weak(name) hidden_weak (name) # ifdef LINK_OBSOLETE_RPC @@ -552,6 +556,7 @@ for linking") # define libc_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libc_hidden_proto(name, attrs...) +# define libc_hidden_tls_proto(name, attrs...) # define libc_hidden_def(name) # define libc_hidden_weak(name) # define libc_hidden_ver(local, name) @@ -562,6 +567,7 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_rtld # define rtld_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define rtld_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define rtld_hidden_def(name) hidden_def (name) # define rtld_hidden_weak(name) hidden_weak (name) # define rtld_hidden_ver(local, name) hidden_ver (local, name) @@ -570,6 +576,7 @@ for linking") # define rtld_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define rtld_hidden_proto(name, attrs...) +# define rtld_hidden_tls_proto(name, attrs...) # define rtld_hidden_def(name) # define rtld_hidden_weak(name) # define rtld_hidden_ver(local, name) @@ -580,6 +587,7 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libm # define libm_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libm_hidden_tls_proto(name, attrs...) hidden_tls_proto (name, ##attrs) # define libm_hidden_def(name) hidden_def (name) # define libm_hidden_weak(name) hidden_weak (name) # define libm_hidden_ver(local, name) hidden_ver (local, name) @@ -588,6 +596,7 @@ for linking") # define libm_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libm_hidden_proto(name, attrs...) +# define libm_hidden_tls_proto(name, attrs...) # define libm_hidden_def(name) # define libm_hidden_weak(name) # define libm_hidden_ver(local, name) @@ -598,6 +607,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libresolv # define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libresolv_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libresolv_hidden_def(name) hidden_def (name) # define libresolv_hidden_weak(name) hidden_weak (name) # define libresolv_hidden_ver(local, name) hidden_ver (local, name) @@ -606,6 +617,7 @@ for linking") # define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libresolv_hidden_proto(name, attrs...) +# define libresolv_hidden_tls_proto(name, attrs...) # define libresolv_hidden_def(name) # define libresolv_hidden_weak(name) # define libresolv_hidden_ver(local, name) @@ -616,6 +628,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_librt # define librt_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define librt_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define librt_hidden_def(name) hidden_def (name) # define librt_hidden_weak(name) hidden_weak (name) # define librt_hidden_ver(local, name) hidden_ver (local, name) @@ -624,6 +638,7 @@ for linking") # define librt_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define librt_hidden_proto(name, attrs...) +# define librt_hidden_tls_proto(name, attrs...) # define librt_hidden_def(name) # define librt_hidden_weak(name) # define librt_hidden_ver(local, name) @@ -634,6 +649,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libdl # define libdl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libdl_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libdl_hidden_def(name) hidden_def (name) # define libdl_hidden_weak(name) hidden_weak (name) # define libdl_hidden_ver(local, name) hidden_ver (local, name) @@ -642,6 +659,7 @@ for linking") # define libdl_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libdl_hidden_proto(name, attrs...) +# define libdl_hidden_tls_proto(name, attrs...) # define libdl_hidden_def(name) # define libdl_hidden_weak(name) # define libdl_hidden_ver(local, name) @@ -652,6 +670,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libnss_files # define libnss_files_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libnss_files_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libnss_files_hidden_def(name) hidden_def (name) # define libnss_files_hidden_weak(name) hidden_weak (name) # define libnss_files_hidden_ver(local, name) hidden_ver (local, name) @@ -660,6 +680,7 @@ for linking") # define libnss_files_hidden_data_ver(local, name) hidden_data_ver(local, name) #else # define libnss_files_hidden_proto(name, attrs...) +# define libnss_files_hidden_tls_proto(name, attrs...) # define libnss_files_hidden_def(name) # define libnss_files_hidden_weak(name) # define libnss_files_hidden_ver(local, name) @@ -670,6 +691,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libnsl # define libnsl_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libnsl_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libnsl_hidden_def(name) hidden_def (name) # define libnsl_hidden_weak(name) hidden_weak (name) # define libnsl_hidden_ver(local, name) hidden_ver (local, name) @@ -678,6 +701,7 @@ for linking") # define libnsl_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libnsl_hidden_proto(name, attrs...) +# define libnsl_hidden_tls_proto(name, attrs...) # define libnsl_hidden_def(name) # define libnsl_hidden_weak(name) # define libnsl_hidden_ver(local, name) @@ -688,6 +712,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libnss_nisplus # define libnss_nisplus_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libnss_nisplus_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libnss_nisplus_hidden_def(name) hidden_def (name) # define libnss_nisplus_hidden_weak(name) hidden_weak (name) # define libnss_nisplus_hidden_ver(local, name) hidden_ver (local, name) @@ -696,6 +722,7 @@ for linking") # define libnss_nisplus_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libnss_nisplus_hidden_proto(name, attrs...) +# define libnss_nisplus_hidden_tls_proto(name, attrs...) # define libnss_nisplus_hidden_def(name) # define libnss_nisplus_hidden_weak(name) # define libnss_nisplus_hidden_ver(local, name) @@ -714,6 +741,8 @@ for linking") #if defined NOT_IN_libc && defined IS_IN_libutil # define libutil_hidden_proto(name, attrs...) hidden_proto (name, ##attrs) +# define libutil_hidden_tls_proto(name, attrs...) \ + hidden_tls_proto (name, ##attrs) # define libutil_hidden_def(name) hidden_def (name) # define libutil_hidden_weak(name) hidden_weak (name) # define libutil_hidden_ver(local, name) hidden_ver (local, name) @@ -722,6 +751,7 @@ for linking") # define libutil_hidden_data_ver(local, name) hidden_data_ver (local, name) #else # define libutil_hidden_proto(name, attrs...) +# define libutil_hidden_tls_proto(name, attrs...) # define libutil_hidden_def(name) # define libutil_hidden_weak(name) # define libutil_hidden_ver(local, name) diff --git a/include/shlib-compat.h b/include/shlib-compat.h index 979b5929e3..955c6aeea2 100644 --- a/include/shlib-compat.h +++ b/include/shlib-compat.h @@ -19,13 +19,9 @@ #ifndef _SHLIB_COMPAT_H #define _SHLIB_COMPAT_H 1 -#if defined DO_VERSIONING -/* Since there is just one set of .d files generated, we need to - include this unconditionally to have the dependency noticed properly. */ -#include <abi-versions.h> /* header generated by abi-versions.awk */ -#endif +#ifdef SHARED -#if defined SHARED && defined DO_VERSIONING +# include <abi-versions.h> /* The file abi-versions.h (generated by scripts/abi-versions.awk) defines symbols like `ABI_libm_GLIBC_2_0' for each version set in the source diff --git a/include/stap-probe.h b/include/stap-probe.h index 5f725562cb..e2963506aa 100644 --- a/include/stap-probe.h +++ b/include/stap-probe.h @@ -61,13 +61,14 @@ # ifndef __ASSEMBLER__ /* Evaluate all the arguments and verify that N matches their number. */ -# define LIBC_PROBE(name, n, ...) \ - do { \ - _Bool __libc_probe_args[] = { 0, ## __VA_ARGS__ }; \ - _Bool __libc_probe_verify_n[(sizeof __libc_probe_args / sizeof (_Bool)) \ - == n + 1 ? 1 : -1]; \ - (void) __libc_probe_verify_n; \ - } while (0) +#define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__) + +#define STAP_PROBE0() +#define STAP_PROBE1(a1) +#define STAP_PROBE2(a1, a2) +#define STAP_PROBE3(a1, a2, a3) +#define STAP_PROBE4(a1, a2, a3, a4) + # else # define LIBC_PROBE(name, n, ...) /* Nothing. */ # endif diff --git a/include/stdc-predef.h b/include/stdc-predef.h index b9c9967d9d..f8cb2cb97a 100644 --- a/include/stdc-predef.h +++ b/include/stdc-predef.h @@ -26,9 +26,28 @@ explicitly includes a system header. GCC knows the name of this header in order to preinclude it. */ -/* We do support the IEC 559 math functionality, real and complex. */ -#define __STDC_IEC_559__ 1 -#define __STDC_IEC_559_COMPLEX__ 1 +/* glibc's intent is to support the IEC 559 math functionality, real + and complex. If the GCC (4.9 and later) predefined macros + specifying compiler intent are available, use them to determine + whether the overall intent is to support these features; otherwise, + presume an older compiler has intent to support these features and + define these macros by default. */ + +#ifdef __GCC_IEC_559 +# if __GCC_IEC_559 > 0 +# define __STDC_IEC_559__ 1 +# endif +#else +# define __STDC_IEC_559__ 1 +#endif + +#ifdef __GCC_IEC_559_COMPLEX +# if __GCC_IEC_559_COMPLEX > 0 +# define __STDC_IEC_559_COMPLEX__ 1 +# endif +#else +# define __STDC_IEC_559_COMPLEX__ 1 +#endif /* wchar_t uses ISO/IEC 10646 (2nd ed., published 2011-03-15) / Unicode 6.0. */ diff --git a/include/string.h b/include/string.h index d6d859491e..8323412240 100644 --- a/include/string.h +++ b/include/string.h @@ -90,6 +90,7 @@ extern char *__strsep_g (char **__stringp, const char *__delim); libc_hidden_proto (__strsep_g) libc_hidden_proto (strnlen) libc_hidden_proto (memmem) +libc_hidden_proto (__ffs) libc_hidden_builtin_proto (memchr) libc_hidden_builtin_proto (memcpy) |