summaryrefslogtreecommitdiff
path: root/stdlib
AgeCommit message (Collapse)Author
2015-10-12Add dependencies on needed locales in each subdir tests (bug 18969)Andreas Schwab
2015-10-06Harden tls_dtor_list with pointer mangling [BZ #19018]Florian Weimer
2015-09-23Refactor code forcing underflow exceptions.Joseph Myers
Various floating-point functions have code to force underflow exceptions if a tiny result was computed in a way that might not have resulted in such exceptions even though the result is inexact. This typically uses math_force_eval to ensure that the underflowing expression is evaluated, but sometimes uses volatile. This patch refactors such code to use three new macros math_check_force_underflow, math_check_force_underflow_nonneg and math_check_force_underflow_complex (which in turn use math_force_eval). In the limited number of cases not suited to a simple conversion to these macros, existing uses of volatile are changed to use math_force_eval instead. The converted code does not always execute exactly the same sequence of operations as the original code, but the overall effects should be the same. Tested for x86_64, x86, mips64 and powerpc. * sysdeps/generic/math_private.h (fabs_tg): New macro. (min_of_type): Likewise. (math_check_force_underflow): Likewise. (math_check_force_underflow_nonneg): Likewise. (math_check_force_underflow_complex): Likewise. * math/e_exp2l.c (__ieee754_exp2l): Use math_check_force_underflow_nonneg. * math/k_casinh.c (__kernel_casinh): Likewise. * math/k_casinhf.c (__kernel_casinhf): Likewise. * math/k_casinhl.c (__kernel_casinhl): Likewise. * math/s_catan.c (__catan): Use math_check_force_underflow_complex. * math/s_catanf.c (__catanf): Likewise. * math/s_catanh.c (__catanh): Likewise. * math/s_catanhf.c (__catanhf): Likewise. * math/s_catanhl.c (__catanhl): Likewise. * math/s_catanl.c (__catanl): Likewise. * math/s_ccosh.c (__ccosh): Likewise. * math/s_ccoshf.c (__ccoshf): Likewise. * math/s_ccoshl.c (__ccoshl): Likewise. * math/s_cexp.c (__cexp): Likewise. * math/s_cexpf.c (__cexpf): Likewise. * math/s_cexpl.c (__cexpl): Likewise. * math/s_clog.c (__clog): Use math_check_force_underflow_nonneg. * math/s_clog10.c (__clog10): Likewise. * math/s_clog10f.c (__clog10f): Likewise. * math/s_clog10l.c (__clog10l): Likewise. * math/s_clogf.c (__clogf): Likewise. * math/s_clogl.c (__clogl): Likewise. * math/s_csin.c (__csin): Use math_check_force_underflow_complex. * math/s_csinf.c (__csinf): Likewise. * math/s_csinh.c (__csinh): Likewise. * math/s_csinhf.c (__csinhf): Likewise. * math/s_csinhl.c (__csinhl): Likewise. * math/s_csinl.c (__csinl): Likewise. * math/s_csqrt.c (__csqrt): Use math_check_force_underflow. * math/s_csqrtf.c (__csqrtf): Likewise. * math/s_csqrtl.c (__csqrtl): Likewise. * math/s_ctan.c (__ctan): Use math_check_force_underflow_complex. * math/s_ctanf.c (__ctanf): Likewise. * math/s_ctanh.c (__ctanh): Likewise. * math/s_ctanhf.c (__ctanhf): Likewise. * math/s_ctanhl.c (__ctanhl): Likewise. * math/s_ctanl.c (__ctanl): Likewise. * stdlib/strtod_l.c (round_and_return): Use math_force_eval instead of volatile. * sysdeps/ieee754/dbl-64/e_asin.c (__ieee754_asin): Use math_check_force_underflow. * sysdeps/ieee754/dbl-64/e_atanh.c (__ieee754_atanh): Likewise. * sysdeps/ieee754/dbl-64/e_exp.c (__ieee754_exp): Do not use volatile when forcing underflow. * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/dbl-64/e_gamma_r.c (__ieee754_gamma_r): Likewise. * sysdeps/ieee754/dbl-64/e_j1.c (__ieee754_j1): Use math_check_force_underflow. * sysdeps/ieee754/dbl-64/e_jn.c (__ieee754_jn): Likewise. * sysdeps/ieee754/dbl-64/e_sinh.c (__ieee754_sinh): Likewise. * sysdeps/ieee754/dbl-64/s_asinh.c (__asinh): Likewise. * sysdeps/ieee754/dbl-64/s_atan.c (atan): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/dbl-64/s_erf.c (__erf): Use math_check_force_underflow. * sysdeps/ieee754/dbl-64/s_expm1.c (__expm1): Likewise. * sysdeps/ieee754/dbl-64/s_fma.c (__fma): Use math_force_eval instead of volatile. * sysdeps/ieee754/dbl-64/s_log1p.c (__log1p): Use math_check_force_underflow. * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Likewise. * sysdeps/ieee754/dbl-64/s_tan.c (tan): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/dbl-64/s_tanh.c (__tanh): Use math_check_force_underflow. * sysdeps/ieee754/flt-32/e_asinf.c (__ieee754_asinf): Likewise. * sysdeps/ieee754/flt-32/e_atanhf.c (__ieee754_atanhf): Likewise. * sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/flt-32/e_gammaf_r.c (__ieee754_gammaf_r): Likewise. * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_j1f): Use math_check_force_underflow. * sysdeps/ieee754/flt-32/e_jnf.c (__ieee754_jnf): Likewise. * sysdeps/ieee754/flt-32/e_sinhf.c (__ieee754_sinhf): Likewise. * sysdeps/ieee754/flt-32/k_sinf.c (__kernel_sinf): Likewise. * sysdeps/ieee754/flt-32/k_tanf.c (__kernel_tanf): Likewise. * sysdeps/ieee754/flt-32/s_asinhf.c (__asinhf): Likewise. * sysdeps/ieee754/flt-32/s_atanf.c (__atanf): Likewise. * sysdeps/ieee754/flt-32/s_erff.c (__erff): Likewise. * sysdeps/ieee754/flt-32/s_expm1f.c (__expm1f): Likewise. * sysdeps/ieee754/flt-32/s_log1pf.c (__log1pf): Likewise. * sysdeps/ieee754/flt-32/s_tanhf.c (__tanhf): Likewise. * sysdeps/ieee754/ldbl-128/e_asinl.c (__ieee754_asinl): Likewise. * sysdeps/ieee754/ldbl-128/e_atanhl.c (__ieee754_atanhl): Likewise. * sysdeps/ieee754/ldbl-128/e_expl.c (__ieee754_expl): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/ldbl-128/e_gammal_r.c (__ieee754_gammal_r): Likewise. * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_j1l): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-128/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-128/e_sinhl.c (__ieee754_sinhl): Likewise. * sysdeps/ieee754/ldbl-128/k_sincosl.c (__kernel_sincosl): Likewise. * sysdeps/ieee754/ldbl-128/k_sinl.c (__kernel_sinl): Likewise. * sysdeps/ieee754/ldbl-128/k_tanl.c (__kernel_tanl): Likewise. * sysdeps/ieee754/ldbl-128/s_asinhl.c (__asinhl): Likewise. * sysdeps/ieee754/ldbl-128/s_atanl.c (__atanl): Likewise. * sysdeps/ieee754/ldbl-128/s_erfl.c (__erfl): Likewise. * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Likewise. * sysdeps/ieee754/ldbl-128/s_fmal.c (__fmal): Use math_force_eval instead of volatile. * sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-128/s_tanhl.c (__tanhl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_asinl.c (__ieee754_asinl): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-128ibm/e_atanhl.c (__ieee754_atanhl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c (__ieee754_gammal_r): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/ldbl-128ibm/e_jnl.c (__ieee754_jnl): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-128ibm/e_sinhl.c (__ieee754_sinhl): Likewise. * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl): Likewise. * sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise. * sysdeps/ieee754/ldbl-128ibm/k_tanl.c (__kernel_tanl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_asinhl.c (__asinhl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_atanl.c (__atanl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_erfl.c (__erfl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_tanhl.c (__tanhl): Likewise. * sysdeps/ieee754/ldbl-96/e_asinl.c (__ieee754_asinl): Likewise. * sysdeps/ieee754/ldbl-96/e_atanhl.c (__ieee754_atanhl): Likewise. * sysdeps/ieee754/ldbl-96/e_gammal_r.c (__ieee754_gammal_r): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/ldbl-96/e_j1l.c (__ieee754_j1l): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-96/e_jnl.c (__ieee754_jnl): Likewise. * sysdeps/ieee754/ldbl-96/e_sinhl.c (__ieee754_sinhl): Likewise. * sysdeps/ieee754/ldbl-96/k_sinl.c (__kernel_sinl): Likewise. * sysdeps/ieee754/ldbl-96/k_tanl.c (__kernel_tanl): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/ldbl-96/s_asinhl.c (__asinhl): Use math_check_force_underflow. * sysdeps/ieee754/ldbl-96/s_erfl.c (__erfl): Likewise. * sysdeps/ieee754/ldbl-96/s_fmal.c (__fmal): Use math_force_eval instead of volatile. * sysdeps/ieee754/ldbl-96/s_tanhl.c (__tanhl): Use math_check_force_underflow.
2015-09-23Use math_narrow_eval more consistently.Joseph Myers
Where glibc code needs to avoid excess range and precision in floating-point arithmetic, code variously uses either asms or volatile to force the results of that arithmetic to memory; mostly this is conditional on FLT_EVAL_METHOD, but in the case of lrint / llrint functions some use of volatile is unconditional (and is present unnecessarily in versions for long double). This patch make such code use the recently-added math_narrow_eval macro consistently, removing the unnecessary uses of volatile in long double lrint / llrint implementations completely. Tested for x86_64, x86, mips64 and powerpc. * math/s_nexttowardf.c (__nexttowardf): Use math_narrow_eval. * stdlib/strtod_l.c: Include <math_private.h>. (overflow_value): Use math_narrow_eval. (underflow_value): Likewise. * sysdeps/i386/fpu/s_nexttoward.c (__nexttoward): Likewise. * sysdeps/i386/fpu/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/dbl-64/e_gamma_r.c (gamma_positive): Likewise. (__ieee754_gamma_r): Likewise. * sysdeps/ieee754/dbl-64/gamma_productf.c (__gamma_productf): Likewise. * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Likewise. * sysdeps/ieee754/dbl-64/lgamma_neg.c (__lgamma_neg): Likewise. * sysdeps/ieee754/dbl-64/s_erf.c (__erfc): Likewise. * sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Likewise. * sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise. * sysdeps/ieee754/flt-32/e_gammaf_r.c (gammaf_positive): Likewise. (__ieee754_gammaf_r): Likewise. * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Likewise. * sysdeps/ieee754/flt-32/lgamma_negf.c (__lgamma_negf): Likewise. * sysdeps/ieee754/flt-32/s_erff.c (__erfcf): Likewise. * sysdeps/ieee754/flt-32/s_llrintf.c (__llrintf): Likewise. * sysdeps/ieee754/flt-32/s_lrintf.c (__lrintf): Likewise. * sysdeps/ieee754/ldbl-128/s_llrintl.c (__llrintl): Do not use volatile. * sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Likewise. * sysdeps/ieee754/ldbl-128/s_nexttoward.c (__nexttoward): Use math_narrow_eval. * sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c (__nexttoward): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/ldbl-96/gamma_product.c (__gamma_product): Likewise. * sysdeps/ieee754/ldbl-96/s_llrintl.c (__llrintl): Do not use volatile. * sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise. * sysdeps/ieee754/ldbl-96/s_nexttoward.c (__nexttoward): Use math_narrow_eval. * sysdeps/ieee754/ldbl-96/s_nexttowardf.c (__nexttowardf): Likewise. * sysdeps/ieee754/ldbl-opt/s_nexttowardfd.c (__nldbl_nexttowardf): Likewise.
2015-09-17Use __pthread_setcancelstate in libc.aH.J. Lu
This patch references __pthread_setcancelstate instead of pthread_setcancelstate in libc.a. [BZ #18970] * misc/error.c (error): Replace pthread_setcancelstate with __pthread_setcancelstate. (error_at_line): Likewise. * posix/wordexp.c (parse_comm): Likewise. * stdlib/fmtmsg.c (fmtmsg): Likewise. * nptl/forward.c (pthread_setcancelstate): Renamed to ... (__pthread_setcancelstate): This. (pthread_setcancelstate): Add an alias. * nptl/nptl-init.c (pthread_functions): Replace ptr_pthread_setcancelstate with ptr___pthread_setcancelstate. * sysdeps/nptl/pthread-functions.h (pthread_functions): Likewise. * nptl/pthreadP.h (__pthread_setcancelstate): Mark it with hidden_proto. * nptl/pthread_setcancelstate.c (__pthread_setcancelstate): Mark it with hidden_def. * sysdeps/nptl/libc-lockP.h (__pthread_setcancelstate): New. (pthread_setcancelstate): Renamed to ... (__pthread_setcancelstate): This. * sysdeps/unix/sysv/linux/fatal-prepare.h (FATAL_PREPARE): Use __libc_ptf_call with __pthread_setcancelstate.
2015-09-08Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912).Joseph Myers
It was noted in <https://sourceware.org/ml/libc-alpha/2012-09/msg00305.html> that the bits/*.h naming scheme should only be used for installed headers. This patch renames bits/libc-lock.h to plain libc-lock.h and bits/libc-lockP.h to plain libc-lockP.h to follow that convention. Note that I don't know where libc-lockP.h comes from for Hurd (the Hurd libc-lock.h includes libc-lockP.h, but the only libc-lockP.h in the glibc source tree is for NPTL) - some unmerged patch? - but I updated the #include in the Hurd libc-lock.h anyway. Tested for x86_64 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #14912] * bits/libc-lock.h: Move to ... * sysdeps/generic/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/mach/hurd/bits/libc-lock.h: Move to ... * sysdeps/mach/hurd/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. [_LIBC]: Include <libc-lockP.h> instead of <bits/libc-lockP.h>. * sysdeps/mach/bits/libc-lock.h: Move to ... * sysdeps/mach/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lock.h: Move to ... * sysdeps/nptl/libc-lock.h: ...here. (_BITS_LIBC_LOCK_H): Rename macro to _LIBC_LOCK_H. * sysdeps/nptl/bits/libc-lockP.h: Move to ... * sysdeps/nptl/libc-lockP.h: ...here. (_BITS_LIBC_LOCKP_H): Rename macro to _LIBC_LOCKP_H. * crypt/crypt_util.c: Include <libc-lock.h> instead of <bits/libc-lock.h>. * dirent/scandir-tail.c: Likewise. * dlfcn/dlerror.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-iteratephdr.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-support.c: Likewise. * elf/dl-writev.h: Likewise. * elf/rtld.c: Likewise. * grp/fgetgrent.c: Likewise. * gshadow/fgetsgent.c: Likewise. * gshadow/sgetsgent.c: Likewise. * iconv/gconv_conf.c: Likewise. * iconv/gconv_db.c: Likewise. * iconv/gconv_dl.c: Likewise. * iconv/gconv_int.h: Likewise. * iconv/gconv_trans.c: Likewise. * include/link.h: Likewise. * inet/getnameinfo.c: Likewise. * inet/getnetgrent.c: Likewise. * inet/getnetgrent_r.c: Likewise. * intl/bindtextdom.c: Likewise. * intl/dcigettext.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettextP.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/textdomain.c: Likewise. * libidn/idn-stub.c: Likewise. * libio/libioP.h: Likewise. * locale/duplocale.c: Likewise. * locale/freelocale.c: Likewise. * locale/newlocale.c: Likewise. * locale/setlocale.c: Likewise. * login/getutent_r.c: Likewise. * login/getutid_r.c: Likewise. * login/getutline_r.c: Likewise. * login/utmp-private.h: Likewise. * login/utmpname.c: Likewise. * malloc/mtrace.c: Likewise. * misc/efgcvt.c: Likewise. * misc/error.c: Likewise. * misc/fstab.c: Likewise. * misc/getpass.c: Likewise. * misc/mntent.c: Likewise. * misc/syslog.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nss-default.c: Likewise. * nis/nss_compat/compat-grp.c: Likewise. * nis/nss_compat/compat-initgroups.c: Likewise. * nis/nss_compat/compat-pwd.c: Likewise. * nis/nss_compat/compat-spwd.c: Likewise. * nis/nss_nis/nis-alias.c: Likewise. * nis/nss_nis/nis-ethers.c: Likewise. * nis/nss_nis/nis-grp.c: Likewise. * nis/nss_nis/nis-hosts.c: Likewise. * nis/nss_nis/nis-network.c: Likewise. * nis/nss_nis/nis-proto.c: Likewise. * nis/nss_nis/nis-pwd.c: Likewise. * nis/nss_nis/nis-rpc.c: Likewise. * nis/nss_nis/nis-service.c: Likewise. * nis/nss_nis/nis-spwd.c: Likewise. * nis/nss_nisplus/nisplus-alias.c: Likewise. * nis/nss_nisplus/nisplus-ethers.c: Likewise. * nis/nss_nisplus/nisplus-grp.c: Likewise. * nis/nss_nisplus/nisplus-hosts.c: Likewise. * nis/nss_nisplus/nisplus-initgroups.c: Likewise. * nis/nss_nisplus/nisplus-network.c: Likewise. * nis/nss_nisplus/nisplus-proto.c: Likewise. * nis/nss_nisplus/nisplus-pwd.c: Likewise. * nis/nss_nisplus/nisplus-rpc.c: Likewise. * nis/nss_nisplus/nisplus-service.c: Likewise. * nis/nss_nisplus/nisplus-spwd.c: Likewise. * nis/ypclnt.c: Likewise. * nptl/libc_pthread_init.c: Likewise. * nss/getXXbyYY.c: Likewise. * nss/getXXent.c: Likewise. * nss/getXXent_r.c: Likewise. * nss/nss_db/db-XXX.c: Likewise. * nss/nss_db/db-netgrp.c: Likewise. * nss/nss_db/nss_db.h: Likewise. * nss/nss_files/files-XXX.c: Likewise. * nss/nss_files/files-alias.c: Likewise. * nss/nsswitch.c: Likewise. * posix/regex_internal.h: Likewise. * posix/wordexp.c: Likewise. * pwd/fgetpwent.c: Likewise. * resolv/res_hconf.c: Likewise. * resolv/res_libc.c: Likewise. * shadow/fgetspent.c: Likewise. * shadow/lckpwdf.c: Likewise. * shadow/sgetspent.c: Likewise. * socket/opensock.c: Likewise. * stdio-common/reg-modifier.c: Likewise. * stdio-common/reg-printf.c: Likewise. * stdio-common/reg-type.c: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/abort.c: Likewise. * stdlib/cxa_atexit.c: Likewise. * stdlib/fmtmsg.c: Likewise. * stdlib/random.c: Likewise. * stdlib/setenv.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_none.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/create_xid.c: Likewise. * sunrpc/key_call.c: Likewise. * sunrpc/rpc_thread.c: Likewise. * sysdeps/arm/backtrace.c: Likewise. * sysdeps/generic/ldsodefs.h: Likewise. * sysdeps/generic/stdio-lock.h: Likewise. * sysdeps/generic/unwind-dw2-fde.c: Likewise. * sysdeps/i386/backtrace.c: Likewise. * sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Likewise. * sysdeps/m68k/backtrace.c: Likewise. * sysdeps/mach/hurd/cthreads.c: Likewise. * sysdeps/mach/hurd/dirstream.h: Likewise. * sysdeps/mach/hurd/malloc-machine.h: Likewise. * sysdeps/nptl/malloc-machine.h: Likewise. * sysdeps/nptl/stdio-lock.h: Likewise. * sysdeps/posix/dirstream.h: Likewise. * sysdeps/posix/getaddrinfo.c: Likewise. * sysdeps/posix/system.c: Likewise. * sysdeps/pthread/aio_suspend.c: Likewise. * sysdeps/s390/s390-32/backtrace.c: Likewise. * sysdeps/s390/s390-64/backtrace.c: Likewise. * sysdeps/unix/sysv/linux/check_pf.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutent_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutid_r.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/getutline_r.c: Likewise. * sysdeps/unix/sysv/linux/shm-directory.c: Likewise. * sysdeps/unix/sysv/linux/system.c: Likewise. * sysdeps/x86_64/backtrace.c: Likewise. * time/alt_digit.c: Likewise. * time/era.c: Likewise. * time/tzset.c: Likewise. * wcsmbs/wcsmbsload.c: Likewise. * nptl/tst-initializers1.c (do_test): Refer to <libc-lock.h> instead of <bits/libc-lock.h> in comment.
2015-08-06fix missing ctype.h includeMike Frysinger
This file uses isspace but doesn't include ctype.h leading to: isomac.c: In function 'get_null_defines': isomac.c:305:30: warning: implicit declaration of function 'isspace' [-Wimplicit-function-declaration] for (end = start + 1; !isspace (*end) && *end != '\0'; ++end)
2015-08-06Modify several tests to use test-skeleton.cArjun Shankar
These tests were skipped by the use-test-skeleton conversion done in commit 29955b5d because they did not have an `int main (void)' declaration. Instead their `main' functions were declared with arguments (i.e. argc, argv) even though they didn't use them. Remove these arguments and include the test skeleton in these tests.
2015-07-24Mention dl_load_lock by name in the commentsSiddhesh Poyarekar
Mention dl_load_lock by name instead of just 'load lock' in the comments. This makes it unambigious which lock we're talking about.
2015-07-23Also use l_tls_dtor_count to decide on object unload (BZ #18657)Siddhesh Poyarekar
When an TLS destructor is registered, we set the DF_1_NODELETE flag to signal that the object should not be destroyed. We then clear the DF_1_NODELETE flag when all destructors are called, which is wrong - the flag could have been set by other means too. This patch replaces this use of the flag by using l_tls_dtor_count directly to determine whether it is safe to unload the object. This change has the added advantage of eliminating the lock taking when calling the destructors, which could result in a deadlock. The patch also fixes the test case tst-tls-atexit - it was making an invalid dlclose call, which would just return an error silently. I have also added a detailed note on concurrency which also aims to justify why I chose the semantics I chose for accesses to l_tls_dtor_count. Thanks to Torvald for his help in getting me started on this and (literally) teaching my how to approach the problem. Change verified on x86_64; the test suite does not show any regressions due to the patch. ChangeLog: [BZ #18657] * elf/dl-close.c (_dl_close_worker): Don't unload DSO if there are pending TLS destructor calls. * include/link.h (struct link_map): Add concurrency note for L_TLS_DTOR_COUNT. * stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl): Don't touch the link map flag. Atomically increment l_tls_dtor_count. (__call_tls_dtors): Atomically decrement l_tls_dtor_count. Avoid taking the load lock and don't touch the link map flag. * stdlib/tst-tls-atexit-nodelete.c: New test case. * stdlib/Makefile (tests): Use it. * stdlib/tst-tls-atexit.c (do_test): dlopen tst-tls-atexit-lib.so again before dlclose. Add conditionals to allow tst-tls-atexit-nodelete test case to use it.
2015-07-21Remove Linuxism from tst-tls-atexitSiddhesh Poyarekar
The tst-tls-atexit test case searches for its module in /proc/PID/maps to verify that it is unloaded, which is a Linux-specific test. This patch makes the test generic by looking for the library in the link map list in the _r_debug structure. Verified that the test continues to succeed on x86_64. There is a bug in the test case where it calls dlclose once again, which is actually incorrect but still manages to unload the DSO thanks to an existing bug in __tls_call_dtors. This will be fixed in a later patch which also fixes up the __cxa_thread_atexit_impl implementation. I have added a FIXME comment to that call momentarily, which I will remove when I fix the problem. * stdlib/tst-tls-atexit-lib.c (do_foo): Rename to reg_dtor. * stdlib/tst-tls-atexit.c: (is_loaded): New function. (spawn_thread): New function. (load): Rename to reg_dtor_and_close. Move dlopen to... (do_test): ... here. Use IS_LOADED to test for its availability.
2015-07-16Whitespace fixup in cxa_thread_atexit_impl.cSiddhesh Poyarekar
2015-07-14Fix up typo in tst-tls-atexitSiddhesh Poyarekar
2015-07-14Whitespace fix in tst-tls-atexit.cSiddhesh Poyarekar
2015-07-10Remove unnecessary mutex locks from tst-tls-atexit test caseSiddhesh Poyarekar
The locks don't synchronize with anything - they were likely introduced initially to synchronize with some main thread code, but that is no longer evident.
2015-07-10Avoid boolean coercion in tst-tls-atexit test caseSiddhesh Poyarekar
2015-07-07S390: Fix "backtrace() returns infinitely deep stack frames with ↵Stefan Liebler
makecontext()" [BZ #18508]. On s390/s390x backtrace(buffer, size) returns the series of called functions until "makecontext_ret" and additional entries (up to "size") with "makecontext_ret". GDB-backtrace is also warning: "Backtrace stopped: previous frame identical to this frame (corrupt stack?)" To reproduce this scenario you have to setup a new context with makecontext() and activate it with setcontext(). See e.g. cf() function in testcase stdlib/tst-makecontext.c. Or see bug in libgo "Bug 66303 - runtime.Caller() returns infinitely deep stack frames on s390x " (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66303). This patch omits the cfi_startproc/cfi_endproc directives in ENTRY/END macro of __makecontext_ret. Thus no frame information is generated in .eh_frame and backtrace stops after __makecontext_ret. There is also no .eh_frame info for _start or thread_start functions. ChangeLog: [BZ #18508] * stdlib/Makefile ($(objpfx)tst-makecontext3): Depend on $(libdl). * stdlib/tst-makecontext.c (cf): Test if _Unwind_Backtrace is not called infinitely times. (backtrace_helper): New function. (trace_arg): New struct. (st1): Enlarge stack size. * sysdeps/unix/sysv/linux/s390/s390-32/__makecontext_ret.S: (__makecontext_ret): Omit cfi_startproc and cfi_endproc. * sysdeps/unix/sysv/linux/s390/s390-64/__makecontext_ret.S: Likewise.
2015-06-17Fix fmtmsg addseverity namespace (bug 18539).Joseph Myers
Use of fmtmsg (XSI POSIX) brings in addseverity (non-POSIX). This patch fixes this by making addseverity into a weak alias for __addseverity. Tested for x86_64 and x86 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #18539] * stdlib/fmtmsg.c (addseverity): Rename to __addseverity and define as weak alias of __addseverity. * conform/Makefile (test-xfail-XPG4/fmtmsg.h/linknamespace): Remove variable. (test-xfail-UNIX98/fmtmsg.h/linknamespace): Likewise. (test-xfail-XOPEN2K/fmtmsg.h/linknamespace): Likewise. (test-xfail-XOPEN2K8/fmtmsg.h/linknamespace): Likewise.
2015-06-02Fix setenv.c diagnostic pragma to be compatible with GCC 4.6Roland McGrath
2015-05-27Fix monetary.h commentMarko Myllynen
On 2015-05-26 21:24, Siddhesh Poyarekar wrote: > On Tue, May 26, 2015 at 05:13:07PM +0300, Marko Myllynen wrote: >> this should be obvious, please commit if looks to be ok. >> >> 2015-05-26 Marko Myllynen <myllynen@redhat.com> >> >> * stdlib/monetary.h: Fix comment. > > Patch didn't apply to master, but I've fixed it up and pushed it. sorry about that (a whitespace hickup) - but your patch changed the wrong comment, so here's a new patch to fix the fix.
2015-05-26Fix monetary.h commentSiddhesh Poyarekar
2015-05-17Fix stdlib/tst-setcontext3 with dash [BZ#18418]Adhemerval Zanella
This patch remove the non-portable array usage on tst-setcontext3.sh script.
2015-05-15Remove various ABS macros and replace uses with fabs (or in one case abs)Wilco Dijkstra
which is more efficient on all targets.
2015-05-08Bug 18125: Call exit after last linked context.Carlos O'Donell
There appears to be a discrepancy among the implementations of setcontext with regards to the function called once the last linked-to context has finished executing via setcontext. The POSIX standard says: ~~~ If the uc_link member of the ucontext_t structure pointed to by the ucp argument is equal to 0, then this context is the main context, and the thread will exit when this context returns. ~~~ It says "exit" not "exit immediately" nor "exit without running functions registered with atexit or on_exit." Therefore the AArch64, ARM, hppa and NIOS II implementations are wrong and no test detects it. It is questionable if this should even be fixed or just documented that the above 4 targets are wrong. The functions are deprecated and nobody should be using them, but at the same time it silly to have cross-target differences that make it hard to port old applications from say x86_64 to AArch64. Therefore I will ix the 4 arches, and checkin a regression test to prevent it from changing again. https://sourceware.org/ml/libc-alpha/2015-03/msg00720.html
2015-04-19Better fix for setenv (..., NULL, ...)Paul Eggert
* stdlib/setenv.c (__add_to_environ): Dump core quickly if setenv (..., NULL, ...) is called. This time, do it the right way, and pacify GCC with a pragma.
2015-04-10Fix strtof decimal rounding close to half least subnormal (bug 18247).Joseph Myers
Bug 18247 is an off-by-one error in strtof's determination of a decimal exponent such that any value with that decimal exponent is at most half the least subnormal and so the appropriate underflowing value for the rounding mode can be determined with no multiple-precision computations. (Whether the value is in fact safe despite the off-by-one depends on the floating-point format in question. It's wrong for float and for m68k ldbl-96 but not for other supported formats.) This patch corrects the computation of the exponent in question to be safe in general, adding a comment explaining the new computation. Tested for x86_64. [BZ #18247] * stdlib/strtod_l.c (____STRTOF_INTERNAL): Decrease minimum decimal exponent by 1. * stdlib/tst-strtod-round-data: Add more tests. * stdlib/tst-strtod-round.c (tests): Regenerated.
2015-03-15* stdlib/setenv.c (__add_to_environ): Revert previous change.Paul Eggert
2015-03-13* stdlib/setenv.c (__add_to_environ):Paul Eggert
Dump core quickly if setenv (..., NULL, ...) is called.
2015-03-12S/390: Fix setcontext/swapcontext which are not restoring sigmask.Stefan Liebler
2015-01-07setenv fix memory leak when setting large, duplicate string (BZ #17658)Eric Biggers
glibc maintains a binary tree of environment strings it malloc()ed itself. However, it's possible for it to malloc() a string, then find that an identical string is already in the tree. In this case, the memory is leaked and is not freed if the application later calls __libc_freeres(). Fix this by freeing 'new_value' when it's unneeded. Test case: #include <stdlib.h> #include <string.h> int main() { char *p = calloc(100000, 1); memset(p, 'A', 99999); setenv("TESTVAR", p, 1); setenv("TESTVAR", p, 1); free(p); } Leak that was reported by valgrind: 100,008 bytes in 1 blocks are definitely lost in loss record 1 of 1 at 0x4C29F90: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4E6B3D4: __add_to_environ (setenv.c:176) by 0x4C31B8F: setenv (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x400642: main (in /mnt/tmpfs/a.out)
2015-01-02Update copyright dates with scripts/update-copyrights.Joseph Myers
2014-12-30Fix some warnings in the absence of FP round/exception supportChris Metcalf
Due to tile missing a bunch of FP exception and rounding support, the tests generate warnings. These changes fix the warnings by just not compiling some unused functions, and adding some attribute ((unused)) tags.
2014-12-29Fix a couple of -Wundef warnings.Chris Metcalf
2014-12-16Modify stdlib/tst-bsearch.c to use test-skeleton.cArjun Shankar
This test used to define a 'struct entry' that conflicts with the definition in search.h included in test-skeleton. The struct is now renamed 'item'.
2014-11-24Remove NOT_IN_libcSiddhesh Poyarekar
Replace with !IS_IN (libc). This completes the transition from the IS_IN/NOT_IN macros to the IN_MODULE macro set. The generated code is unchanged on x86_64. * stdlib/isomac.c (fmt): Replace NOT_IN_libc with IN_MODULE. (get_null_defines): Adjust. * sunrpc/Makefile: Adjust comment. * Makerules (CPPFLAGS-nonlib): Remove NOT_IN_libc. * elf/Makefile (CPPFLAGS-sotruss-lib): Likewise. (CFLAGS-interp.c): Likewise. (CFLAGS-ldconfig.c): Likewise. (CPPFLAGS-.os): Likewise. * elf/rtld-Rules (rtld-CPPFLAGS): Likewise. * extra-lib.mk (CPPFLAGS-$(lib)): Likewise. * extra-modules.mk (extra-modules.mk): Likewise. * iconv/Makefile (CPPFLAGS-iconvprogs): Likewise. * locale/Makefile (CPPFLAGS-locale_programs): Likewise. * malloc/Makefile (CPPFLAGS-memusagestat): Likewise. * nscd/Makefile (CPPFLAGS-nscd): Likewise. * nss/Makefile (CPPFLAGS-nss_test1): Likewise. * stdlib/Makefile (CFLAGS-tst-putenvmod.c): Likewise. * sysdeps/gnu/Makefile ($(objpfx)errlist-compat.c): Likewise. * sysdeps/unix/sysv/linux/Makefile (CPPFLAGS-lddlibc4): Likewise. * iconvdata/Makefile (CPPFLAGS): Likewise. (cpp-srcs-left): Add libof for all iconvdata routines. * bits/stdio-lock.h: Replace NOT_IN_libc with IS_IN. * include/assert.h: Likewise. * include/ctype.h: Likewise. * include/errno.h: Likewise. * include/libc-symbols.h: Likewise. * include/math.h: Likewise. * include/netdb.h: Likewise. * include/resolv.h: Likewise. * include/stdio.h: Likewise. * include/stdlib.h: Likewise. * include/string.h: Likewise. * include/sys/stat.h: Likewise. * include/wctype.h: Likewise. * intl/l10nflist.c: Likewise. * libidn/idn-stub.c: Likewise. * libio/libioP.h: Likewise. * nptl/libc_multiple_threads.c: Likewise. * nptl/pthreadP.h: Likewise. * posix/regex_internal.h: Likewise. * resolv/res_hconf.c: Likewise. * sysdeps/arm/armv7/multiarch/memcpy.S: Likewise. * sysdeps/arm/memmove.S: Likewise. * sysdeps/arm/sysdep.h: Likewise. * sysdeps/generic/_itoa.h: Likewise. * sysdeps/generic/symbol-hacks.h: Likewise. * sysdeps/gnu/errlist.awk: Likewise. * sysdeps/gnu/errlist.c: Likewise. * sysdeps/i386/i586/memcpy.S: Likewise. * sysdeps/i386/i586/memset.S: Likewise. * sysdeps/i386/i686/memcpy.S: Likewise. * sysdeps/i386/i686/memmove.S: Likewise. * sysdeps/i386/i686/mempcpy.S: Likewise. * sysdeps/i386/i686/memset.S: Likewise. * sysdeps/i386/i686/multiarch/bcopy.S: Likewise. * sysdeps/i386/i686/multiarch/bzero.S: Likewise. * sysdeps/i386/i686/multiarch/memchr-sse2-bsf.S: Likewise. * sysdeps/i386/i686/multiarch/memchr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/memchr.S: Likewise. * sysdeps/i386/i686/multiarch/memcmp-sse4.S: Likewise. * sysdeps/i386/i686/multiarch/memcmp-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/memcmp.S: Likewise. * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise. * sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/memcpy.S: Likewise. * sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise. * sysdeps/i386/i686/multiarch/memmove.S: Likewise. * sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise. * sysdeps/i386/i686/multiarch/mempcpy.S: Likewise. * sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise. * sysdeps/i386/i686/multiarch/memrchr-c.c: Likewise. * sysdeps/i386/i686/multiarch/memrchr-sse2-bsf.S: Likewise. * sysdeps/i386/i686/multiarch/memrchr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/memrchr.S: Likewise. * sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise. * sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/memset.S: Likewise. * sysdeps/i386/i686/multiarch/memset_chk.S: Likewise. * sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise. * sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/strcat-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/strcat.S: Likewise. * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Likewise. * sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/strchr.S: Likewise. * sysdeps/i386/i686/multiarch/strcmp-sse4.S: Likewise. * sysdeps/i386/i686/multiarch/strcmp-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/strcmp.S: Likewise. * sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/strcpy-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/strcpy.S: Likewise. * sysdeps/i386/i686/multiarch/strcspn.S: Likewise. * sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S: Likewise. * sysdeps/i386/i686/multiarch/strlen-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/strlen.S: Likewise. * sysdeps/i386/i686/multiarch/strnlen.S: Likewise. * sysdeps/i386/i686/multiarch/strrchr-sse2-bsf.S: Likewise. * sysdeps/i386/i686/multiarch/strrchr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/strrchr.S: Likewise. * sysdeps/i386/i686/multiarch/strspn.S: Likewise. * sysdeps/i386/i686/multiarch/wcschr-c.c: Likewise. * sysdeps/i386/i686/multiarch/wcschr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/wcschr.S: Likewise. * sysdeps/i386/i686/multiarch/wcscmp-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/wcscmp.S: Likewise. * sysdeps/i386/i686/multiarch/wcscpy-c.c: Likewise. * sysdeps/i386/i686/multiarch/wcscpy-ssse3.S: Likewise. * sysdeps/i386/i686/multiarch/wcscpy.S: Likewise. * sysdeps/i386/i686/multiarch/wcslen-c.c: Likewise. * sysdeps/i386/i686/multiarch/wcslen-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/wcslen.S: Likewise. * sysdeps/i386/i686/multiarch/wcsrchr-c.c: Likewise. * sysdeps/i386/i686/multiarch/wcsrchr-sse2.S: Likewise. * sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise. * sysdeps/i386/i686/multiarch/wmemcmp-c.c: Likewise. * sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise. * sysdeps/ia64/fpu/libm-symbols.h: Likewise. * sysdeps/nptl/bits/libc-lock.h: Likewise. * sysdeps/nptl/bits/libc-lockP.h: Likewise. * sysdeps/nptl/bits/stdio-lock.h: Likewise. * sysdeps/posix/closedir.c: Likewise. * sysdeps/posix/opendir.c: Likewise. * sysdeps/posix/readdir.c: Likewise. * sysdeps/posix/rewinddir.c: Likewise. * sysdeps/powerpc/novmx-sigjmp.c: Likewise. * sysdeps/powerpc/powerpc32/__longjmp.S: Likewise. * sysdeps/powerpc/powerpc32/bsd-_setjmp.S: Likewise. * sysdeps/powerpc/powerpc32/fpu/__longjmp.S: Likewise. * sysdeps/powerpc/powerpc32/fpu/setjmp.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memset-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/memset.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strlen-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp-ppc32.S: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strncmp.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr-ppc32.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy.c: Likewise. * sysdeps/powerpc/powerpc32/power6/memset.S: Likewise. * sysdeps/powerpc/powerpc32/setjmp.S: Likewise. * sysdeps/powerpc/powerpc64/__longjmp.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/bzero.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcmp-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcmp.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memmove-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memmove.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memrchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/memset.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpcpy-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpncpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcat.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strchrnul.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcmp.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcpy-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strcspn.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strlen-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strlen.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncase.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncase_l.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncat.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncmp.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncpy-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strncpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strnlen.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strpbrk.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strrchr-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strrchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/strspn.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcschr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcscpy.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wcsrchr.c: Likewise. * sysdeps/powerpc/powerpc64/multiarch/wordcopy.c: Likewise. * sysdeps/powerpc/powerpc64/setjmp.S: Likewise. * sysdeps/s390/s390-32/multiarch/ifunc-resolve.c: Likewise. * sysdeps/s390/s390-32/multiarch/memcmp.S: Likewise. * sysdeps/s390/s390-32/multiarch/memcpy.S: Likewise. * sysdeps/s390/s390-32/multiarch/memset.S: Likewise. * sysdeps/s390/s390-64/multiarch/ifunc-resolve.c: Likewise. * sysdeps/s390/s390-64/multiarch/memcmp.S: Likewise. * sysdeps/s390/s390-64/multiarch/memcpy.S: Likewise. * sysdeps/s390/s390-64/multiarch/memset.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-niagara1.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-niagara2.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-niagara4.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memset-niagara1.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise. * sysdeps/unix/alpha/sysdep.S: Likewise. * sysdeps/unix/alpha/sysdep.h: Likewise. * sysdeps/unix/make-syscalls.sh: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/alpha/vfork.S: Likewise. * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/getpid.c: Likewise. * sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/hppa/nptl/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/ia64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/lowlevellock-futex.h: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/m68k-vdso.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/not-cancel.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/s390/longjmp_chk.c: Likewise. * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/vfork.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/vfork.S: Likewise. * sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/sh/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sh/vfork.S: Likewise. * sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/brk.S: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/tile/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/tile/sysdep.h: Likewise. * sysdeps/unix/sysv/linux/tile/waitpid.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/wordsize-32/symbol-hacks.h: Likewise. * sysdeps/x86_64/memcpy.S: Likewise. * sysdeps/x86_64/memmove.c: Likewise. * sysdeps/x86_64/memset.S: Likewise. * sysdeps/x86_64/multiarch/init-arch.h: Likewise. * sysdeps/x86_64/multiarch/memcmp-sse4.S: Likewise. * sysdeps/x86_64/multiarch/memcmp-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/memcmp.S: Likewise. * sysdeps/x86_64/multiarch/memcpy-avx-unaligned.S: Likewise. * sysdeps/x86_64/multiarch/memcpy-ssse3-back.S: Likewise. * sysdeps/x86_64/multiarch/memcpy-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/memcpy.S: Likewise. * sysdeps/x86_64/multiarch/memcpy_chk.S: Likewise. * sysdeps/x86_64/multiarch/memmove.c: Likewise. * sysdeps/x86_64/multiarch/mempcpy.S: Likewise. * sysdeps/x86_64/multiarch/mempcpy_chk.S: Likewise. * sysdeps/x86_64/multiarch/memset-avx2.S: Likewise. * sysdeps/x86_64/multiarch/memset.S: Likewise. * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. * sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: Likewise. * sysdeps/x86_64/multiarch/strcat-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/strcat.S: Likewise. * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise. * sysdeps/x86_64/multiarch/strchr.S: Likewise. * sysdeps/x86_64/multiarch/strcmp-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/strcmp.S: Likewise. * sysdeps/x86_64/multiarch/strcpy-sse2-unaligned.S: Likewise. * sysdeps/x86_64/multiarch/strcpy-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/strcpy.S: Likewise. * sysdeps/x86_64/multiarch/strcspn.S: Likewise. * sysdeps/x86_64/multiarch/strspn.S: Likewise. * sysdeps/x86_64/multiarch/wcscpy-c.c: Likewise. * sysdeps/x86_64/multiarch/wcscpy-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/wcscpy.S: Likewise. * sysdeps/x86_64/multiarch/wmemcmp-c.c: Likewise. * sysdeps/x86_64/multiarch/wmemcmp.S: Likewise. * sysdeps/x86_64/strcmp.S: Likewise.
2014-11-19Add new macro IN_MODULE to identify module in which source is builtSiddhesh Poyarekar
The current scheme to identify which module a translation unit is built in depends on defining multiple macros IS_IN_* and also defining NOT_IN_libc if we're building a non-libc module. In addition, there is an IN_LIB macro that does effectively the same thing, but for different modules (notably the systemtap probes). This macro scheme unifies both ideas to use just one macro IN_MODULE and assign it a value depending on the module it is being built into. If the module is not defined, it defaults to MODULE_libc. Patches that follow will replace uses of IS_IN_* variables with the IS_IN() macro. libc-symbols.h has been converted already to give an example of how such a transition will look. Verified that there are no relevant binary changes. One source change that will crop up repeatedly is that of nscd_stat, since it uses the build timestamp as a constant in its logic. * Makeconfig (in-module): Get value of libof set for the translation unit. (CPPFLAGS): Use $(in-module). * Makerules: Don't suffix routine names for nonlib. * include/libc-modules.h: New file. * include/libc-symbols.h: Include libc-modules.h (IS_IN): New macro to replace IS_IN_* macros. * elf/Makefile: Set libof-* for each routine. * elf/rtld-Rules: Likewise. * extra-modules.mk: Likewise. * iconv/Makefile: Likewise. * iconvdata/Makefile: Likewise. * locale/Makefile: Likewise. * malloc/Makefile: Likewise. * nss/Makefile: Likewise. * sysdeps/gnu/Makefile: Likewise. * sysdeps/ieee754/ldbl-opt/Makefile: Likewise. * sysdeps/unix/sysv/linux/Makefile: Likewise. * sysdeps/s390/s390-64/Makefile: Likewise. * nscd/Makefile: Set libof-* for each routine. Set CFLAGS and CPPFLAGS for nscd instead of nonlib.
2014-11-13Use prototype definition for __strtol.Joseph Myers
This patch fixes those warnings by using a prototype definition for __strtol. Tested for x86_64 that stripped installed shared libraries are unchanged by this patch. * stdlib/strtol.c (__strtol): Use prototype definition.
2014-11-13Fix strtoll / strtoull namespace for 32-bit (bug 17594).Joseph Myers
For 32-bit platforms, strtoll and strtoull are strong symbols in libc, but they are not in ISO C90, and are brought in by references to __strtoll_internal / __strtoull_internal from scanf. (For 64-bit platforms, they are properly weak.) This patch makes them weak for 32-bit (it has a side-effect of making other symbols weak that don't need to be weak, such as strtol, but that's harmless). Tested for x86 (testsuite, and that the disassembly of installed shared libraries is unchanged by the patch). This fixes all 120 unXFAILed FAILs of the new linknamespace tests seen for x86 (in fact, there are now seven XPASSes of those tests for x86 XPASS: conform/POSIX2008/fcntl.h/linknamespace XPASS: conform/UNIX98/libgen.h/linknamespace XPASS: conform/XOPEN2K/fcntl.h/linknamespace XPASS: conform/XOPEN2K/libgen.h/linknamespace XPASS: conform/XOPEN2K8/fcntl.h/linknamespace XPASS: conform/XOPEN2K8/libgen.h/linknamespace XPASS: conform/XPG4/libgen.h/linknamespace so suggesting that the failures seen for those on x86_64 are in some way architecture-specific or 64-bit-specific). [BZ #17594] * stdlib/strtol.c (SYM__): New macro. (SYM__1): Likewise. (__strtol): Likewise. (strtol): Rename to __strtol and define as weak alias of __strtol. Use libc_hidden_weak.
2014-11-12Fix qsort_r namespace (bug 17571).Joseph Myers
qsort_r is defined in the same file as qsort, but is not an ISO C function, so should be a weak alias for __qsort_r. The uses in getaddrinfo should also call __qsort_r, since getaddrinfo is a POSIX function and qsort_r isn't. This patch implements this. Because nscd uses the getaddrinfo sources outside libc, as do the tst-rfc3484 tests, a #define of __qsort_r to qsort_r is added there alongside the similar defines for other libc-internal symbols used in getaddrinfo. Tested for x86_64 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #17571] * stdlib/msort.c (qsort_r): Rename to __qsort_r and define as weak alias of __qsort_r. (qsort): Call __qsort_r instead of qsort_r. * include/stdlib.h (qsort_r): Do not call libc_hidden_proto. (__qsort_r): Declare. Call libc_hidden_proto. * sysdeps/posix/getaddrinfo.c (getaddrinfo): Call __qsort_r instead of qsort_r. * nscd/gai.c (__qsort_r): Define to qsort_r. * posix/tst-rfc3484.c (__qsort_r): Likewise. * posix/tst-rfc3484-2.c (__qsort_r): Likewise. * posix/tst-rfc3484-3.c (__qsort_r): Likewise.
2014-11-05Modify several tests to use test-skeleton.cArjun Shankar
This patch modifies several test cases to use test-skeleton.c. It was generated by a bash script written for this purpose and thus excludes several other tests which I deemed worth a visual inspection before making the change. I intend to follow up with individual patches to the tests skipped by the script. The script itself resides at http://git.io/WODAmg and should reproduce this very patch when run against master. ChangeLog: 2014-10-30 Arjun Shankar <arjun.is@lostca.se> * catgets/test-gencat.c: Use test-skeleton.c. * catgets/tst-catgets.c: Likewise. * csu/tst-empty.c: Likewise. * elf/tst-audit2.c: Likewise. * elf/tst-global1.c: Likewise. * elf/tst-pathopt.c: Likewise. * elf/tst-piemod1.c: Likewise. * elf/tst-tls10.c: Likewise. * elf/tst-tls11.c: Likewise. * elf/tst-tls12.c: Likewise. * gnulib/tst-gcc.c: Likewise. * iconvdata/tst-e2big.c: Likewise. * iconvdata/tst-loading.c: Likewise. * iconv/tst-iconv1.c: Likewise. * iconv/tst-iconv2.c: Likewise. * inet/test-inet6_opt.c: Likewise. * inet/tst-gethnm.c: Likewise. * inet/tst-network.c: Likewise. * inet/tst-ntoa.c: Likewise. * intl/tst-codeset.c: Likewise. * intl/tst-gettext2.c: Likewise. * intl/tst-gettext3.c: Likewise. * intl/tst-ngettext.c: Likewise. * intl/tst-translit.c: Likewise. * io/test-stat.c: Likewise. * libio/test-fmemopen.c: Likewise. * libio/tst-freopen.c: Likewise. * libio/tst-sscanf.c: Likewise. * libio/tst-ungetwc1.c: Likewise. * libio/tst-ungetwc2.c: Likewise. * libio/tst-widetext.c: Likewise. * localedata/tst-ctype.c: Likewise. * localedata/tst-digits.c: Likewise. * localedata/tst-leaks.c: Likewise. * localedata/tst-mbswcs1.c: Likewise. * localedata/tst-mbswcs2.c: Likewise. * localedata/tst-mbswcs3.c: Likewise. * localedata/tst-mbswcs4.c: Likewise. * localedata/tst-mbswcs5.c: Likewise. * localedata/tst-setlocale.c: Likewise. * localedata/tst-trans.c: Likewise. * localedata/tst-wctype.c: Likewise. * localedata/tst-xlocale1.c: Likewise. * login/tst-grantpt.c: Likewise. * malloc/tst-calloc.c: Likewise. * malloc/tst-malloc.c: Likewise. * malloc/tst-mallocstate.c: Likewise. * malloc/tst-mcheck.c: Likewise. * malloc/tst-mtrace.c: Likewise. * malloc/tst-obstack.c: Likewise. * math/atest-exp2.c: Likewise. * math/atest-exp.c: Likewise. * math/atest-sincos.c: Likewise. * math/test-matherr.c: Likewise. * math/test-misc.c: Likewise. * math/test-powl.c: Likewise. * math/tst-definitions.c: Likewise. * misc/tst-dirname.c: Likewise. * misc/tst-efgcvt.c: Likewise. * misc/tst-fdset.c: Likewise. * misc/tst-hsearch.c: Likewise. * misc/tst-mntent2.c: Likewise. * nptl/tst-sem7.c: Likewise. * nptl/tst-sem8.c: Likewise. * nptl/tst-sem9.c: Likewise. * nss/test-netdb.c: Likewise. * posix/tst-fnmatch.c: Likewise. * posix/tst-getlogin.c: Likewise. * posix/tst-gnuglob.c: Likewise. * posix/tst-mmap.c: Likewise. * pwd/tst-getpw.c: Likewise. * resolv/tst-inet_ntop.c: Likewise. * rt/tst-timer.c: Likewise. * stdio-common/test-fseek.c: Likewise. * stdio-common/test-popen.c: Likewise. * stdio-common/test-vfprintf.c: Likewise. * stdio-common/tst-cookie.c: Likewise. * stdio-common/tst-fileno.c: Likewise. * stdio-common/tst-gets.c: Likewise. * stdio-common/tst-obprintf.c: Likewise. * stdio-common/tst-perror.c: Likewise. * stdio-common/tst-sprintf2.c: Likewise. * stdio-common/tst-sprintf3.c: Likewise. * stdio-common/tst-sprintf.c: Likewise. * stdio-common/tst-swprintf.c: Likewise. * stdio-common/tst-tmpnam.c: Likewise. * stdio-common/tst-unbputc.c: Likewise. * stdio-common/tst-wc-printf.c: Likewise. * stdlib/tst-environ.c: Likewise. * stdlib/tst-fmtmsg.c: Likewise. * stdlib/tst-limits.c: Likewise. * stdlib/tst-rand48-2.c: Likewise. * stdlib/tst-rand48.c: Likewise. * stdlib/tst-random2.c: Likewise. * stdlib/tst-random.c: Likewise. * stdlib/tst-strtol.c: Likewise. * stdlib/tst-strtoll.c: Likewise. * stdlib/tst-tls-atexit.c: Likewise. * stdlib/tst-xpg-basename.c: Likewise. * string/test-ffs.c: Likewise. * string/tst-bswap.c: Likewise. * string/tst-inlcall.c: Likewise. * string/tst-strtok.c: Likewise. * string/tst-strxfrm.c: Likewise. * sysdeps/x86_64/tst-audit10.c: Likewise. * sysdeps/x86_64/tst-audit3.c: Likewise. * sysdeps/x86_64/tst-audit4.c: Likewise. * sysdeps/x86_64/tst-audit5.c: Likewise. * time/tst-ftime_l.c: Likewise. * time/tst-getdate.c: Likewise. * time/tst-mktime3.c: Likewise. * time/tst-mktime.c: Likewise. * time/tst-posixtz.c: Likewise. * time/tst-strptime2.c: Likewise. * time/tst-strptime3.c: Likewise. * wcsmbs/tst-btowc.c: Likewise. * wcsmbs/tst-mbrtowc.c: Likewise. * wcsmbs/tst-mbsrtowcs.c: Likewise. * wcsmbs/tst-wchar-h.c: Likewise. * wcsmbs/tst-wcpncpy.c: Likewise. * wcsmbs/tst-wcrtomb.c: Likewise. * wcsmbs/tst-wcsnlen.c: Likewise. * wcsmbs/tst-wcstof.c: Likewise.
2014-10-09Don't use INTDEF/INTUSE with __cxa_atexit (bug 14132).Joseph Myers
This patch removes use of the obsolete INTDEF/INTUSE mechanism for __cxa_atexit, replacing it with libc_hidden_def/libc_hidden_proto. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. [BZ #14132] * stdlib/cxa_atexit.c (__cxa_atexit): Use libc_hidden_def instead of INTDEF. * include/stdlib.h (__cxa_atexit_internal): Remove declaration. (__cxa_atexit): Use libc_hidden_proto. [!NOT_IN_libc] (__cxa_atexit): Remove macro definition.
2014-09-30stdlib/tst-strtod-round.c: Fix build on ARMWill Newton
Building this test on ARM fails because the prototypes for the long double variants of the math functions are unavailable. Add an additional include guard to math.h that enables long double math function declarations if _LIBC_TEST is defined and define _LIBC_TEST in stdlib/tst-strtod-round.c. ChangeLog: 2014-09-30 Will Newton <will.newton@linaro.org> * math/math.h: Define long double math functions if _LIBC_TEST is defined. * stdlib/tst-strtod-round.c: Define _LIBC_TEST.
2014-09-19stdlib/longlong.h: Add __udiv_w_sdiv prototype.Andreas Krebbel
2014-09-12Don't use a nested function in rpmatch.Roland McGrath
2014-09-10Turn on -Werror=implicit-function-declarationFlorian Weimer
GCC 4.4, the minimum compiler version, supports this option. Unlike other warnings, -Wimplicit-function-declaration warnings should be independent of compiler versions, so this change should not cause compiler-specific build failures.
2014-08-03tst-setcontext: fix styleMike Frysinger
2014-07-03stdlib/tst-strtod-overflow: Bump timeout up yetMaciej W. Rozycki
This test case is very, especially on targets using soft-float or QEMU (where soft-float is used internally), and appears to be the only such outlier. Therefore rather than requiring to have TIMEOUTFACTOR set large enough globally, bump up the local scaling factor instead. * stdlib/tst-strtod-overflow.c (TIMEOUT): Bump up to 30.
2014-06-20Clean up HAVE_CONFIG_H and STDC_HEADERS.Roland McGrath
2014-06-20stdlib/tst-qsort2.c: Fix off-by-one argc interpretation errorMaciej W. Rozycki
This fixes an off-by-one argc interpretation error (argv[0] is included in the count) in stdlib/tst-qsort2.c causing a segfault if the program is called with one command-line argument only (argv[2] is NULL in that case).
2014-06-06Don't require test wrappers to preserve environment variables, use more ↵Joseph Myers
consistent environment. One wart in the original support for test wrappers for cross testing, as noted in <https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the requirement for test wrappers to pass a poorly-defined set of environment variables from the build system to the system running the glibc under test. Although some variables are passed explicitly via $(test-wrapper-env), including LD_* variables that simply can't be passed implicitly because of the side effects they'd have on the build system's dynamic linker, others are passed implicitly, including variables such as GCONV_PATH and LOCPATH that could potentially affect the build system's libc (so effectively relying on any such effects not breaking the wrappers). In addition, the code in cross-test-ssh.sh for preserving environment variables is fragile (it depends on how bash formats a list of exported variables, and could well break for multi-line variable definitions where the contents contain things looking like other variable definitions). This patch moves to explicitly passing environment variables via $(test-wrapper-env). Makefile variables that previously used $(test-wrapper) are split up into -before-env and -after-env parts that can be passed separately to the various .sh files used in testing, so those files can then insert environment settings between the two parts. The common default environment settings in make-test-out are made into a separate makefile variable that can also be passed to scripts, rather than many scripts duplicating those settings (for testing an installed glibc, it is desirable to have the GCONV_PATH setting on just one place, so just that one place needs to support it pointing to an installed sysroot instead of the build tree). The default settings are included in the variables such as $(test-program-prefix), so that if tests do not need any non-default settings they can continue to use single variables rather than the split-up variables. Although this patch cleans up LC_ALL=C settings (that being part of the common defaults), various LANG=C and LANGUAGE=C settings remain. Those are generally unnecessary and I propose a subsequent cleanup to remove them. LC_ALL takes precedence over LANG, and while LANGUAGE takes precedence over LC_ALL, it only does so for settings other than LC_ALL=C. So LC_ALL=C on its own is sufficient to ensure the C locale, and anything that gets LC_ALL=C does not need the other settings. While preparing this patch I noticed some tests with .sh files that appeared to do nothing beyond what the generic makefile support for tests can do (localedata/tst-wctype.sh - the makefiles support -ENV variables and .input files - and localedata/tst-mbswcs.sh - just runs five tests that could be run individually from the makefile). So I propose another subsequent cleanup to move those to using the generic support instead of special .sh files. Tested x86_64 (native) and powerpc32 (cross). * Makeconfig (run-program-env): New variable. (run-program-prefix-before-env): Likewise. (run-program-prefix-after-env): Likewise. (run-program-prefix): Define in terms of new variables. (built-program-cmd-before-env): New variable. (built-program-cmd-after-env): Likewise. (built-program-cmd): Define in terms of new variables. (test-program-prefix-before-env): New variable. (test-program-prefix-after-env): Likewise. (test-program-prefix): Define in terms of new variables. (test-program-cmd-before-env): New variable. (test-program-cmd-after-env): Likewise. (test-program-cmd): Define in terms of new variables. * Rules (make-test-out): Use $(run-program-env). * scripts/cross-test-ssh.sh (env_blacklist): Remove variable. (help): Do not mention environment variables. Mention --timeoutfactor option. (timeoutfactor): New variable. (blacklist_exports): Remove function. (exports): Remove variable. (command): Do not include ${exports}. * manual/install.texi (Configuring and compiling): Do not mention test wrappers preserving environment variables. Mention that last assignment to a variable must take precedence. * INSTALL: Regenerated. * benchtests/Makefile (run-bench): Use $(run-program-env). * catgets/Makefile ($(objpfx)test1.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test2.cat): Do not specify environment variables explicitly. ($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)sample.SJIS.cat): Do not specify environment variables explicitly. * catgets/test-gencat.sh: Use test_program_cmd_before_env, run_program_env and test_program_cmd_after_env arguments. * elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env). * elf/tst-pathopt.sh: Use run_program_env argument. * iconvdata/Makefile ($(objpfx)iconv-test.out): Use $(test-wrapper-env) and $(run-program-env). * iconvdata/run-iconv-test.sh: Use test_wrapper_env and run_program_env arguments. * iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly. * intl/Makefile ($(objpfx)tst-gettext.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-gettext2.out): Likewise. * intl/tst-gettext.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * intl/tst-gettext2.sh: Likewise. * intl/tst-gettext4.sh: Do not set environment variables explicitly. * intl/tst-gettext6.sh: Likewise. * intl/tst-translit.sh: Likewise. * malloc/Makefile ($(objpfx)tst-mtrace.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * malloc/tst-mtrace.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * math/Makefile (run-regen-ulps): Use $(run-program-env). * nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env). * nptl/tst-tls6.sh: Use run_program_env argument. Set LANG=C explicitly with each use of ${test_wrapper_env}. * posix/Makefile ($(objpfx)wordexp-tst.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * posix/tst-getconf.sh: Do not set environment variables explicitly. * posix/wordexp-tst.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * stdio-common/tst-printf.sh: Do not set environment variables explicitly. * stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). * stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. Split $test calls into $test_pre and $test. * timezone/Makefile (build-testdata): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). localedata/ChangeLog: * Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)sort-test.out): Use $(test-program-prefix-before-env), $(run-program-env) and $(test-program-prefix-after-env). ($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env), $(run-program-env) and $(run-program-prefix-after-env). ($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env), $(run-program-env) and $(built-program-cmd-after-env). ($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env), $(run-program-env), $(run-program-prefix-after-env), $(test-program-prefix-before-env) and $(test-program-prefix-after-env). ($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env), $(run-program-env) and $(test-program-cmd-after-env). ($(objpfx)tst-wctype.out): Likewise. ($(objpfx)tst-langinfo.out): Likewise. ($(objpfx)tst-langinfo-static.out): Likewise. * gen-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * sort-test.sh: Use test_program_prefix_before_env, run_program_env and test_program_prefix_after_env arguments. * tst-ctype.sh: Use tst_ctype_before_env, run_program_env and tst_ctype_after_env arguments. * tst-fmon.sh: Use run_program_prefix_before_env, run_program_env and run_program_prefix_after_env arguments. * tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env and tst_langinfo_after_env arguments. * tst-locale.sh: Use localedef_before_env, run_program_env and localedef_after_env arguments. * tst-mbswcs.sh: Do not set environment variables explicitly. * tst-numeric.sh: Likewise. * tst-rpmatch.sh: Likewise. * tst-trans.sh: Use run_program_prefix_before_env, run_program_env, run_program_prefix_after_env, test_program_prefix_before_env and test_program_prefix_after_env arguments. * tst-wctype.sh: Use tst_wctype_before_env, run_program_env and tst_wctype_after_env arguments.