aboutsummaryrefslogtreecommitdiff
path: root/stdlib
AgeCommit message (Collapse)AuthorFilesLines
2017-12-23getrandom: fix comment [BZ #22347]Dmitry V. Levin1-2/+2
* stdlib/getrandom.c (getrandom): Fix comment. * sysdeps/unix/sysv/linux/getrandom.c (getrandom): Likewise.
2017-12-20Simplify tilegx sysdeps folderAdhemerval Zanella1-1/+1
With tilepro support removal we can now simplify internal tile support by moving the directory structure to avoid the unnecessary directory levels in tile/tilegx both on generic and linux folders. Checked with a build for tilegx-linux-gnu and tilegx-linux-gnu-32 with and without the patch, there is no difference in generated binary with a dissassemble. * stdlib/bug-getcontext.c (do_test): Remove tilepro mention in comment. * sysdeps/tile/preconfigure: Remove tilegx folder. * sysdeps/tile/tilegx/Implies: Move definitions to ... * sysdeps/tile/Implies: ... here. * sysdeps/tile/tilegx/Makefile: Move rules to ... * sysdeps/tile/Makefile: ... here. * sysdeps/tile/tilegx/atomic-machine.h: Move definitions to ... * sysdeps/tile/atomic-machine.h: ... here. Add include guards. * sysdeps/tile/tilegx/bits/wordsize.h: Move to ... * sysdeps/tile/bits/wordsize.h: ... here. * sysdeps/tile/tilegx/*: Move to ... * sysdeps/tile/*: ... here. * sysdeps/tile/tilegx/tilegx32/Implies: Move to ... * sysdeps/tile/tilegx32/Implies: ... here. * sysdeps/tile/tilegx/tilegx64/Implies: Move to ... * sysdeps/tile/tilegx64/Implies: ... here. * sysdeps/unix/sysv/linux/tile/tilegx/Makefile: Move definitions to ... * sysdeps/unix/sysv/linux/tile/Makefile: ... here. * sysdeps/unix/sysv/linux/tile/tilegx/*: Move to ... * sysdeps/unix/sysv/linux/tile/*: ... here. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/*: Move to ... * sysdeps/unix/sysv/linux/tile/tilegx32/*: ... here. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/*: Move to ... * sysdeps/unix/sysv/linux/tile/tilegx64/*: ... here.
2017-12-15Fix testing with read-only source directory.Joseph Myers1-1/+1
Three tests fail with a read-only source directory because they try to write into the source directory. None of these write into it in a way that should actually be problematic for concurrent builds sharing the same writable source directory, but avoiding any writing into the source directory (from testing, or from building glibc if the source timestamps are properly ordered) is still a good idea, as being able to build with read-only sources helps make sure there isn't anything that could cause problems for concurrent builds. This patch changes the tests in question to use either /tmp or the build directory to write their temporary files (or to test O_TMPFILE, as applicable). Tested for x86_64. * io/Makefile (tst-open-tmpfile-ARGS): New variable. * posix/tst-mmap-offset.c (fname): Use /tmp. * stdlib/tst-setcontext3.sh (tempfile): Use ${objpfx}.
2017-12-11Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.cH.J. Lu1-13/+13
Replace = with += in CFLAGS-xxx.c and CPPFLAGS-xxx.c to allow Makefile under sysdeps to define CFLAGS-xx.c and CPPFLAGS-xxx.c. * argp/Makefile (CFLAGS-argp-help.c): Replace = with +=. (CFLAGS-argp-parse.c): Likewise. (CFLAGS-argp-fmtstream.c): Likewise. * crypt/Makefile (CPPFLAGS-sha256-crypt.c): Likewise. (CPPFLAGS-sha512-crypt.c): Likewise. (CPPFLAGS-md5-crypt.c): Likewise. * debug/Makefile (CFLAGS-stack_chk_fail.c): Likewise. (CFLAGS-stack_chk_fail_local.c): Likewise. (CFLAGS-backtrace.c): Likewise. (CFLAGS-sprintf_chk.c): Likewise. (CFLAGS-snprintf_chk.c): Likewise. (CFLAGS-vsprintf_chk.c): Likewise. (CFLAGS-vsnprintf_chk.c): Likewise. (CFLAGS-asprintf_chk.c): Likewise. (CFLAGS-vasprintf_chk.c): Likewise. (CFLAGS-obprintf_chk.c): Likewise. (CFLAGS-dprintf_chk.c): Likewise. (CFLAGS-vdprintf_chk.c): Likewise. (CFLAGS-printf_chk.c): Likewise. (CFLAGS-fprintf_chk.c): Likewise. (CFLAGS-vprintf_chk.c): Likewise. (CFLAGS-vfprintf_chk.c): Likewise. (CFLAGS-gets_chk.c): Likewise. (CFLAGS-fgets_chk.c): Likewise. (CFLAGS-fgets_u_chk.c): Likewise. (CFLAGS-fread_chk.c): Likewise. (CFLAGS-fread_u_chk.c): Likewise. (CFLAGS-swprintf_chk.c): Likewise. (CFLAGS-vswprintf_chk.c): Likewise. (CFLAGS-wprintf_chk.c): Likewise. (CFLAGS-fwprintf_chk.c): Likewise. (CFLAGS-vwprintf_chk.c): Likewise. (CFLAGS-vfwprintf_chk.c): Likewise. (CFLAGS-fgetws_chk.c): Likewise. (CFLAGS-fgetws_u_chk.c): Likewise. (CFLAGS-read_chk.c): Likewise. (CFLAGS-pread_chk.c): Likewise. (CFLAGS-pread64_chk.c): Likewise. (CFLAGS-recv_chk.c): Likewise. (CFLAGS-recvfrom_chk.c): Likewise. (CFLAGS-tst-longjmp_chk.c): Likewise. (CPPFLAGS-tst-longjmp_chk.c): Likewise. (CFLAGS-tst-longjmp_chk2.c): Likewise. (CPPFLAGS-tst-longjmp_chk2.c): Likewise. (CFLAGS-tst-longjmp_chk3.c): Likewise. (CPPFLAGS-tst-longjmp_chk3.c): Likewise. (CFLAGS-tst-chk1.c): Likewise. (CFLAGS-tst-chk2.c): Likewise. (CFLAGS-tst-chk3.c): Likewise. (CFLAGS-tst-chk4.cc): Likewise. (CFLAGS-tst-chk5.cc): Likewise. (CFLAGS-tst-chk6.cc): Likewise. (CFLAGS-tst-lfschk1.c): Likewise. (CFLAGS-tst-lfschk2.c): Likewise. (CFLAGS-tst-lfschk3.c): Likewise. (CFLAGS-tst-lfschk4.cc): Likewise. (CFLAGS-tst-lfschk5.cc): Likewise. (CFLAGS-tst-lfschk6.cc): Likewise. (CFLAGS-tst-ssp-1.c): Likewise. * dirent/Makefile (CFLAGS-scandir.c): Likewise. (CFLAGS-scandir64.c): Likewise. (CFLAGS-scandir-tail.c): Likewise. (CFLAGS-scandir64-tail.c): Likewise. * elf/Makefile (CPPFLAGS-dl-tunables.c): Likewise. (CFLAGS-dl-tunables.c): Likewise. (CFLAGS-dl-runtime.c): Likewise. (CFLAGS-dl-lookup.c): Likewise. (CFLAGS-dl-iterate-phdr.c): Likewise. (CFLAGS-vismain.c): Likewise. (CFLAGS-tst-linkall-static.c): Likewise. (CFLAGS-tst-linkall-static.c): Likewise. (CPPFLAGS-dl-load.c): Likewise. (CFLAGS-ldconfig.c): Likewise. (CFLAGS-dl-cache.c): Likewise. (CFLAGS-cache.c): Likewise. (CFLAGS-rtld.c): Likewise. (CFLAGS-multiload.c): Likewise. (CFLAGS-filtmod1.c): Likewise. (CFLAGS-tst-align.c): Likewise. (CFLAGS-tst-align2.c): Likewise. (CFLAGS-tst-alignmod.c): Likewise. (CFLAGS-tst-alignmod2.c): Likewise. (CPPFLAGS-tst-execstack.c): Likewise. (CFLAGS-tst-ptrguard1-static.c): Likewise. (CFLAGS-tst-latepthreadmod.c): Likewise. * grp/Makefile (CFLAGS-getgrgid_r.c): Likewise. (CFLAGS-getgrnam_r.c): Likewise. (CFLAGS-getgrent_r.c): Likewise. (CFLAGS-getgrent.c): Likewise. (CFLAGS-fgetgrent.c): Likewise. (CFLAGS-fgetgrent_r.c): Likewise. (CFLAGS-putgrent.c): Likewise. (CFLAGS-initgroups.c): Likewise. (CFLAGS-getgrgid.c): Likewise. * gshadow/Makefile (CFLAGS-getsgent_r.c): Likewise. (CFLAGS-getsgent.c): Likewise. (CFLAGS-fgetsgent.c): Likewise. (CFLAGS-fgetsgent_r.c): Likewise. (CFLAGS-putsgent.c): Likewise. (CFLAGS-getsgnam.c): Likewise. (CFLAGS-getsgnam_r.c): Likewise. * iconv/Makefile (CFLAGS-iconv_prog.c): Likewise. (CFLAGS-iconv_charmap.c): Likewise. (CFLAGS-dummy-repertoire.c): Likewise. (CFLAGS-charmap.c): Likewise. (CFLAGS-linereader.c): Likewise. (CFLAGS-simple-hash.c): Likewise. (CFLAGS-gconv_conf.c): Likewise. (CFLAGS-iconvconfig.c): Likewise. * inet/Makefile (CFLAGS-gethstbyad_r.c): Likewise. (CFLAGS-gethstbyad.c): Likewise. (CFLAGS-gethstbynm_r.c): Likewise. (CFLAGS-gethstbynm.c): Likewise. (CFLAGS-gethstbynm2_r.c): Likewise. (CFLAGS-gethstbynm2.c): Likewise. (CFLAGS-gethstent_r.c): Likewise. (CFLAGS-gethstent.c): Likewise. (CFLAGS-rcmd.c): Likewise. (CFLAGS-getnetbynm_r.c): Likewise. (CFLAGS-getnetbynm.c): Likewise. (CFLAGS-getnetbyad_r.c): Likewise. (CFLAGS-getnetbyad.c): Likewise. (CFLAGS-getnetent_r.c): Likewise. (CFLAGS-getnetent.c): Likewise. (CFLAGS-getaliasent_r.c): Likewise. (CFLAGS-getaliasent.c): Likewise. (CFLAGS-getrpcent_r.c): Likewise. (CFLAGS-getrpcent.c): Likewise. (CFLAGS-getservent_r.c): Likewise. (CFLAGS-getservent.c): Likewise. (CFLAGS-getprtent_r.c): Likewise. (CFLAGS-getprtent.c): Likewise. (CFLAGS-either_ntoh.c): Likewise. (CFLAGS-either_hton.c): Likewise. (CFLAGS-getnetgrent.c): Likewise. (CFLAGS-getnetgrent_r.c): Likewise. (CFLAGS-tst-checks-posix.c): Likewise. (CFLAGS-tst-sockaddr.c): Likewise. * intl/Makefile (CFLAGS-tst-gettext.c): Likewise. (CFLAGS-tst-translit.c): Likewise. (CFLAGS-tst-gettext2.c): Likewise. (CFLAGS-tst-codeset.c): Likewise. (CFLAGS-tst-gettext3.c): Likewise. (CFLAGS-tst-gettext4.c): Likewise. (CFLAGS-tst-gettext5.c): Likewise. (CFLAGS-tst-gettext6.c): Likewise. * io/Makefile (CFLAGS-open.c): Likewise. (CFLAGS-open64.c): Likewise. (CFLAGS-creat.c): Likewise. (CFLAGS-creat64.c): Likewise. (CFLAGS-fcntl.c): Likewise. (CFLAGS-poll.c): Likewise. (CFLAGS-ppoll.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-statfs.c): Likewise. (CFLAGS-fstatfs.c): Likewise. (CFLAGS-statvfs.c): Likewise. (CFLAGS-fstatvfs.c): Likewise. (CFLAGS-fts.c): Likewise. (CFLAGS-fts64.c): Likewise. (CFLAGS-ftw.c): Likewise. (CFLAGS-ftw64.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-posix_fallocate.c): Likewise. (CFLAGS-posix_fallocate64.c): Likewise. (CFLAGS-fallocate.c): Likewise. (CFLAGS-fallocate64.c): Likewise. (CFLAGS-read.c): Likewise. (CFLAGS-write.c): Likewise. (CFLAGS-test-stat.c): Likewise. (CFLAGS-test-lfs.c): Likewise. * libio/Makefile (CFLAGS-fileops.c): Likewise. (CFLAGS-fputc.c): Likewise. (CFLAGS-fputwc.c): Likewise. (CFLAGS-freopen64.c): Likewise. (CFLAGS-freopen.c): Likewise. (CFLAGS-fseek.c): Likewise. (CFLAGS-fseeko64.c): Likewise. (CFLAGS-fseeko.c): Likewise. (CFLAGS-ftello64.c): Likewise. (CFLAGS-ftello.c): Likewise. (CFLAGS-fwide.c): Likewise. (CFLAGS-genops.c): Likewise. (CFLAGS-getc.c): Likewise. (CFLAGS-getchar.c): Likewise. (CFLAGS-getwc.c): Likewise. (CFLAGS-getwchar.c): Likewise. (CFLAGS-iofclose.c): Likewise. (CFLAGS-iofflush.c): Likewise. (CFLAGS-iofgetpos64.c): Likewise. (CFLAGS-iofgetpos.c): Likewise. (CFLAGS-iofgets.c): Likewise. (CFLAGS-iofgetws.c): Likewise. (CFLAGS-iofputs.c): Likewise. (CFLAGS-iofputws.c): Likewise. (CFLAGS-iofread.c): Likewise. (CFLAGS-iofsetpos64.c): Likewise. (CFLAGS-iofsetpos.c): Likewise. (CFLAGS-ioftell.c): Likewise. (CFLAGS-iofwrite.c): Likewise. (CFLAGS-iogetdelim.c): Likewise. (CFLAGS-iogetline.c): Likewise. (CFLAGS-iogets.c): Likewise. (CFLAGS-iogetwline.c): Likewise. (CFLAGS-ioputs.c): Likewise. (CFLAGS-ioseekoff.c): Likewise. (CFLAGS-ioseekpos.c): Likewise. (CFLAGS-iosetbuffer.c): Likewise. (CFLAGS-iosetvbuf.c): Likewise. (CFLAGS-ioungetc.c): Likewise. (CFLAGS-ioungetwc.c): Likewise. (CFLAGS-oldfileops.c): Likewise. (CFLAGS-oldiofclose.c): Likewise. (CFLAGS-oldiofgetpos64.c): Likewise. (CFLAGS-oldiofgetpos.c): Likewise. (CFLAGS-oldiofsetpos64.c): Likewise. (CFLAGS-oldiofsetpos.c): Likewise. (CFLAGS-peekc.c): Likewise. (CFLAGS-putc.c): Likewise. (CFLAGS-putchar.c): Likewise. (CFLAGS-putwc.c): Likewise. (CFLAGS-putwchar.c): Likewise. (CFLAGS-rewind.c): Likewise. (CFLAGS-wfileops.c): Likewise. (CFLAGS-wgenops.c): Likewise. (CFLAGS-oldiofopen.c): Likewise. (CFLAGS-iofopen.c): Likewise. (CFLAGS-iofopen64.c): Likewise. (CFLAGS-oldtmpfile.c): Likewise. (CFLAGS-tst_putwc.c): Likewise. * locale/Makefile (CFLAGS-md5.c): Likewise. (CFLAGS-charmap.c): Likewise. (CFLAGS-locfile.c): Likewise. (CFLAGS-charmap-dir.c): Likewise. * login/Makefile (CFLAGS-grantpt.c): Likewise. (CFLAGS-getpt.c): Likewise. (CFLAGS-pt_chown.c): Likewise. * malloc/Makefile (CFLAGS-mcheck-init.c): Likewise. (CFLAGS-obstack.c): Likewise. * math/Makefile (CFLAGS-test-tgmath3.c): Likewise. (CFLAGS-test-double-vlen4-wrappers.c): Likewise. (CFLAGS-test-double-vlen8-wrappers.c): Likewise. (CFLAGS-test-float-vlen8-wrappers.c): Likewise. (CFLAGS-test-float-vlen16-wrappers.c): Likewise. (CFLAGS-test-tgmath.c): Likewise. (CFLAGS-test-tgmath2.c): Likewise. (CFLAGS-test-tgmath-ret.c): Likewise. (CFLAGS-test-powl.c): Likewise. (CFLAGS-test-snan.c): Likewise. (CFLAGS-test-signgam-finite.c): Likewise. (CFLAGS-test-signgam-finite-c99.c): Likewise. (CFLAGS-test-signgam-finite-c11.c): Likewise. (CFLAGS-test-signgam-uchar.c): Likewise. (CFLAGS-test-signgam-uchar-init.c): Likewise. (CFLAGS-test-signgam-uchar-static.c): Likewise. (CFLAGS-test-signgam-uchar-init-static.c): Likewise. (CFLAGS-test-signgam-uint.c): Likewise. (CFLAGS-test-signgam-uint-init.c): Likewise. (CFLAGS-test-signgam-uint-static.c): Likewise. (CFLAGS-test-signgam-uint-init-static.c): Likewise. (CFLAGS-test-signgam-ullong.c): Likewise. (CFLAGS-test-signgam-ullong-init.c): Likewise. (CFLAGS-test-signgam-ullong-static.c): Likewise. (CFLAGS-test-signgam-ullong-init-static.c): Likewise. (CFLAGS-test-math-cxx11.cc): Likewise. (CFLAGS-test-math-isinff.cc): Likewise. (CFLAGS-test-math-iszero.cc): Likewise. (CFLAGS-test-math-issignaling.cc): Likewise. (CFLAGS-test-math-iscanonical.cc): Likewise. (CFLAGS-test-iszero-excess-precision.c): Likewise. (CFLAGS-test-iseqsig-excess-precision.c): Likewise. (CFLAGS-test-flt-eval-method.c): Likewise. (CFLAGS-test-fe-snans-always-signal.c): Likewise. (CFLAGS-test-finite-macros.c): Likewise. * misc/Makefile (CFLAGS-select.c): Likewise. (CFLAGS-tsearch.c): Likewise. (CFLAGS-lsearch.c): Likewise. (CFLAGS-pselect.c): Likewise. (CFLAGS-readv.c): Likewise. (CFLAGS-writev.c): Likewise. (CFLAGS-preadv.c): Likewise. (CFLAGS-preadv64.c): Likewise. (CFLAGS-pwritev.c): Likewise. (CFLAGS-pwritev64.c): Likewise. (CFLAGS-preadv2.c): Likewise. (CFLAGS-preadv64v2.c): Likewise. (CFLAGS-pwritev2.c): Likewise. (CFLAGS-pwritev64v2.c): Likewise. (CFLAGS-usleep.c): Likewise. (CFLAGS-syslog.c): Likewise. (CFLAGS-error.c): Likewise. (CFLAGS-getpass.c): Likewise. (CFLAGS-mkstemp.c): Likewise. (CFLAGS-mkstemp64.c): Likewise. (CFLAGS-getsysstats.c): Likewise. (CFLAGS-getusershell.c): Likewise. (CFLAGS-err.c): Likewise. (CFLAGS-tst-tsearch.c): Likewise. (CFLAGS-msync.c): Likewise. (CFLAGS-fdatasync.c): Likewise. (CFLAGS-fsync.c): Likewise. * nptl/Makefile (CFLAGS-nptl-init.c): Likewise. (CFLAGS-unwind.c): Likewise. (CFLAGS-unwind-forcedunwind.c): Likewise. (CFLAGS-pthread_cancel.c): Likewise. (CFLAGS-pthread_setcancelstate.c): Likewise. (CFLAGS-pthread_setcanceltype.c): Likewise. (CFLAGS-cancellation.c): Likewise. (CFLAGS-libc-cancellation.c): Likewise. (CFLAGS-pthread_exit.c): Likewise. (CFLAGS-forward.c): Likewise. (CFLAGS-pthread_testcancel.c): Likewise. (CFLAGS-pthread_join.c): Likewise. (CFLAGS-pthread_timedjoin.c): Likewise. (CFLAGS-pthread_once.c): Likewise. (CFLAGS-pthread_cond_wait.c): Likewise. (CFLAGS-sem_wait.c): Likewise. (CFLAGS-sem_timedwait.c): Likewise. (CFLAGS-fcntl.c): Likewise. (CFLAGS-lockf.c): Likewise. (CFLAGS-pread.c): Likewise. (CFLAGS-pread64.c): Likewise. (CFLAGS-pwrite.c): Likewise. (CFLAGS-pwrite64.c): Likewise. (CFLAGS-wait.c): Likewise. (CFLAGS-waitpid.c): Likewise. (CFLAGS-sigwait.c): Likewise. (CFLAGS-msgrcv.c): Likewise. (CFLAGS-msgsnd.c): Likewise. (CFLAGS-tcdrain.c): Likewise. (CFLAGS-open.c): Likewise. (CFLAGS-open64.c): Likewise. (CFLAGS-pause.c): Likewise. (CFLAGS-recv.c): Likewise. (CFLAGS-send.c): Likewise. (CFLAGS-accept.c): Likewise. (CFLAGS-sendto.c): Likewise. (CFLAGS-connect.c): Likewise. (CFLAGS-recvfrom.c): Likewise. (CFLAGS-recvmsg.c): Likewise. (CFLAGS-sendmsg.c): Likewise. (CFLAGS-close.c): Likewise. (CFLAGS-read.c): Likewise. (CFLAGS-write.c): Likewise. (CFLAGS-nanosleep.c): Likewise. (CFLAGS-sigsuspend.c): Likewise. (CFLAGS-msync.c): Likewise. (CFLAGS-fdatasync.c): Likewise. (CFLAGS-fsync.c): Likewise. (CFLAGS-pt-system.c): Likewise. (CFLAGS-tst-cleanup2.c): Likewise. (CFLAGS-tst-cleanupx2.c): Likewise. (CFLAGS-flockfile.c): Likewise. (CFLAGS-ftrylockfile.c): Likewise. (CFLAGS-funlockfile.c): Likewise. (CFLAGS-tst-initializers1.c): Likewise. (CFLAGS-tst-initializers1-c89.c): Likewise. (CFLAGS-tst-initializers1-c99.c): Likewise. (CFLAGS-tst-initializers1-c11.c): Likewise. (CFLAGS-tst-initializers1-gnu89.c): Likewise. (CFLAGS-tst-initializers1-gnu99.c): Likewise. (CFLAGS-tst-initializers1-gnu11.c): Likewise. * nscd/Makefile (CFLAGS-nscd_getpw_r.c): Likewise. (CFLAGS-nscd_getgr_r.c): Likewise. (CFLAGS-nscd_gethst_r.c): Likewise. (CFLAGS-nscd_getai.c): Likewise. (CFLAGS-nscd_initgroups.c): Likewise. * posix/Makefile (CFLAGS-getaddrinfo.c): Likewise. (CFLAGS-pause.c): Likewise. (CFLAGS-pread.c): Likewise. (CFLAGS-pread64.c): Likewise. (CFLAGS-pwrite.c): Likewise. (CFLAGS-pwrite64.c): Likewise. (CFLAGS-sleep.c): Likewise. (CFLAGS-wait.c): Likewise. (CFLAGS-waitid.c): Likewise. (CFLAGS-waitpid.c): Likewise. (CFLAGS-getopt.c): Likewise. (CFLAGS-wordexp.c): Likewise. (CFLAGS-sysconf.c): Likewise. (CFLAGS-pathconf.c): Likewise. (CFLAGS-fpathconf.c): Likewise. (CFLAGS-spawn.c): Likewise. (CFLAGS-spawnp.c): Likewise. (CFLAGS-spawni.c): Likewise. (CFLAGS-glob.c): Likewise. (CFLAGS-glob64.c): Likewise. (CFLAGS-getconf.c): Likewise. (CFLAGS-nanosleep.c): Likewise. * pwd/Makefile (CFLAGS-getpwent_r.c): Likewise. (CFLAGS-getpwent.c): Likewise. (CFLAGS-getpw.c): Likewise. (CFLAGS-fgetpwent_r.c): Likewise. * resolv/Makefile (CFLAGS-res_hconf.c): Likewise. * rt/Makefile (CFLAGS-aio_suspend.c): Likewise. (CFLAGS-mq_timedreceive.c): Likewise. (CFLAGS-mq_timedsend.c): Likewise. (CFLAGS-clock_nanosleep.c): Likewise. (CFLAGS-librt-cancellation.c): Likewise. * shadow/Makefile (CFLAGS-getspent_r.c): Likewise. (CFLAGS-getspent.c): Likewise. (CFLAGS-fgetspent.c): Likewise. (CFLAGS-fgetspent_r.c): Likewise. (CFLAGS-putspent.c): Likewise. (CFLAGS-getspnam.c): Likewise. (CFLAGS-getspnam_r.c): Likewise. * signal/Makefile (CFLAGS-sigpause.c): Likewise. (CFLAGS-sigsuspend.c): Likewise. (CFLAGS-sigtimedwait.c): Likewise. (CFLAGS-sigwait.c): Likewise. (CFLAGS-sigwaitinfo.c): Likewise. (CFLAGS-sigreturn.c): Likewise. * stdio-common/Makefile (CFLAGS-vfprintf.c): Likewise. (CFLAGS-vfwprintf.c): Likewise. (CFLAGS-tmpfile.c): Likewise. (CFLAGS-tmpfile64.c): Likewise. (CFLAGS-tempname.c): Likewise. (CFLAGS-psignal.c): Likewise. (CFLAGS-vprintf.c): Likewise. (CFLAGS-cuserid.c): Likewise. (CFLAGS-errlist.c): Likewise. (CFLAGS-siglist.c): Likewise. (CFLAGS-scanf15.c): Likewise. (CFLAGS-scanf17.c): Likewise. * stdlib/Makefile (CFLAGS-bsearch.c): Likewise. (CFLAGS-msort.c): Likewise. (CFLAGS-qsort.c): Likewise. (CFLAGS-system.c): Likewise. (CFLAGS-fmtmsg.c): Likewise. (CFLAGS-strfmon.c): Likewise. (CFLAGS-strfmon_l.c): Likewise. (CFLAGS-strfromd.c): Likewise. (CFLAGS-strfromf.c): Likewise. (CFLAGS-strfroml.c): Likewise. (CFLAGS-tst-bsearch.c): Likewise. (CFLAGS-tst-qsort.c): Likewise. (CFLAGS-tst-makecontext2.c): Likewise. * sunrpc/Makefile (CFLAGS-xbootparam_prot.c): Likewise. (CFLAGS-xnlm_prot.c): Likewise. (CFLAGS-xrstat.c): Likewise. (CFLAGS-xyppasswd.c): Likewise. (CFLAGS-xklm_prot.c): Likewise. (CFLAGS-xrex.c): Likewise. (CFLAGS-xsm_inter.c): Likewise. (CFLAGS-xmount.c): Likewise. (CFLAGS-xrusers.c): Likewise. (CFLAGS-xspray.c): Likewise. (CFLAGS-xnfs_prot.c): Likewise. (CFLAGS-xrquota.c): Likewise. (CFLAGS-xkey_prot.c): Likewise. (CFLAGS-auth_unix.c): Likewise. (CFLAGS-key_call.c): Likewise. (CFLAGS-pmap_rmt.c): Likewise. (CFLAGS-clnt_perr.c): Likewise. (CFLAGS-openchild.c): Likewise. * sysvipc/Makefile (CFLAGS-msgrcv.c): Likewise. (CFLAGS-msgsnd.c): Likewise. * termios/Makefile (CFLAGS-tcdrain.c): Likewise. * time/Makefile (CFLAGS-tzfile.c): Likewise. (CFLAGS-tzset.c): Likewise. (CFLAGS-getdate.c): Likewise. (CFLAGS-test_time.c): Likewise. (CPPFLAGS-tst-tzname.c): Likewise. * timezone/Makefile (CFLAGS-zdump.c): Likewise. (CFLAGS-zic.c): Likewise. * wcsmbs/Makefile (CFLAGS-wcwidth.c): Likewise. (CFLAGS-wcswidth.c): Likewise. (CFLAGS-wcstol.c): Likewise. (CFLAGS-wcstoul.c): Likewise. (CFLAGS-wcstoll.c): Likewise. (CFLAGS-wcstoull.c): Likewise. (CFLAGS-wcstod.c): Likewise. (CFLAGS-wcstold.c): Likewise. (CFLAGS-wcstof128.c): Likewise. (CFLAGS-wcstof.c): Likewise. (CFLAGS-wcstol_l.c): Likewise. (CFLAGS-wcstoul_l.c): Likewise. (CFLAGS-wcstoll_l.c): Likewise. (CFLAGS-wcstoull_l.c): Likewise. (CFLAGS-wcstod_l.c): Likewise. (CFLAGS-wcstold_l.c): Likewise. (CFLAGS-wcstof128_l.c): Likewise. (CFLAGS-wcstof_l.c): Likewise. (CPPFLAGS-tst-wchar-h.c): Likewise. (CPPFLAGS-wcstold_l.c): Likewise. Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
2017-12-07Add _Float32 function aliases.Joseph Myers1-4/+4
This patch concludes filling out TS 18661-3 support for different types by adding *f32 function aliases of float functions to support _Float32. As with _Float64 and _Float32x, this is supported for all glibc configurations. As with the previous such patches there are some x86 ulps updates because of inline functions present for float but not for _Float32. The patch also has the usual bits/floatn-common.h update, symbol versions, ABI baselines updates, test enablement and documentation. Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT32): Define to 1. * manual/math.texi (Mathematics): Document support for _Float32. * math/Makefile (test-types): Add float32. * math/Versions (GLIBC_2.27): Add _Float32 functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-12-06Support defining strtof32, wcstof32 aliases.Joseph Myers2-0/+34
This patch adds support for defining strtof32, wcstof32, strtof32_l and wcstof32_l functions as aliases of the corresponding float functions when _Float32 support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float32 changes. * stdlib/strtof.c: Include <bits/floatn.h> [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * stdlib/strtof_l.c: Include <bits/floatn.h> [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
2017-12-06Support defining strfromf32 alias.Joseph Myers1-0/+16
This patch adds support for defining strfromf32 as an alias of strfromf when _Float32 support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float32 changes. * stdlib/strfromf.c: Include <bits/floatn.h>. [__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define and later undefine as macro and define as weak alias.
2017-12-06Add _Float64, _Float32x function aliases.Joseph Myers1-0/+5
This patch continues filling out TS 18661-3 support by adding *f64 and *f32x function aliases, supporting _Float64 and _Float32x, as aliases for double functions. These types are supported for all glibc configurations. The API corresponds exactly to that for _Float128 and _Float64x. _Float32 aliases to float functions remain to be added in subsequent patches to complete this process (then there are a few miscellaneous functions in TS 18661-3 to implement that aren't simply versions of existing functions for new types). The patch enables the feature in bits/floatn-common.h, adds symbol versions and documentation with updates to ABI baselines, and arranges for the libm functions for the new types to be tested. As with the _Float64x changes there are some x86 ulps updates because of header inlines not used for the new types (and one other change to the non-multiarch libm-test-ulps, which I suppose comes from using a different compiler version / configuration from when it was last regenerated). Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT64): Define to 1. (__HAVE_FLOAT32X): Likewise. * manual/math.texi (Mathematics): Document support for _Float64 and _Float32x. * math/Makefile (test-types): Add float64 and float32x. * math/Versions (GLIBC_2.27): Add _Float64 and _Float32x functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-12-05Support defining strtof64, strtof32x, wcstof64, wcstof32x aliases.Joseph Myers2-0/+80
This patch adds support for defining strtof64, strtof32x, wcstof64, wcstof32x and the corresponding _l functions as aliases of the corresponding double functions when _Float64 and _Float32x support is enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. * stdlib/strtod.c: Include <bits/floatn.h>. (BUILD_DOUBLE): New macro. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strtof64): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (wcstof64): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strtof32x): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (wcstof32x): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * stdlib/strtod_l.c: Include <bits/floatn.h>. (BUILD_DOUBLE): New macro. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strtof64_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (wcstof64_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strtof32x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [BUILD_DOUBLE && __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (wcstof32x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
2017-12-05Support defining strfromf64, strfromf32x aliases.Joseph Myers1-0/+25
This patch adds support for defining strfromf64 and strfromf32x aliases of strfromd when the corresponding types are enabled. Tested for x86_64; also tested with build-many-glibcs.py in conjunction with other _Float64 / _Float32x changes. * stdlib/strfromd.c: Include <bits/floatn.h>. [__HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64] (strfromf64): Define and later undefine as macro and define as weak alias. [__HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X] (strfromf32x): Likewise.
2017-11-30Fix test case for hr_HR monetary formattingMike FABIAN1-4/+4
* stdlib/tst-strfmon_l.c: Fix testcase. Needed because of [BZ #10580]
2017-11-27Add _Float64x function aliases.Joseph Myers1-0/+5
This patch continues filling out TS 18661-3 support by adding *f64x function aliases on platforms with _Float64x support. (It so happens the set of such platforms is exactly the same as the set of platforms with _Float128 support, although on x86_64, x86 and ia32 the _Float64x format is Intel extended rather than binary128.) The API provided corresponds exactly to that provided for _Float128, mostly coming from TS 18661-3. As these functions always alias those for another type (long double, _Float128 or both), __* function names are not provided, as in other cases of alias types. Given the preparation done in previous patches, this one just enables the feature via Makeconfig and bits/floatn.h, adds symbol versions, and updates documentation and ABI baselines. The symbol versions are present unconditionally as GLIBC_2.27 in the relevant Versions files, as it's OK for those to specify versions for functions that may not be present in some configurations; no additional complexity is needed unless in future some configuration gains support for this type that didn't have such support in 2.27. The Makeconfig additions for ia64 and x86 aren't strictly needed, as those configurations also get float64x-alias-fcts definitions from sysdeps/ieee754/float128/Makeconfig, but still seem appropriate given that _Float64x is not _Float128 for those configurations. A libm-test-ulps update for x86 is included. This is because bits/mathinline.h does not have _Float64x support added and for two functions the use of out-of-line functions results in increased ulps (ifloat64x shares ulps with ildouble / ifloat128 as appropriate). Given that we'd like generally to eliminate bits/mathinline.h optimizations, preferring to have such optimizations in GCC instead, it seems reasonable not to add such support there for new types. GCC support for _FloatN / _FloatNx built-in functions is limited, but has been improved in GCC 8, and at some point I hope the full set of libm built-in functions in GCC, and other optimizations with per-floating-type aspects, will be enabled for all _FloatN / _FloatNx types. Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * sysdeps/ia64/Makeconfig (float64x-alias-fcts): New variable. * sysdeps/ieee754/float128/Makeconfig (float64x-alias-fcts): Likewise. * sysdeps/ieee754/ldbl-128/Makeconfig (float64x-alias-fcts): Likewise. * sysdeps/x86/Makeconfig: New file. * bits/floatn-common.h (__HAVE_FLOAT64X): Remove macro. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * bits/floatn.h (__HAVE_FLOAT64X): New macro. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/ia64/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/ieee754/ldbl-128/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/mips/ieee754/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/powerpc/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/x86/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * manual/math.texi (Mathematics): Document support for _Float64x. * math/Versions (GLIBC_2.27): Add _Float64x functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
2017-11-24Support strfromf64x alias.Joseph Myers1-1/+14
This patch adds support for defining strfromf64x as a function alias (of strfroml or strfromf128, as appropriate) when _Float64x is supported. Tested for x86_64, including in conjunction with _Float64x support patches, and also tested build for other configurations (in conjunction with _Float64x support patches) with build-many-glibcs.py to cover the various different files needing updating to define these aliases. * stdlib/strfroml.c: Always include <stdlib.h>. [__HAVE_FLOAT64X_LONG_DOUBLE] (strfromf64x): Define and later undefine as macro and define as weak alias. * sysdeps/ieee754/float128/strfromf128.c: Include <bits/floatn.h>. [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE]: Include <stdlib.h>. [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strfromf64x): Define and later undefine as macro and define as weak alias.
2017-11-24Support strtof64x, wcstof64x aliases.Joseph Myers1-0/+14
This patch adds support for defining strtof64x, strtof64x_l, wcstof64 and wcstof64x_l function aliases when _Float64x is supported. Tested for x86_64, including in conjunction with _Float64x support patches, and also tested build for other configurations (in conjunction with _Float64x support patches) with build-many-glibcs.py to cover the various different files needing updating to define these aliases. * stdlib/strtold.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/float128/strtof128.c: Include <bits/floatn.h>. [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/float128/strtof128_l.c [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/ldbl-128/strtold_l.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/ldbl-64-128/strtold_l.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/ldbl-96/strtold_l.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
2017-11-24Define __STDC_WANT_IEC_60559_TYPES_EXT__ in tst-strtod-round-skeleton.c.Joseph Myers1-0/+1
The tst-strtod-round-skeleton.c conditionals relating to handling of _Float64x require associated <float.h> macros, which requires __STDC_WANT_IEC_60559_TYPES_EXT__ to be defined before <float.h> is included if _Float64x is supported. This patch adds the necessary definition. Tested for x86_64, including in conjunction with _Float64x support patches. * stdlib/tst-strtod-round-skeleton.c (__STDC_WANT_IEC_60559_TYPES_EXT__): Define before including headers.
2017-11-24Move wcstof128 symbol versions to wcsmbs/Versions.Joseph Myers1-2/+0
This patch moves wcstof128 and wcstof128_l Versions file entries from stdlib/Versions to wcsmbs/Versions, which is a more appropriate place for them. Tested for x86_64, and with build-many-glibcs.py that installed stripped shared libraries are unchanged by the patch. * stdlib/Versions (libc): Move entries for wcstof128 and wcstof128_l to .... * wcsmbs/Versions (libc): ... here. Include <float128-abi.h>.
2017-11-07Handle more _FloatN, _FloatNx types in type-generic strtod tests.Joseph Myers2-12/+91
Continuing the preparation for additional _FloatN / _FloatNx type support, this patch adds support to type-generic strtod tests. GEN_STRTOD_TEST_FOREACH and STRTOD_TEST_FOREACH are made to handle the full set of such types. tst-strtod-round-skeleton.c is updated for those types it can handle without needing changes to the generator (i.e. those types that have already-handled formats). Tested for x86_64. * stdlib/tst-strtod.h (F16): New macro. (F32): Likewise. (F64): Likewise. (F32X): Likewise. (F64X): Likewise. (F128X): Likewise. (IF_FLOAT16): Likewise. (IF_FLOAT32): Likewise. (IF_FLOAT64): Likewise. (IF_FLOAT32X): Likewise. (IF_FLOAT64X): Likewise. (IF_FLOAT128X): Likewise. (GEN_TEST_STRTOD_FOREACH): Conditionally call macros for _Float16, _Float32, _Float64, _Float32x, _Float64x and _Float128x. (STRTOD_TEST_FOREACH): Likewise. * stdlib/tst-strtod-round-skeleton.c (CHOOSE_f32): New macro. (CHOOSE_f64): Likewise. (CHOOSE_f32x): Likewise. (CHOOSE_f64x): Likewise.
2017-11-03Declare strtof, strfromf functions for more _FloatN, _FloatNx types.Joseph Myers1-2/+117
Continuing the preparation for additional _FloatN / _FloatNx type support, this patch arranges for <stdlib.h> to declare strtof and strfromf functions for all such types, similarly to the declarations already present for _Float128. Tested for x86_64. * stdlib/stdlib.h [__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof16): Declare. [__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32): Likewise. [__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64): Likewise. [__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof32x): Likewise. [__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof64x): Likewise. [__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strtof128x): Likewise. [__HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf16): Likewise. [__HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf32): Likewise. [__HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf64): Likewise. [__HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf32x): Likewise. [__HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf64x): Likewise. [__HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)] (strfromf128x): Likewise. [__USE_GNU && __HAVE_FLOAT16] (strtof16_l): Likewise. [__USE_GNU && __HAVE_FLOAT32] (strtof32_l): Likewise. [__USE_GNU && __HAVE_FLOAT64] (strtof64_l): Likewise. [__USE_GNU && __HAVE_FLOAT32X] (strtof32x_l): Likewise. [__USE_GNU && __HAVE_FLOAT64X] (strtof64x_l): Likewise. [__USE_GNU && __HAVE_FLOAT128X] (strtof128x_l): Likewise.
2017-10-17Place monetary symbol in el_GR and el_CY after the amountMike FABIAN1-2/+2
CLDR uses this pattern as well. [BZ #22019] * localedata/locales/el_GR: Set n_cs_precedes to 0. * localedata/locales/el_CY: copy "el_GR" because it is identical. * stdlib/tst-strfmon_l.c: adapt test case.
2017-10-16Move some float128 symbol version definitions.Joseph Myers1-0/+10
With support for _Float128 functions on platforms where that type has the same ABI as long double, as well as on platforms where it is ABI-distinct, those functions will need to be exported from glibc's shared libraries at appropriate symbol versions in each case. This patch avoids duplication of lists of symbols to export by moving the symbols other than __* to math/Versions and stdlib/Versions. There, they are conditional on <float128-abi.h> defining FLOAT128_VERSION and a default version of that header is added that does not define that macro. Enabling the float128 function aliases will then include adding a sysdeps/ieee754/ldbl-128/float128-abi.h that defines FLOAT128_VERSION to GLIBC_2.27. Symbols __* remain in sysdeps/ieee754/float128/Versions; those symbols should be present only once per floating-point format, not once per type. Note that if any platforms currently lacking support for a type with binary128 format get glibc support for such a type in future (whether only as _Float128, or also as a new long double format), and new libm functions (present for all types) have been added by then, additional macros will be needed to allow such functions to get a version of the form "GLIBC_2.28 if the platform had _Float128 support by then, or the later version at which that platform had _Float128 support added". This is not however a preexisting condition, but would have applied equally to the existing support for _Float128 as an ABI-distinct type. New all-type libm functions should just be added to the appropriate symbol version (currently GLIBC_2.27) for all types, with such special-case handling for _Float128 versions (and _Float64x as well in future) waiting until someone actually wants to add support for _Float128 to an existing platform after a release in which that platform and a post-2.26 libm function had support but that platform lacked _Float128 support. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. Also tested in conjunction with the remaining changes to enable float128 aliases. * sysdeps/generic/float128-abi.h: New file. * sysdeps/ieee754/float128/Versions (FLOAT128_VERSION): Move non-__prefixed symbols to .... * math/Versions: ... here. Include <float128-abi.h>. * stdlib/Versions ... and here. Include <float128-abi.h>
2017-10-16Support strtof128 etc. aliases.Joseph Myers1-0/+16
This patch adds support for building strtof128, wcstof128, strtof128_l and wcstof128_l as aliases, in the case of __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. Also tested together with changes to enable float128 aliases. * stdlib/strtold.c: Include <bits/floatn.h> [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/ldbl-128/strtold_l.c [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR]. * sysdeps/ieee754/ldbl-64-128/strtold_l.c: Include <bits/floatn.h>. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128_l): Define and later undefine as macro. Define as weak alias if [!USE_WIDE_CHAR]. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l): Define and later undefine as macro. Define as weak alias if [USE_WIDE_CHAR].
2017-10-13Support strfromf128 alias.Joseph Myers1-0/+12
This patch adds support for building strfromf128 as an alias of strfroml, in the case of __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128. Tested with build-many-glibcs.py that installed stripped shared libraries are unchanged by this patch. Also tested together with changes to enable float128 aliases. * stdlib/strfroml.c: Include <bits/floatn.h>. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strfromf128): Define before include of <stdlib.h> and undefine afterwards, then define as weak alias.
2017-10-05abort: Do not flush stdio streams [BZ #15436]Florian Weimer1-24/+5
2017-10-01Hide internal __new_exitfn function [BZ #18822]H.J. Lu1-2/+2
Hide internal __new_exitfn function to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * stdlib/exit.h (__new_exitfn): Add attribute_hidden.
2017-10-01Mark internal gmp functions with attribute_hidden [BZ #18822]H.J. Lu1-4/+8
Mark internal gmp functions with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. [BZ #18822] * include/gmp.h: Declare internal functions only if _ISOMAC is undefined. (__mpn_extract_double): Add attribute_hidden. (__mpn_extract_long_double): Likewise. (__mpn_extract_float128): Likewise. (__mpn_construct_float): Likewise. (__mpn_construct_double): Likewise. (__mpn_construct_long_double): Likewise. (__mpn_construct_float128): Likewise. (mpn_add_1): Likewise. (mpn_addmul_1): Likewise. (mpn_add_n): Likewise. (mpn_cmp): Likewise. (mpn_divrem): Likewise. (mpn_lshift): Likewise. (mpn_mul): Likewise. (mpn_mul_1): Likewise. (mpn_rshift): Likewise. (mpn_sub_1): Likewise. (mpn_submul_1): Likewise. (mpn_sub_n): Likewise.
2017-10-01Mark internal stdlib functions with attribute_hidden [BZ #18822]H.J. Lu1-0/+1
Mark internal stdlib functions with attribute_hidden to allow direct access within libc.so and libc.a without using GOT nor PLT. __realpath is hidden with libc_hidden_proto and libc_hidden_def since the exported realpath is an alias of __realpath. [BZ #18822] * include/stdlib.h (__random): Add attribute_hidden. (__random_r): Likewise. (__srandom_r): Likewise. (__initstate_r): Likewise. (__setstate_r): Likewise. (__erand48_r): Likewise. (__nrand48_r): Likewise. (__jrand48_r): Likewise. (__srand48_r): Likewise. (__seed48_r): Likewise. (__lcong48_r): Likewise. (__drand48_iterate): Likewise. (__setenv): Likewise. (__unsetenv): Likewise. (__clearenv): Likewise. (__ptsname_r): Likewise. (__posix_openpt): Likewise. (__add_to_environ): Likewise. (__realpath): Add libc_hidden_proto. (__ecvt_r): Likewise. (__fcvt_r): Likewise. (__qecvt_r): Likewise. (__qfcvt_r): Likewise. * misc/efgcvt_r.c (cvt_symbol_1): Add libc_hidden_def (local). * stdlib/canonicalize.c (__realpath): Add libc_hidden_def.
2017-09-26Mark __dso_handle as hidden [BZ #18822]H.J. Lu3-15/+5
Since __dso_handle is always defined by either crtbegin.o from GCC or dso_handle.c, it should be marked as hidden and be passed directly. [BZ #18822] * dlfcn/modatexit.c (foo): Remove __dso_handle check. * dlfcn/modcxaatexit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. * dlfcn/tstatexit.c (__dso_handle): Removed. (main): Don't check __dso_handle. * dlfcn/tstcxaatexit.c (__dso_handle): Removed. (main): Don't check __dso_handle. * include/dso_handle.h: New file. * malloc/mtrace.c: Include <dso_handle.h>. (mtrace): Pass __dso_handle directly. * nptl/pthread_atfork.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (__pthread_atfork): Pass __dso_handle directly. * nptl/tst-atfork2mod.c: Include <dso_handle.h>. (__dso_handle): Removed. * posix/wordexp-test.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (__app_register_atfork): Pass __dso_handle directly. * stdlib/at_quick_exit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (at_quick_exit): Pass __dso_handle directly. * stdlib/atexit.c: Include <dso_handle.h>. (__dso_handle): Remove declaration. (atexit): Pass __dso_handle directly. * stdlib/tst-tls-atexit-lib.c: Include <dso_handle.h>. (__dso_handle): Removed.
2017-09-25Reduce total memory required to create all threads to 128MiB. This fixesPaul Pluzhnikov1-0/+5
intermittent failure in stdlib/test-{atexit,at_quick_exit,...} tests (Bug 22207).
2017-09-21Fix BZ# 22180.Paul Pluzhnikov4-4/+171
POSIX requires that dlclose() and exit() be thread safe, therefore you can have one thread in the middle of dlclose() and another thread executing exit() without causing any undefined behaviour on the part of the implementation. The existing implementation had a flaw that exit() exit handler processing did not consider a concurrent dlclose() and would not mark already run exit handlers using the ef_free flavour. The consequence of this is that a concurrent exit() with dlclose() will run all the exit handlers that dlclose() had not yet run, but then will block on the loader lock. The concurrent dlclose() will continue to run all the exit handlers again (twice) in violation of the Itanium C++ ABI requirements for __cxa_atexit(). This commit fixes this by having exit() mark all handlers with ef_free to ensure that concurrent dlclose() won't re-run registered exit handlers that have already run.
2017-09-20Implement xdlopen, xdlsym and xdlclose routines which terminate testPaul Pluzhnikov1-23/+7
program with appropriate message if the corresponding dlfcn.h routine returns an error. Use them in stdlib/tst-tls-atexit.c
2017-09-20Oops. stdlib/test-atexit-race-common.c should have been part of ↵Paul Pluzhnikov1-0/+69
26e70aec7028feeb196744eb97cd2dff3670b7aa
2017-09-20Fix BZ 14333Paul Pluzhnikov10-39/+263
2017-09-012017-09-01 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov1-4/+4
* stdlib/tst-atexit-common.c (crumbs): Ensure correct size.
2017-09-012017-09-01 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov1-16/+23
* stdlib/tst-atexit-common.c (do_test): Test support for at least 32 atexit handlers.
2017-08-31stdlib: Remove internal_function attributeFlorian Weimer1-3/+1
2017-08-292017-08-29 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov1-4/+46
* stdlib/tst-atexit-common.c (do_test): Test handler inheritance by child.
2017-08-272017-08-27 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov6-1/+188
* stdlib/Makefile (tst-atexit, tst-at_quick_exit): New tests. (tst-cxa_atexit, tst-on_exit): Likewise. * stdlib/Makefile (tests): Add tst-atexit, tst-at_quick_exit, tst-cxa_atexit, and tst-on_exit. * stdlib/tst-atexit-common.c: New file. * stdlib/tst-atexit.c: New file. * stdlib/tst-at_quick_exit.c: New file. * stdlib/tst-cxa_atexit.c: New file. * stdlib/tst-on_exit.c: New file.
2017-08-22Hide internal printf functions [BZ #18822/21986]H.J. Lu1-8/+1
Hide internal printf functions to allow direct access within libc.so and libc.a without using GOT nor PLT. Since __guess_grouping has been changed to take 2 arguments by commit a1d84548c8aa7023cd039c85f81b831eef6d4a4c Author: Ulrich Drepper <drepper@redhat.com> Date: Fri Feb 11 18:50:36 2000 +0000 the third argument passed to __guess_grouping is removed. [BZ #18822] [BZ #21986] * include/printf.h (__printf_fphex): Add attribute_hidden. (__guess_grouping): New prototype. * stdio-common/printf_fp.c (__guess_grouping): Removed. * stdio-common/reg-printf.c (__register_printf_specifier): Add libc_hidden_proto and libc_hidden_def. * stdlib/strfmon_l.c (__guess_grouping): Removed. (__vstrfmon_l): Remove the third argument passed to __guess_grouping.
2017-08-13Remove internal_function attribute from string-to-float functionsFlorian Weimer1-1/+0
These are called across DSO boundaries and should therefore use the standard calling convention.
2017-08-12Adapt test case data to the changes in the thousands separatorsMike FABIAN3-10/+10
[BZ #20756] * localedata/tst-langinfo.sh: Adapt test case data. * stdlib/tst-strfmon_l.c: Likewise. * stdlib/tst-strtod4.c: Likewise. * stdlib/tst-strtod5i.c: Likewise.
2017-08-10Fix stdlib/tst-strfmon_l.c test case to agree with the changes in Indian ↵Mike FABIAN2-11/+11
monetary formatting The test cases should expose non-standard grouping and the trailing space after the currency sign. After the changes to the Indian monetary formatting, the Indian formatting still shows the non-standard grouping. To test the trailing space after the currency sign I chose the hr_HR locale. See: commit 82b3124268bec0609b337dd993e771c93e44cbf2 Author: Akhilesh Kumar <akhilesh.k@samsung.com> Remove redundant data for LC_MONETARY for Indian locales
2017-08-07Remove __long_double_t.Joseph Myers1-1/+1
sys/cdefs.h has a macro __long_double_t used in two places in glibc. long double is a standard part of C since C89; there is no need for such an alias for it. This patch removes that macro and uses long double directly everywhere. As an implementation-namespace, undocumented symbol, it should not be considered part of the API for users, and codesearch.debian.net shows no sign of it being used outside glibc in a way that would break with this patch. Tested for x86_64. * misc/sys/cdefs.h (__long_double_t): Remove. * stdio-common/printf_fp.c (__printf_fp_l): Use long double instead of __long_double_t, * stdlib/strfmon_l.c (__vstrfmon_l): Likewise.
2017-08-07Fix missing redirects in testsuite targetsAndreas Schwab1-3/+3
2017-08-03Fix the return type of the getentropy stubAurelien Jarno1-1/+1
The return type of the getentropy stub is wrongly defined as ssize_t, while both the <sys/random.h> header and the Linux implementation define it as int. This patch fixes that. Changelog: * stdlib/getentropy.c (getentropy): Change return type to int.
2017-06-22Provide an additional macro expansion for F128 in stdlib/tst-strtod.hGabriel F. T. Gomes1-1/+5
The macro F128 in stdlib/tst-strtod.h is defined to provide the literal suffix for _Float128 constants. It uses the macro __f128 (), which is defined in bits/floatn.h to provide the correct literal suffix depending on what is provided by the compiler. However, F128 was not being expanded and only worked correctly, when compiling with GCC 7 (or greater), since F128 is the literal suffix itself. This patch adds an additional macro expansion so that the macro F128 expands to the correct literal suffix on older compilers. * stdlib/tst-strtod.h (MMFUNC): New macro to provide an addition macro expansion. (GEN_TEST_STRTOD_FOREACH): Use MMFUNC for _Float128.
2017-06-20Use locale_t, not __locale_t, throughout glibcZack Weinberg11-24/+24
<locale.h> is specified to define locale_t in POSIX.1-2008, and so are all of the headers that define functions that take locale_t arguments. Under _GNU_SOURCE, the additional headers that define such functions have also always defined locale_t. Therefore, there is no need to use __locale_t in public function prototypes, nor in any internal code. * ctype/ctype-c99_l.c, ctype/ctype.h, ctype/ctype_l.c * include/monetary.h, include/stdlib.h, include/time.h * include/wchar.h, locale/duplocale.c, locale/freelocale.c * locale/global-locale.c, locale/langinfo.h, locale/locale.h * locale/localeinfo.h, locale/newlocale.c * locale/nl_langinfo_l.c, locale/uselocale.c * localedata/bug-usesetlocale.c, localedata/tst-xlocale2.c * stdio-common/vfscanf.c, stdlib/monetary.h, stdlib/stdlib.h * stdlib/strfmon_l.c, stdlib/strtod_l.c, stdlib/strtof_l.c * stdlib/strtol.c, stdlib/strtol_l.c, stdlib/strtold_l.c * stdlib/strtoll_l.c, stdlib/strtoul_l.c, stdlib/strtoull_l.c * string/strcasecmp.c, string/strcoll_l.c, string/string.h * string/strings.h, string/strncase.c, string/strxfrm_l.c * sysdeps/ieee754/float128/strtof128_l.c * sysdeps/ieee754/float128/wcstof128.c * sysdeps/ieee754/float128/wcstof128_l.c * sysdeps/ieee754/ldbl-128ibm/strtold_l.c * sysdeps/ieee754/ldbl-64-128/strtold_l.c * sysdeps/ieee754/ldbl-opt/nldbl-compat.c * sysdeps/ieee754/ldbl-opt/nldbl-strfmon_l.c * sysdeps/ieee754/ldbl-opt/nldbl-strtold_l.c * sysdeps/ieee754/ldbl-opt/nldbl-wcstold_l.c * sysdeps/powerpc/powerpc32/power7/strcasecmp.S * sysdeps/powerpc/powerpc64/power7/strcasecmp.S * sysdeps/x86_64/strcasecmp_l-nonascii.c * sysdeps/x86_64/strncase_l-nonascii.c, time/strftime_l.c * time/strptime_l.c, time/time.h, wcsmbs/mbsrtowcs_l.c * wcsmbs/wchar.h, wcsmbs/wcscasecmp.c, wcsmbs/wcsncase.c * wcsmbs/wcstod.c, wcsmbs/wcstod_l.c, wcsmbs/wcstof.c * wcsmbs/wcstof_l.c, wcsmbs/wcstol_l.c, wcsmbs/wcstold.c * wcsmbs/wcstold_l.c, wcsmbs/wcstoll_l.c, wcsmbs/wcstoul_l.c * wcsmbs/wcstoull_l.c, wctype/iswctype_l.c * wctype/towctrans_l.c, wctype/wcfuncs_l.c * wctype/wctrans_l.c, wctype/wctype.h, wctype/wctype_l.c: Change all uses of __locale_t to locale_t.
2017-06-20Rename xlocale.h to bits/types/__locale_t.h.Zack Weinberg9-30/+13
xlocale.h is already a single-type micro-header, defining struct __locale_struct and the typedefs __locale_t and locale_t. This patch brings it into the bits/types/ scheme: there are now bits/types/__locale_t.h which defines only __locale_struct and __locale_t, and bits/types/locale_t.h which defines locale_t as well as the other two. None of *our* headers need __locale_t.h, but it appears to me that libstdc++ could make use of it. There are a lot of external uses of xlocale.h, but all the uses I checked had an autoconf test or equivalent for its existence. It has never been available from other C libraries, and it has always contained a comment reading "This file is not standardized, don't rely on it, it can go away without warning" so I think dropping it is pretty safe. I also took the opportunity to clean up comments in various public header files that still talk about the *_l interfaces as though they were completely nonstandard. There are a few of them, notably the strtoX_l and wcstoX_l families, that haven't been standardized, but the bulk are in POSIX.1-2008. * locale/xlocale.h: Rename to... * locale/bits/types/__locale_t.h: ...here. Adjust commentary. Only define struct __locale_struct and __locale_t, not locale_t. * locale/bits/types/locale_t.h: New file; define locale_t here. * locale/Makefile (headers): Update to match. * include/xlocale.h: Delete wrapper. * include/bits/types/__locale_t.h: New wrapper. * include/bits/types/locale_t.h: New wrapper. * ctype/ctype.h, include/printf.h, include/time.h * locale/langinfo.h, locale/locale.h, stdlib/monetary.h * stdlib/stdlib.h, string/string.h, string/strings.h, time/time.h * wcsmbs/wchar.h, wctype/wctype.h: Use bits/types/locale_t.h. Correct outdated comments regarding the standardization status of the functions that take locale_t arguments. * stdlib/strtod_l.c, stdlib/strtof_l.c, stdlib/strtol_l.c * stdlib/strtold_l.c, stdlib/strtoul_l.c, stdlib/strtoull_l.c * sysdeps/ieee754/ldbl-128ibm/strtold_l.c * sysdeps/ieee754/ldbl-64-128/strtold_l.c * wcsmbs/wcstod.c, wcsmbs/wcstod_l.c, wcsmbs/wcstof.c * wcsmbs/wcstof_l.c, wcsmbs/wcstold.c, wcsmbs/wcstold_l.c: Don't include xlocale.h. If necessary, include locale.h instead. * stdlib/strtold_l.c: Unconditionally include wchar.h.
2017-06-14Remove __need macros from errno.h (__need_Emath, __need_error_t).Zack Weinberg1-37/+25
This is fairly complicated, not because the users of __need_Emath and __need_error_t have complicated requirements, but because the core changes had a lot of fallout. __need_error_t exists for gnulib compatibility in argz.h and argp.h. error_t itself is a Hurdism, an enum containing all the E-constants, so you can do 'p (error_t) errno' in gdb and get a symbolic value. argz.h and argp.h use it for function return values, and they want to fall back to 'int' when that's not available. There is no reason why these nonstandard headers cannot just go ahead and include all of errno.h; so we do that. __need_Emath is defined only by .S files; what they _really_ need is for errno.h to avoid declaring anything other than the E-constants (e.g. 'extern int __errno_location(void);' is a syntax error in assembly language). This is replaced with a check for __ASSEMBLER__ in errno.h, plus a carefully documented requirement for bits/errno.h not to define anything other than macros. That in turn has the consequence that bits/errno.h must not define errno - fortunately, all live ports use the same definition of errno, so I've moved it to errno.h. The Hurd bits/errno.h must also take care not to define error_t when __ASSEMBLER__ is defined, which involves repeating all of the definitions twice, but it's a generated file so that's okay. * stdlib/errno.h: Remove __need_Emath and __need_error_t logic. Reorganize file. Declare errno here. When __ASSEMBLER__ is defined, don't declare anything other than the E-constants. * include/errno.h: Change conditional for exposing internal declarations to (not _ISOMAC and not __ASSEMBLER__). * bits/errno.h: Remove logic for __need_Emath. Document requirements for a port-specific bits/errno.h. * sysdeps/unix/sysv/linux/bits/errno.h * sysdeps/unix/sysv/linux/alpha/bits/errno.h * sysdeps/unix/sysv/linux/hppa/bits/errno.h * sysdeps/unix/sysv/linux/mips/bits/errno.h * sysdeps/unix/sysv/linux/sparc/bits/errno.h: Add multiple-include guard and check against improper inclusion. Remove __need_Emath logic. Don't declare errno here. Ensure all constants are defined as simple integer literals. Consistent formatting. * sysdeps/mach/hurd/errnos.awk: Likewise. Only define error_t and enum __error_t_codes if __ASSEMBLER__ is not defined. * sysdeps/mach/hurd/bits/errno.h: Regenerate. * argp/argp.h, string/argz.h: Don't define __need_error_t before including errno.h. * sysdeps/i386/i686/fpu/multiarch/s_cosf-sse2.S * sysdeps/i386/i686/fpu/multiarch/s_sincosf-sse2.S * sysdeps/i386/i686/fpu/multiarch/s_sinf-sse2.S * sysdeps/x86_64/fpu/s_cosf.S * sysdeps/x86_64/fpu/s_sincosf.S * sysdeps/x86_64/fpu/s_sinf.S: Just include errno.h; don't define __need_Emath or include bits/errno.h directly.
2017-06-12float128: Add strtof128, wcstof128, and related functions.Paul E. Murphy5-29/+59
The implementations are contained with sysdeps/ieee754/float128 as they are only built when _Float128 is enabled within libc/m. * include/gmp.h (__mpn_construct_float128): New declaration. * include/stdlib.h: Include bits/floatn.h for _Float128 tests. (__strtof128_l): New declaration. (__strtof128_nan): Likewise. (__wcstof128_nan): Likewise. (__strtof128_internal): Likewise. (____strtof128_l_internal): Likewise. * include/wchar.h: Include bits/floatn.h for _Float128 tests. (__wcstof128_l): New declaration. (__wcstof128_internal): Likewise. * stdlib/Makefile (bug-strtod2): Link libm too. * stdlib/stdlib.h (strtof128): New declaration. (strtof128_l): Likewise. * stdlib/tst-strtod-nan-locale-main.c: Updated to use tst-strtod.h macros to ensure float128 gets tested too. * stdlib/tst-strtod-round-skeleton.c (CHOOSE_f128): New macro. * stdlib/tst-strtod.h: Include bits/floatn.h for _Float128 tests. (IF_FLOAT128): New macro. (GEN_TEST_STRTOD): Update to optionally include _Float128 in the tests. (STRTOD_TEST_FOREACH): Likewise. * sysdeps/ieee754/float128/Makefile: Insert new strtof128 and wcstof128 functions into libc. * sysdeps/ieee754/float128/Versions: Add exports for the above new functions. * sysdeps/ieee754/float128/mpn2float128.c: New file. * sysdeps/ieee754/float128/strtod_nan_float128.h: New file. * sysdeps/ieee754/float128/strtof128.c: New file. * sysdeps/ieee754/float128/strtof128_l.c: New file. * sysdeps/ieee754/float128/strtof128_nan.c: New file. * sysdeps/ieee754/float128/wcstof128.c: New file. * sysdeps/ieee754/float128/wcstof128_l.c: New file. * sysdeps/ieee754/float128/wcstof128_nan.c: New fike. * wcsmbs/Makefile: (CFLAGS-wcstof128.c): Append strtox-CFLAGS. (CFLAGS-wcstof128_l): Likewise. * wcsmbs/wchar.h: Include bits/floatn.h for _Float128 tests. (wcstof128): New declaration. (wcstof128_l): Likewise.
2017-06-10Correct an outdated comment in stdlib/errno.h.Zack Weinberg1-1/+1