about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* argp: Do not override GCC keywords with macros [BZ #16907]Florian Weimer2016-08-183-55/+14
| | | | | | | | | | | glibc provides fallback definitions already. It is not necessary to suppress warnings for unknown attributes because GCC does this automatically for system headers. This commit does not sync with gnulib because gnulib has started to use _GL_* macros in the header file, which are arguably in the gnulib implementation space and not suitable for an installed glibc header file.
* ldbl-128: Remove unused sqrtl declaration in e_asinl.cPaul E. Murphy2016-08-172-1/+5
| | | | | This did not alter compilation for s390x and aarch64 targets.
* Support for type-generic libm function implementations libmPaul E. Murphy2016-08-1733-373/+441
| | | | | | | | | | | | | | | | | | | | | | | This defines a new classes of libm objects. The <func>_template.c file which is used in conjunction with the new makefile hooks to derive variants for each type supported by the target machine. The headers math-type-macros-TYPE.h are used to supply macros to a common implementation of a function in a file named FUNC_template.c and glued togethor via a generated file matching existing naming in the build directory. This has the properties of preserving the existing override mechanism and not requiring any arcane build system twiddling. Likewise, it enables machines to override these files without any additional work. I have verified the built objects for ppc64, x86_64, alpha, arm, and m68k do not change in any meaningful way with these changes using the Fedora cross toolchains. I have verified the x86_64 and ppc64 changes still run.
* nptl/tst-once5: Reduce time to expected failureFlorian Weimer2016-08-172-0/+7
|
* Do not override objects in libc.a in other static libraries [BZ #20452]Florian Weimer2016-08-1714-1/+50
| | | | | With this change, we no longer add sysdep.o and similar objects which are present in libc.a to other static libraries.
* Fix soft-fp extended.h unpacking (GCC bug 77265).Joseph Myers2016-08-162-0/+10
| | | | | | | | | | | | | | | | | | | | | | | soft-fp unpacking for x86 "extended" fails to clear the implicit mantissa high bit that is explicit in that format, resulting in problems for operations that expect this bit to be clear in raw unpacked values. Specifically, the code for this format is used only for conversions to and from TFmode (__float128) in libgcc, where this issue results in GCC bug 77265, extension of long double infinity to __float128 wrongly produces a NaN. This patch fixes this by always masking out the implicit bit on unpacking, so that the results of unpacking meet the expectations of the rest of the soft-fp code for a normal IEEE format. Tested for x86_64 in libgcc in conjunction with a GCC testcase for this issue (this code isn't used in glibc, only in libgcc). * soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_E): Mask implicit bit out of unpacked value. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_EP): Likewise.
* Add fesetexcept: sparc.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds a SPARC version of fesetexcept. Untested. * sysdeps/sparc/fpu/fesetexcept.c: New file.
* Add fesetexcept: sh.Joseph Myers2016-08-162-0/+34
| | | | | | This patch adds an SH version of fesetexcept. Untested. * sysdeps/sh/sh4/fpu/fesetexcept.c: New file.
* Add fesetexcept: s390.Joseph Myers2016-08-162-0/+35
| | | | | | | This patch adds an S/390 version of fesetexcept. Tested and corrected by Stefan Liebler. * sysdeps/s390/fpu/fesetexcept.c: New file.
* Add fesetexcept: powerpc.Joseph Myers2016-08-164-0/+111
| | | | | | | | This patch adds PowerPC versions of fesetexcept. * sysdeps/powerpc/fpu/fesetexcept.c: New file. * sysdeps/powerpc/nofpu/fesetexcept.c: Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c: Likewise.
* Add fesetexcept: mips.Joseph Myers2016-08-162-0/+34
| | | | | | This patch adds a MIPS version of fesetexcept. * sysdeps/mips/fpu/fesetexcept.c: New file.
* Add fesetexcept: m68k.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an M68K version of fesetexcept. Untested. * sysdeps/m68k/fpu/fesetexcept.c: New file.
* Add fesetexcept: ia64.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an IA64 version of fesetexcept. Untested. * sysdeps/ia64/fpu/fesetexcept.c: New file.
* Add fesetexcept: hppa.Joseph Myers2016-08-162-0/+37
| | | | | | This patch adds an HPPA version of fesetexcept. Untested. * sysdeps/hppa/fpu/fesetexcept.c: New file.
* Add fesetexcept: arm.Joseph Myers2016-08-162-0/+40
| | | | | | This patch adds an ARM version of fesetexcept. * sysdeps/arm/fesetexcept.c: New file.
* Add fesetexcept: alpha.Joseph Myers2016-08-162-0/+33
| | | | | | This patch adds an Alpha version of fesetexcept. Untested. * sysdeps/alpha/fpu/fesetexcept.c: New file.
* Add fesetexcept: aarch64.Joseph Myers2016-08-162-0/+36
| | | | | | This patch adds an AArch64 version of fesetexcept. Untested. * sysdeps/aarch64/fpu/fesetexcept.c: New file.
* Add fesetexcept.Joseph Myers2016-08-1638-3/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 defines an fesetexcept function for setting floating-point exception flags without the side-effect of causing enabled traps to be taken. This patch series implements this function for glibc. The present patch adds the fallback stub implementation, x86 and x86_64 implementations, documentation, tests and ABI baseline updates. The remaining patches, some of them untested, add implementations for other architectures. The implementations generally follow those of the fesetexceptflag function. As for fesetexceptflag, the approach taken for architectures where setting flags causes enabled traps to be taken is to set the flags (and potentially cause traps) rather than refusing to set the flags and returning an error. Since ISO C and TS 18661 provide no way to enable traps, this is formally in accordance with the standards. The NEWS entry should be considered a placeholder, since this patch series is intended to be followed by further such series adding other TS 18661-1 features, so that the NEWS entry would end up looking more like * New <fenv.h> features from TS 18661-1:2014 are added to libm: the fesetexcept, fetestexceptflag, fegetmode and fesetmode functions, the femode_t type and the FE_DFL_MODE macro. with hopefully more such entries for other features, rather than having an entry for a single function in the end. I believe we have consensus for adding TS 18661-1 interfaces as per <https://sourceware.org/ml/libc-alpha/2016-06/msg00421.html>. Tested for x86_64, x86, mips64 (hard float, and soft float to test the fallback version), arm (hard float) and powerpc (hard float, soft float and e500). * math/fesetexcept.c: New file. * sysdeps/i386/fpu/fesetexcept.c: Likewise. * sysdeps/x86_64/fpu/fesetexcept.c: Likewise. * math/fenv.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. [__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetexcept): New function declaration. * manual/arith.texi (fesetexcept): Document function. * math/Versions (fesetexcept): New libm symbol at version GLIBC_2.25. * math/Makefile (libm-support): Add fesetexcept. (tests): Add test-fesetexcept and test-fesetexcept-traps. * math/test-fesetexcept.c: New file. * math/test-fesetexcept-traps.c: Likewise. * sysdeps/nacl/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.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/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
* Add CVE-2016-6323 missing from NEWS entryFlorian Weimer2016-08-161-1/+1
|
* Add NEWS entry for CVE-2016-6323Florian Weimer2016-08-162-1/+6
|
* nptl/tst-tls3-malloc: Force freeing of thread stacksFlorian Weimer2016-08-163-1/+21
| | | | | | | | It turns out that due to the reduced stack size in tst-tls3 and the (fixed) default stack cache size, allocated TLS variables are never freed, so the test coverage for tst-tls3-malloc is less than complete. This change increases the thread stack size for tst-tls3-malloc only, to make sure thread stacks and TLS variables are freed.
* arm: mark __startcontext as .cantunwind (bug 20435)Andreas Schwab2016-08-152-0/+13
| | | | | __startcontext marks the bottom of the call stack of the contexts created by makecontext.
* locales: et_EE: locale has wrong {p,n}_cs_precedes value [BZ #20459]Märt Põder2016-08-152-2/+9
| | | | | | | | According to "Requirements of information technology in Estonian language and cultural environment" the monetary symbol should be written after the amount number: https://www.evs.ee/products/evs-8-2008
* Add comment from sysdeps/powerpc/fpu/fraiseexcpt.c to fsetexcptflg.c.Joseph Myers2016-08-122-0/+4
| | | | | * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add comment from fraiseexcpt.c.
* Fix test-fexcept when "inexact" implicitly raised.Joseph Myers2016-08-122-2/+37
| | | | | | | | | | | | | | | | | | ISO C allows feraiseexcept to raise "inexact", in addition to the requested exceptions, when requested to raise "overflow" or "underflow". Testing on ARM and PowerPC e500 (where glibc's feraiseexcept has this property) showed that the new test-fexcept test failed to allow for this; this patch fixes it, by wrapping feraiseexcept to clear FE_INEXACT if implicitly raised and not raised before the call. (It would also be possible to do this with fesetexcept, which always affects exactly the requested flags, but this patch avoids making this fix depend on the fesetexcept changes.) Tested for x86_64, x86, arm and e500. * math/test-fexcept.c (feraiseexcept_exact): New function. (test_set): Call feraiseexcept_exact instead of feraiseexcept. (test_except): Likewise.
* Add missing reference to bug 20452Florian Weimer2016-08-111-0/+1
|
* Fix powerpc fesetexceptflag clearing FE_INVALID (bug 20455).Joseph Myers2016-08-102-1/+9
| | | | | | | | | | | | | | | | As shown by the test math/test-fexcept, the powerpc fesetexceptflag implementation fails to clear a previously set FE_INVALID flag, when that flag is clear in the saved exceptions and FE_INVALID is included in the mask of flags to restore, because it fails to mask out the sub-exceptions of FE_INVALID from the FPSCR state. This patch fixes the masking logic accordingly. Tested for powerpc. [BZ #20455] * sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Mask out all FE_INVALID sub-exceptions from FPSCR when FE_INVALID specified to be restored.
* Add tests for fegetexceptflag, fesetexceptflag.Joseph Myers2016-08-106-1/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that there was no meaningful test coverage for fegetexceptflag and fesetexceptflag (one test ensures that calls to them compile and link, but nothing to verify they work correctly). This patch adds tests for these functions. fesetexceptflag is meant to set the relevant exception flag bits to the saved state without causing enabled traps to be taken. On some architectures, it is not possible to set exception flag bits without causing enabled traps to occur. Such architectures need to define EXCEPTION_SET_FORCES_TRAP to 1 in their math-tests.h, as is done in this patch for powerpc. x86 avoids needing to define this because the traps resulting from setting exception bits don't occur until the next floating-point operation or fwait instruction. Tested for x86_64, x86 and powerpc. Note that test-fexcept fails for powerpc because of a pre-existing bug in fesetexceptflag for powerpc, which I'll fix separately. * math/test-fexcept-traps.c: New file. * math/test-fexcept.c: Likewise. * math/Makefile (tests): Add test-fexcept and test-fexcept-traps. * sysdeps/generic/math-tests.h (EXCEPTION_SET_FORCES_TRAP): New macro. * sysdeps/powerpc/math-tests.h [!__NO_FPRS__] (EXCEPTION_SET_FORCES_TRAP): Likewise.
* locales: en_CA: update d_fmt [BZ #9842]Martin Pitt2016-08-102-1/+6
| | | | | | | | | | | | | | | | | | | | The date format in en_CA/LC_TIME specifies the date format as "%d/%m/%y". However, it should be "%Y-%m-%d". This is the standard date format in Canada as specified by the Canadian Standards Association in CSA Z234.5:1989, which adopts the ISO 8601 standard. Here's the web page from the National Research Council of Canada citing ISO 8601 as the standard date/time format in Canada: http://www.nrc-cnrc.gc.ca/eng/services/time/faq/#Q8 International Standard ISO 8601 specifies numeric representations of date and time. The recommended full format is of the form 2001-12-31 23:59:28.73 UTC. The intent of this standard is to avoid confusion in international communications which can arise with the many different national notations. This format has the advantage that it permits dates to be readily sorted in chronological order by computer systems. Windows 8+ and OS X also switched to this format.
* ChangeLog: change Winblowz to WindowsMike Frysinger2016-08-102-2/+2
|
* localedata: change M$ to MicrosoftMike Frysinger2016-08-102-1/+5
|
* Add atomic operations required by the new condition variable.Torvald Riegel2016-08-092-0/+53
| | | | | | * include/atomic.h (atomic_fetch_and_relaxed, atomic_fetch_and_release, atomic_fetch_or_release, atomic_fetch_xor_release): New.
* Fix recvmsg returning SIGLOST on PF_LOCAL socketsSamuel Thibault2016-08-092-1/+9
| | | | | | | when msg_name is not NULL. * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Cope with aport being MACH_PORT_NULL.
* sparc32/sparcv9: add a VIS3 version of fdimAurelien Jarno2016-08-058-2/+131
| | | | | | | | | | | | | | | | | | | sparc32 passes floating point values in the integer registers. VIS3 instructions gives access to the movwtos instruction to directly transfer a value from an integer register to a floating point register. Therefore it makes sense to provide a VIS3 version consisting in the generic version compiled with -mvis3. Changelog: * math/s_fdim.c: Avoid alias renamed. * math/s_fdimf.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): Add s_fdimf-vis3, s_fdim-vis3. (CFLAGS-s_fdimf-vis3.c): New. Set to -Wa,-Av9d -mvis3. (CFLAGS-s_fdim-vis3.c): Likewise. sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.c: New file. sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.c: Likewise.
* sparc: remove fdim sparc specific implementationsAurelien Jarno2016-08-0512-314/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fdim and fdimf functions on sparc do not fully follow the standard and do not set errno to ERANGE when the result overflows. Since glibc 2.24 this causes the two following tests to fail: Failure: fdim (max_value, -max_value): errno set to 0, expected 34 (ERANGE) Failure: fdim_upward (max_value, -max_value): errno set to 0, expected 34 (ERANGE) It happens that using GCC with the generic C code generates very similar code to the sparc specific implementations. Therefore this patches remove them. Note it might still worth adding a vis3 specific version of fdim on sparc32/sparcv9, this is done in a following patch to ease backporting. Changelog: * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/Makefile [$(subdir) = math && $(have-as-vis3) = yes] (libm-sysdep_routines): Remove s_fdimf-vis3, s_fdim-vis3. * sysdeps/sparc/sparc32/fpu/s_fdim.S: Delete file. * sysdeps/sparc/sparc32/fpu/s_fdimf.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim-vis3.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdim.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf-vis3.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/multiarch/s_fdimf.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdim.S: Likewise. * sysdeps/sparc/sparc32/sparcv9/fpu/s_fdimf.S: Likewise. * sysdeps/sparc/sparc64/fpu/s_fdim.S: Likewise. * sysdeps/sparc/sparc64/fpu/s_fdimf.S: Likewise.
* sparc: build with -mvis on sparc32/sparcv9 and sparc64Aurelien Jarno2016-08-053-1/+9
| | | | | | | | | | | | | | When building for sparc32/sparcv9 or sparc64, we assume that VIS instructions are available and use them in the sparc specific assembly code. However we do not tell GCC to use such instructions, resulting in slightly suboptimal code. Fix that by passing -Wa,-Av9a -mvis to GCC. Changelog: * sysdeps/sparc/sparc32/sparcv9/Makefile (sysdep-CFLAGS): Add -mvis. * sysdeps/sparc/sparc64/Makefile (sysdep-CFLAGS): New. Define to -Wa,-Av9a -mvis.
* Improve gen-libm-test.pl LIT() applicationPaul E. Murphy2016-08-053-56/+82
| | | | | | | | | | | | | | | | | | When bootstrapping float128, this exposed a number of areas where the L suffix is incorrectly applied to simple expressions when it should be applied to each constant in the expression. In order to stave off more macros in libm-test.inc, apply_lit is made slightly more intelligent. It will now split expressions based on space characters, and attempt to apply LIT() to each token. Having done this, there are numerous spacing issues within libm-test.inc which have been fixed. The above is problematic when the L real suffix is not the most expressive modifier, and the compiler complains (i.e ppc64) or silently truncates a value (i.e ppc64).
* Fix math.h comment about bits/mathdef.h.Joseph Myers2016-08-052-34/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | math.h has a comment about definitions from <bits/mathdef.h>. This comment is in the wrong place in math.h, far below the inclusion of <bits/mathdef.h>. It was originally above the inclusion, but the inclusion was moved by 1998-11-05 Ulrich Drepper <drepper@cygnus.com> * math/math.h: Unconditionally include bits/mathdef.h. Declare long double functions only if __NO_LONG_DOUBLE_MATH is not defined. [...] without moving the comment. Furthermore, the comment refers incorrectly to FLT_EVAL_METHOD and DECIMAL_DIG, which are actually <float.h> macros, and INFINITY, which is in <bits/inf.h>. This patch moves the comment back above the include it refers to and removes the description of macros not defined by the header. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * math/math.h: Move comment about <bits/mathdef.h> definitions above inclusion of <bits/mathdef.h>. Do not mention FLT_EVAL_METHOD, INFINITY or DECIMAL_DIG in that comment.
* Add atomic_exchange_relaxed.Torvald Riegel2016-08-052-0/+13
| | | | * include/atomic.h (atomic_exchange_relaxed): New.
* Do not call __nan in scalb functions.Joseph Myers2016-08-044-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When libm functions return a NaN: if it is for NaN input, it should be computed from that input (e.g. adding it to itself), so that payloads are propagated and signaling NaNs quieted, while if it is for non-NaN input, it should be produced by a computation such as (x - x) / (x - x), which raises "invalid" at the same time as producing an appropriate NaN, so avoiding any need for a call to feraiseexcept. Various libm functions, however, call __nan ("") (or __nanf or __nanl) to determine the NaN to return, together with using feraiseexcept (FE_INVALID) to raise the exception. sysdeps/generic/math_private.h has an optimization for those functions with constant "" argument so this doesn't actually involve a call to the __nan function, but it is still not the preferred approach for producing NaNs. (The optimized code also always uses the NAN macro, i.e. produces a default NaN for float converted to whatever the target type is, and on some architectures that may not be the same as the preferred default NaN for double or long double.) This patch fixes the scalb functions to use the conventional method of generating NaNs and raising "invalid" with an appropriate computation. (Most instances of this issue are in the complex functions, where it can more readily be fixed once they have been made type-generic and so only a third as many places need fixing. Some of the complex functions use __nan ("") + __nan (""), where the addition serves no purpose whatsoever.) Tested for x86_64 and x86. * math/e_scalb.c: Do not include <fenv.h>. (invalid_fn): Do calculation resulting in NaN instead of raising FE_INVALID and returning a NaN explicitly. * math/e_scalbf.c: Do not include <fenv.h>. (invalid_fn): Do calculation resulting in NaN instead of raising FE_INVALID and returning a NaN explicitly. * math/e_scalbl.c: Do not include <fenv.h>. (invalid_fn): Do calculation resulting in NaN instead of raising FE_INVALID and returning a NaN explicitly.
* Update PO files.Carlos O'Donell2016-08-044-131/+114
| | | | | Update the PO files from the latest available from the Translation Project.
* x86: Use sysdep.o from libc.a in static librariesFlorian Weimer2016-08-042-0/+9
| | | | | | | | | Static libraries can use the sysdep.o copy in libc.a without a performance penalty. This results in a visible difference if libpthread.a is relinked into a single object file (which is needed to support libraries which check for the presence of certain symbols to enable threading support, which generally fails with static linking unless libpthread.a is relinked).
* Also handle __STDC_WANT_IEC_60559_BFP_EXT__ in <tgmath.h>.Joseph Myers2016-08-032-1/+5
| | | | | | | | | | | | | | | | My __STDC_WANT_IEC_60559_BFP_EXT__ patch omitted to update the conditions on the nextup and nextdown type-generic macros in <tgmath.h>. This patch updates those conditions accordingly. (As glibc doesn't currently have an exp10 type-generic macro, no such changes are needed relating to __STDC_WANT_IEC_60559_FUNCS_EXT__; adding such a type-generic macro would be a new feature.) Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). Committed. * math/tgmath.h (nextdown): Define if [__GLIBC_USE (IEC_60559_BFP_EXT)], not if [__USE_GNU]. (nextup): Likewise.
* Support __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro.Joseph Myers2016-08-037-6/+46
| | | | | | | | | | | | | | | | | | | | | | | This patch implements support for the __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro, following the __GLIBC_USE approach used for other ISO C feature test macros. Currently this only affects the exp10 functions (which glibc has had for a long time). Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New macro. * include/features.h (__STDC_WANT_IEC_60559_FUNCS_EXT__): Document. * manual/creature.texi (__STDC_WANT_IEC_60559_FUNCS_EXT__): Document macro. * manual/math.texi (exp10): Document as ISO from TS 18661-4:2015. (exp10f): Likewise. (exp10l): Likewise. * math/bits/mathcalls.h (exp10): Declare if [__GLIBC_USE (IEC_60559_FUNCS_EXT)], not [__USE_GNU].
* Fix typo in last arith.texi change.Joseph Myers2016-08-032-1/+5
| | | | * manual/arith.texi (nextup): Fix typo in last change.
* Deprecate inclusion of <sys/sysmacros.h> by <sys/types.h>Zack Weinberg2016-08-034-4/+88
| | | | | | | | | | | | | | | | | The macros defined by <sys/sysmacros.h> are not part of POSIX nor XSI, and their names frequently collide with user code; see for instance glibc bug 19239 and Red Hat bug 130601. <stdlib.h> includes <sys/types.h> under _GNU_SOURCE, and C++ code presently cannot avoid being compiled under _GNU_SOURCE, exacerbating the problem. * NEWS: Inclusion of <sys/sysmacros.h> by <sys/types.h> is deprecated. * misc/sys/sysmacros.h: If __SYSMACROS_DEPRECATED_INCLUSION is defined, define major, minor, and makedev to issue deprecation warnings on use. If __SYSMACROS_DEPRECATED_INCLUSION is *not* defined, suppress previously-activated deprecation warnings for these macros and prevent subsequent inclusions of this header from having any effect. * posix/sys/types.h: Define __SYSMACROS_DEPRECATED_INCLUSION before including <sys/sysmacros.h>, and undefine it again afterward.
* Minimize sysdeps code involved in defining major/minor/makedev.Zack Weinberg2016-08-0341-119/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Presently sys/sysmacros.h is entirely defined in sysdeps. This would mean that the deprecation logic coming up in the next patch would have to be written twice (in generic/ and unix/sysv/linux/). To avoid that, hoist all but the unavoidably system-dependent logic to misc/, leaving a bits/ header behind. This also promotes the Linux-specific encoding of dev_t, which accommodates 32-bit major and minor numbers in a 64-bit dev_t, to generic, as glibc's dev_t is always 64 bits wide. The former Linux implementation used inline functions to avoid evaluating arguments more than once. After this change, all platforms use inline functions, which means that three new symbols are added to the generic ABI. (These symbols are in the user namespace, which is how they have always been on Linux. They begin with "gnu_dev_", so collisions with user code are pretty unlikely.) New ports henceforth need only provide a bits/sysmacros.h defining internal macros __SYSMACROS_{DECLARE,DEFINE}_{MAJOR,MINOR,MAKEDEV}. This is only necessary if the kernel encoding is incompatible with the now-generic encoding (for instance, it would be necessary for FreeBSD). While I was at it, I added a basic round-trip test for these functions. * sysdeps/generic/sys/sysmacros.h: Delete file. * sysdeps/unix/sysv/linux/makedev.c: Delete file. * sysdeps/unix/sysv/linux/sys/sysmacros.h: Move file ... * bits/sysmacros.h: ... here; this encoding is now the generic encoding. Now defines only the following macros: __SYSMACROS_DECLARE_MAJOR, __SYSMACROS_DEFINE_MAJOR, __SYSMACROS_DECLARE_MINOR, __SYSMACROS_DEFINE_MINOR, __SYSMACROS_DECLARE_MAKEDEV, __SYSMACROS_DEFINE_MAKEDEV. * misc/sys/sysmacros.h, misc/makedev.c: New files that use bits/sysmacros.h and the above new macros to generate the public implementations of major, minor, and makedev. * misc/tst-makedev.c: New test. * include/sys/sysmacros.h: New wrapper. * misc/Makefile (headers): Add sys/sysmacros.h, bits/sysmacros.h. (routines): Add makedev. (tests): Add tst-makedev. * misc/Versions [GLIBC_2.25]: Add gnu_dev_major, gnu_dev_minor, gnu_dev_makedev. * posix/Makefile (headers): Remove sys/sysmacros.h. * sysdeps/unix/sysv/linux/Makefile (sysdep_routines): Remove makedev. * sysdeps/arm/nacl/libc.abilist: Add GLIBC_2.25, gnu_dev_major, gnu_dev_makedev, gnu_dev_minor. * sysdeps/unix/sysv/linux/aarch64/libc.abilist * sysdeps/unix/sysv/linux/alpha/libc.abilist * sysdeps/unix/sysv/linux/arm/libc.abilist * sysdeps/unix/sysv/linux/hppa/libc.abilist * sysdeps/unix/sysv/linux/i386/libc.abilist * sysdeps/unix/sysv/linux/ia64/libc.abilist * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist * sysdeps/unix/sysv/linux/microblaze/libc.abilist * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist * sysdeps/unix/sysv/linux/nios2/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist * sysdeps/unix/sysv/linux/sh/libc.abilist * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Add GLIBC_2.25.
* Add utility macros for clang detection, and deprecation with messages.Zack Weinberg2016-08-033-5/+42
| | | | | | | | | | | | | | | | | | | | | There are three new macros added to features.h and sys/cdefs.h: * __glibc_clang_prereq: just like __GNUC_PREREQ, but for clang. * __glibc_clang_has_extension: wraps clang's intrinsic __has_extension. Writing "#if defined __clang__ && __has_extension (...)" doesn't work, because compilers other than clang will object to the unknown macro __has_extension even though they don't need to evaluate it. Instead, write "#if __glibc_clang_has_extension (...)". * __attribute_deprecated_msg__(msg): like __attribute_deprecated__, but if possible, prints a message. The first two are used to define the third. The third will be used in subsequent patches. * include/features.h (__glibc_clang_prereq): New macro. * misc/sys/cdefs.h (__glibc_clang_has_extension) (__attribute_deprecated_msg__): New macros.
* Support __STDC_WANT_IEC_60559_BFP_EXT__ feature test macro.Joseph Myers2016-08-038-16/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements support for the __STDC_WANT_IEC_60559_BFP_EXT__ feature test macro from ISO/IEC 18661-1:2014, following the __GLIBC_USE approach now used for __STDC_WANT_LIB_EXT2__. For this macro, the relevant consideration is whether it is defined or undefined when an affected header is included (not what its value is if defined, and not whether it's defined or undefined when any other unaffected system header is included). Currently this macro only affects the issignaling macro and the nextup and nextdown functions (so they can be enabled by defining this macro, not just by defining _GNU_SOURCE as previously). Any further features from this TS added in future would also be conditioned on this macro. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_BFP_EXT): New macro. * include/features.h (__STDC_WANT_IEC_60559_BFP_EXT__): Document. * manual/arith.texi (issignaling): Document as ISO from TS 18661-1:2014. (nextup): Likewise. (nextupf): Likewise. (nextupl): Likewise. (nextdown): Likewise. (nextdownf): Likewise. (nextdownl): Likewise. * manual/creature.texi (__STDC_WANT_IEC_60559_BFP_EXT__): Document macro. * math/math.h: Define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include <bits/libc-header-start.h> instead of including <features.h>. (issignaling): Define if [__GLIBC_USE (IEC_60559_BFP_EXT)], not [__USE_GNU]. * math/bits/mathcalls.h (nextdown): Declare if [__GLIBC_USE (IEC_60559_BFP_EXT)], not [__USE_GNU]. (nextup): Likewise. (__issignaling): Likewise.
* Unify drift between _Complex function type variantsPaul E. Murphy2016-08-035-10/+15
| | | | | | While trying to convert the _Complex function wrappers into a single generic implementation, a few minor variations between identical versions emerged.