]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
NEWS: Add advisories. master
authorCarlos O'Donell <carlos@redhat.com>
Thu, 2 May 2024 01:54:11 +0000 (21:54 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Mon, 6 May 2024 19:12:31 +0000 (15:12 -0400)
  GLIBC-SA-2024-0004:
    ISO-2022-CN-EXT: fix out-of-bound writes when writing escape
    sequence (CVE-2024-2961)

  GLIBC-SA-2024-0005:
    nscd: Stack-based buffer overflow in netgroup cache (CVE-2024-33599)

  GLIBC-SA-2024-0006:
    nscd: Null pointer crashes after notfound response
    (CVE-2024-33600)

  GLIBC-SA-2024-0007:
    nscd: netgroup cache may terminate daemon on memory allocation
    failure (CVE-2024-33601)

  GLIBC-SA-2024-0008:
    nscd: netgroup cache assumes NSS callback uses in-buffer strings
    (CVE-2024-33602)

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
68 files changed:
INSTALL
Makeconfig
Makefile
NEWS
Rules
advisories/GLIBC-SA-2024-0005 [new file with mode: 0644]
advisories/GLIBC-SA-2024-0006 [new file with mode: 0644]
advisories/GLIBC-SA-2024-0007 [new file with mode: 0644]
advisories/GLIBC-SA-2024-0008 [new file with mode: 0644]
csu/Makefile
hurd/hurd/fd.h
libio/Makefile
libio/tst-stderr-compat.c [new file with mode: 0644]
math/Makefile
nscd/netgroupcache.c
scripts/build-many-glibcs.py
sysdeps/aarch64/cpu-features.h
sysdeps/i386/i586/memcpy.S
sysdeps/i386/i686/memmove.S
sysdeps/i386/i686/memset.S
sysdeps/or1k/fpu/fclrexcpt.c [new file with mode: 0644]
sysdeps/or1k/fpu/fegetenv.c [new file with mode: 0644]
sysdeps/or1k/fpu/fegetmode.c [new file with mode: 0644]
sysdeps/or1k/fpu/fegetround.c [new file with mode: 0644]
sysdeps/or1k/fpu/feholdexcpt.c [new file with mode: 0644]
sysdeps/or1k/fpu/fenv_private.h [new file with mode: 0644]
sysdeps/or1k/fpu/fesetenv.c [new file with mode: 0644]
sysdeps/or1k/fpu/fesetexcept.c [new file with mode: 0644]
sysdeps/or1k/fpu/fesetmode.c [new file with mode: 0644]
sysdeps/or1k/fpu/fesetround.c [new file with mode: 0644]
sysdeps/or1k/fpu/feupdateenv.c [new file with mode: 0644]
sysdeps/or1k/fpu/fgetexcptflg.c [new file with mode: 0644]
sysdeps/or1k/fpu/fix-fp-int-convert-overflow.h [new file with mode: 0644]
sysdeps/or1k/fpu/fraiseexcpt.c [new file with mode: 0644]
sysdeps/or1k/fpu/fsetexcptflg.c [new file with mode: 0644]
sysdeps/or1k/fpu/ftestexcept.c [new file with mode: 0644]
sysdeps/or1k/fpu/get-rounding-mode.h [new file with mode: 0644]
sysdeps/or1k/fpu/libm-test-ulps [new file with mode: 0644]
sysdeps/or1k/fpu/libm-test-ulps-name [new file with mode: 0644]
sysdeps/or1k/fpu_control.h [new file with mode: 0644]
sysdeps/or1k/libm-test-ulps-name [deleted file]
sysdeps/or1k/math-tests-snan-payload.h [new file with mode: 0644]
sysdeps/or1k/math-tests-trap.h [new file with mode: 0644]
sysdeps/or1k/nofpu/libm-test-ulps [moved from sysdeps/or1k/libm-test-ulps with 100% similarity]
sysdeps/or1k/nofpu/libm-test-ulps-name [new file with mode: 0644]
sysdeps/or1k/sfp-machine.h
sysdeps/powerpc/powerpc64/le/power10/strncmp.S [new file with mode: 0644]
sysdeps/powerpc/powerpc64/multiarch/Makefile
sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc64/multiarch/strncmp-power10.S [new file with mode: 0644]
sysdeps/powerpc/powerpc64/multiarch/strncmp.c
sysdeps/pthread/Makefile
sysdeps/unix/sysv/linux/or1k/Versions [new file with mode: 0644]
sysdeps/unix/sysv/linux/or1k/getcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/or1k/getcontext.S
sysdeps/unix/sysv/linux/or1k/libc.abilist
sysdeps/unix/sysv/linux/or1k/makecontext.c
sysdeps/unix/sysv/linux/or1k/setcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/or1k/setcontext.S
sysdeps/unix/sysv/linux/or1k/swapcontext-common.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/or1k/swapcontext.S
sysdeps/unix/sysv/linux/or1k/sys/ucontext.h
sysdeps/unix/sysv/linux/or1k/ucontext_i.sym
sysdeps/unix/sysv/linux/timespec_get.c
sysdeps/unix/sysv/linux/timespec_getres.c
sysdeps/x86/dl-get-cpu-features.c
time/timespec_get.c
time/timespec_getres.c

diff --git a/INSTALL b/INSTALL
index 2f2d12c335850d00856e231bae859aec6a632112..c8c524527b9fc17391ec2711273902638d1dc8ab 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -15,98 +15,98 @@ Configuring and compiling the GNU C Library
 
 The GNU C Library cannot be compiled in the source directory.  You must
 build it in a separate build directory.  For example, if you have
-unpacked the GNU C Library sources in ‘/src/gnu/glibc-VERSION’, create a
-directory ‘/src/gnu/glibc-build’ to put the object files in.  This
+unpacked the GNU C Library sources in '/src/gnu/glibc-VERSION', create a
+directory '/src/gnu/glibc-build' to put the object files in.  This
 allows removing the whole build directory in case an error occurs, which
 is the safest way to get a fresh start and should always be done.
 
-   From your object directory, run the shell script ‘configure’ located
-at the top level of the source tree.  In the scenario above, youd type
+   From your object directory, run the shell script 'configure' located
+at the top level of the source tree.  In the scenario above, you'd type
 
      $ ../glibc-VERSION/configure ARGS...
 
-   Please note that even though youre building in a separate build
+   Please note that even though you're building in a separate build
 directory, the compilation may need to create or modify files and
 directories in the source directory.
 
-‘configure’ takes many options, but the only one that is usually
-mandatory is ‘--prefix’.  This option tells ‘configure’ where you want
-the GNU C Library installed.  This defaults to ‘/usr/local’, but the
+'configure' takes many options, but the only one that is usually
+mandatory is '--prefix'.  This option tells 'configure' where you want
+the GNU C Library installed.  This defaults to '/usr/local', but the
 normal setting to install as the standard system library is
-‘--prefix=/usr’ for GNU/Linux systems and ‘--prefix=’ (an empty prefix)
+'--prefix=/usr' for GNU/Linux systems and '--prefix=' (an empty prefix)
 for GNU/Hurd systems.
 
-   It may also be useful to pass ‘CC=COMPILER’ and ‘CFLAGS=FLAGS’
-arguments to ‘configure’.  ‘CC’ selects the C compiler that will be
-used, and ‘CFLAGS’ sets optimization options for the compiler.  Any
+   It may also be useful to pass 'CC=COMPILER' and 'CFLAGS=FLAGS'
+arguments to 'configure'.  'CC' selects the C compiler that will be
+used, and 'CFLAGS' sets optimization options for the compiler.  Any
 compiler options required for all compilations, such as options
 selecting an ABI or a processor for which to generate code, should be
-included in ‘CC’.  Options that may be overridden by the GNU C Library
+included in 'CC'.  Options that may be overridden by the GNU C Library
 build system for particular files, such as for optimization and
-debugging, should go in ‘CFLAGS’.  The default value of ‘CFLAGS’ is ‘-g
--O2, and the GNU C Library cannot be compiled without optimization, so
-if ‘CFLAGS’ is specified it must enable optimization.  For example:
+debugging, should go in 'CFLAGS'.  The default value of 'CFLAGS' is '-g
+-O2', and the GNU C Library cannot be compiled without optimization, so
+if 'CFLAGS' is specified it must enable optimization.  For example:
 
      $ ../glibc-VERSION/configure CC="gcc -m32" CFLAGS="-O3"
 
    The following list describes all of the available options for
-‘configure’:
+'configure':
 
-‘--prefix=DIRECTORY’
+'--prefix=DIRECTORY'
      Install machine-independent data files in subdirectories of
-     ‘DIRECTORY’.  The default is to install in ‘/usr/local’.
+     'DIRECTORY'.  The default is to install in '/usr/local'.
 
-‘--exec-prefix=DIRECTORY’
+'--exec-prefix=DIRECTORY'
      Install the library and other machine-dependent files in
-     subdirectories of ‘DIRECTORY’.  The default is to the ‘--prefix’
-     directory if that option is specified, or ‘/usr/local’ otherwise.
+     subdirectories of 'DIRECTORY'.  The default is to the '--prefix'
+     directory if that option is specified, or '/usr/local' otherwise.
 
-‘--with-headers=DIRECTORY’
-     Look for kernel header files in DIRECTORY, not ‘/usr/include’.  The
-     GNU C Library needs information from the kernels header files
+'--with-headers=DIRECTORY'
+     Look for kernel header files in DIRECTORY, not '/usr/include'.  The
+     GNU C Library needs information from the kernel's header files
      describing the interface to the kernel.  The GNU C Library will
-     normally look in ‘/usr/include’ for them, but if you specify this
+     normally look in '/usr/include' for them, but if you specify this
      option, it will look in DIRECTORY instead.
 
      This option is primarily of use on a system where the headers in
-     ‘/usr/include’ come from an older version of the GNU C Library.
+     '/usr/include' come from an older version of the GNU C Library.
      Conflicts can occasionally happen in this case.  You can also use
      this option if you want to compile the GNU C Library with a newer
-     set of kernel headers than the ones found in ‘/usr/include’.
+     set of kernel headers than the ones found in '/usr/include'.
 
-‘--enable-kernel=VERSION’
+'--enable-kernel=VERSION'
      This option is currently only useful on GNU/Linux systems.  The
      VERSION parameter should have the form X.Y.Z and describes the
      smallest version of the Linux kernel the generated library is
      expected to support.  The higher the VERSION number is, the less
      compatibility code is added, and the faster the code gets.
 
-‘--with-binutils=DIRECTORY’
-     Use the binutils (assembler and linker) in ‘DIRECTORY’, not the
+'--with-binutils=DIRECTORY'
+     Use the binutils (assembler and linker) in 'DIRECTORY', not the
      ones the C compiler would default to.  You can use this option if
      the default binutils on your system cannot deal with all the
-     constructs in the GNU C Library.  In that case, ‘configure’ will
+     constructs in the GNU C Library.  In that case, 'configure' will
      detect the problem and suppress these constructs, so that the
-     library will still be usable, but functionality may be lostfor
-     example, you cant build a shared libc with old binutils.
+     library will still be usable, but functionality may be lost--for
+     example, you can't build a shared libc with old binutils.
 
-‘--with-nonshared-cflags=CFLAGS’
+'--with-nonshared-cflags=CFLAGS'
      Use additional compiler flags CFLAGS to build the parts of the
      library which are always statically linked into applications and
      libraries even with shared linking (that is, the object files
-     contained in ‘lib*_nonshared.a’ libraries).  The build process will
+     contained in 'lib*_nonshared.a' libraries).  The build process will
      automatically use the appropriate flags, but this option can be
      used to set additional flags required for building applications and
      libraries, to match local policy.  For example, if such a policy
      requires that all code linked into applications must be built with
      source fortification,
-     ‘--with-nonshared-cflags=-Wp,-D_FORTIFY_SOURCE=2’ will make sure
-     that the objects in ‘libc_nonshared.a’ are compiled with this flag
+     '--with-nonshared-cflags=-Wp,-D_FORTIFY_SOURCE=2' will make sure
+     that the objects in 'libc_nonshared.a' are compiled with this flag
      (although this will not affect the generated code in this
      particular case and potentially change debugging information and
      metadata only).
 
-‘--with-rtld-early-cflags=CFLAGS’
+'--with-rtld-early-cflags=CFLAGS'
      Use additional compiler flags CFLAGS to build the early startup
      code of the dynamic linker.  These flags can be used to enable
      early dynamic linker diagnostics to run on CPUs which are not
@@ -114,18 +114,18 @@ if ‘CFLAGS’ is specified it must enable optimization.  For example:
      compiler flags which target a later instruction set architecture
      (ISA).
 
-‘--with-timeoutfactor=NUM’
+'--with-timeoutfactor=NUM'
      Specify an integer NUM to scale the timeout of test programs.  This
-     factor can be changed at run time using ‘TIMEOUTFACTOR’ environment
+     factor can be changed at run time using 'TIMEOUTFACTOR' environment
      variable.
 
-‘--disable-shared’
-     Dont build shared libraries even if it is possible.  Not all
+'--disable-shared'
+     Don't build shared libraries even if it is possible.  Not all
      systems support shared libraries; you need ELF support and
      (currently) the GNU linker.
 
-‘--disable-default-pie’
-     Dont build glibc programs and the testsuite as position
+'--disable-default-pie'
+     Don't build glibc programs and the testsuite as position
      independent executables (PIE). By default, glibc programs and tests
      are created as position independent executables on targets that
      support it.  If the toolchain and architecture support it, static
@@ -133,29 +133,29 @@ if ‘CFLAGS’ is specified it must enable optimization.  For example:
      used with the GCC option, -static-pie, which is available with GCC
      8 or above, to create static PIE.
 
-‘--enable-cet’
-‘--enable-cet=permissive’
+'--enable-cet'
+'--enable-cet=permissive'
      Enable Intel Control-flow Enforcement Technology (CET) support.
-     When the GNU C Library is built with ‘--enable-cet’ or
-     ‘--enable-cet=permissive’, the resulting library is protected with
+     When the GNU C Library is built with '--enable-cet' or
+     '--enable-cet=permissive', the resulting library is protected with
      indirect branch tracking (IBT) and shadow stack (SHSTK).  When CET
      is enabled, the GNU C Library is compatible with all existing
      executables and shared libraries.  This feature is currently
      supported on x86_64 and x32 with GCC 8 and binutils 2.29 or later.
-     With ‘--enable-cet’, it is an error to dlopen a non CET enabled
+     With '--enable-cet', it is an error to dlopen a non CET enabled
      shared library in CET enabled application.  With
-     ‘--enable-cet=permissive’, CET is disabled when dlopening a non CET
+     '--enable-cet=permissive', CET is disabled when dlopening a non CET
      enabled shared library in CET enabled application.
 
-     NOTE: ‘--enable-cet’ is only supported on x86_64 and x32.
+     NOTE: '--enable-cet' is only supported on x86_64 and x32.
 
-‘--enable-memory-tagging’
+'--enable-memory-tagging'
      Enable memory tagging support if the architecture supports it.
      When the GNU C Library is built with this option then the resulting
      library will be able to control the use of tagged memory when
      hardware support is present by use of the tunable
-     ‘glibc.mem.tagging’.  This includes the generation of tagged memory
-     when using the ‘malloc’ APIs.
+     'glibc.mem.tagging'.  This includes the generation of tagged memory
+     when using the 'malloc' APIs.
 
      At present only AArch64 platforms with MTE provide this
      functionality, although the library will still operate (without
@@ -163,115 +163,115 @@ if ‘CFLAGS’ is specified it must enable optimization.  For example:
 
      The default is to disable support for memory tagging.
 
-‘--disable-profile’
-     Dont build libraries with profiling information.  You may want to
-     use this option if you dont plan to do profiling.
+'--disable-profile'
+     Don't build libraries with profiling information.  You may want to
+     use this option if you don't plan to do profiling.
 
-‘--enable-static-nss’
+'--enable-static-nss'
      Compile static versions of the NSS (Name Service Switch) libraries.
      This is not recommended because it defeats the purpose of NSS; a
      program linked statically with the NSS libraries cannot be
      dynamically reconfigured to use a different name database.
 
-‘--enable-hardcoded-path-in-tests’
+'--enable-hardcoded-path-in-tests'
      By default, dynamic tests are linked to run with the installed C
      library.  This option hardcodes the newly built C library path in
      dynamic tests so that they can be invoked directly.
 
-‘--disable-timezone-tools’
-     By default, timezone related utilities (‘zic’, ‘zdump’, and
-     ‘tzselect’) are installed with the GNU C Library.  If you are
-     building these independently (e.g.  by using the ‘tzcode’ package),
+'--disable-timezone-tools'
+     By default, timezone related utilities ('zic', 'zdump', and
+     'tzselect') are installed with the GNU C Library.  If you are
+     building these independently (e.g.  by using the 'tzcode' package),
      then this option will allow disabling the install of these.
 
      Note that you need to make sure the external tools are kept in sync
      with the versions that the GNU C Library expects as the data
-     formats may change over time.  Consult the ‘timezone’ subdirectory
+     formats may change over time.  Consult the 'timezone' subdirectory
      for more details.
 
-‘--enable-stack-protector’
-‘--enable-stack-protector=strong’
-‘--enable-stack-protector=all’
+'--enable-stack-protector'
+'--enable-stack-protector=strong'
+'--enable-stack-protector=all'
      Compile the C library and all other parts of the glibc package
      (including the threading and math libraries, NSS modules, and
-     transliteration modules) using the GCC ‘-fstack-protector’,
-     ‘-fstack-protector-strong’ or ‘-fstack-protector-all’ options to
+     transliteration modules) using the GCC '-fstack-protector',
+     '-fstack-protector-strong' or '-fstack-protector-all' options to
      detect stack overruns.  Only the dynamic linker and a small number
      of routines called directly from assembler are excluded from this
      protection.
 
-‘--enable-bind-now’
+'--enable-bind-now'
      Disable lazy binding for installed shared objects and programs.
      This provides additional security hardening because it enables full
      RELRO and a read-only global offset table (GOT), at the cost of
      slightly increased program load times.
 
-‘--enable-pt_chown’
-     The file ‘pt_chown’ is a helper binary for ‘grantpt’ (*note
+'--enable-pt_chown'
+     The file 'pt_chown' is a helper binary for 'grantpt' (*note
      Pseudo-Terminals: Allocation.) that is installed setuid root to fix
      up pseudo-terminal ownership on GNU/Hurd.  It is not required on
      GNU/Linux, and the GNU C Library will not use the installed
-     ‘pt_chown’ program when configured with ‘--enable-pt_chown’.
+     'pt_chown' program when configured with '--enable-pt_chown'.
 
-‘--disable-werror’
-     By default, the GNU C Library is built with ‘-Werror’.  If you wish
+'--disable-werror'
+     By default, the GNU C Library is built with '-Werror'.  If you wish
      to build without this option (for example, if building with a newer
      version of GCC than this version of the GNU C Library was tested
-     with, so new warnings cause the build with ‘-Werror’ to fail), you
-     can configure with ‘--disable-werror’.
+     with, so new warnings cause the build with '-Werror' to fail), you
+     can configure with '--disable-werror'.
 
-‘--disable-mathvec’
+'--disable-mathvec'
      By default for x86_64, the GNU C Library is built with the vector
      math library.  Use this option to disable the vector math library.
 
-‘--disable-scv’
-     Disable using ‘scv’ instruction for syscalls.  All syscalls will
-     use ‘sc’ instead, even if the kernel supports ‘scv’.  PowerPC only.
+'--disable-scv'
+     Disable using 'scv' instruction for syscalls.  All syscalls will
+     use 'sc' instead, even if the kernel supports 'scv'.  PowerPC only.
 
-‘--build=BUILD-SYSTEM’
-‘--host=HOST-SYSTEM’
+'--build=BUILD-SYSTEM'
+'--host=HOST-SYSTEM'
      These options are for cross-compiling.  If you specify both options
-     and BUILD-SYSTEM is different from HOST-SYSTEM, ‘configure’ will
+     and BUILD-SYSTEM is different from HOST-SYSTEM, 'configure' will
      prepare to cross-compile the GNU C Library from BUILD-SYSTEM to be
-     used on HOST-SYSTEM.  You’ll probably need the ‘--with-headers’
-     option too, and you may have to override CONFIGUREs selection of
+     used on HOST-SYSTEM.  You'll probably need the '--with-headers'
+     option too, and you may have to override CONFIGURE's selection of
      the compiler and/or binutils.
 
-     If you only specify ‘--host’, ‘configure’ will prepare for a native
+     If you only specify '--host', 'configure' will prepare for a native
      compile but use what you specify instead of guessing what your
      system is.  This is most useful to change the CPU submodel.  For
-     example, if ‘configure’ guesses your machine as ‘i686-pc-linux-gnu’
+     example, if 'configure' guesses your machine as 'i686-pc-linux-gnu'
      but you want to compile a library for 586es, give
-     ‘--host=i586-pc-linux-gnu’ or just ‘--host=i586-linux’ and add the
-     appropriate compiler flags (‘-mcpu=i586’ will do the trick) to
-     ‘CC’.
+     '--host=i586-pc-linux-gnu' or just '--host=i586-linux' and add the
+     appropriate compiler flags ('-mcpu=i586' will do the trick) to
+     'CC'.
 
-     If you specify just ‘--build’, ‘configure’ will get confused.
+     If you specify just '--build', 'configure' will get confused.
 
-‘--with-pkgversion=VERSION’
+'--with-pkgversion=VERSION'
      Specify a description, possibly including a build number or build
-     date, of the binaries being built, to be included in ‘--version’
+     date, of the binaries being built, to be included in '--version'
      output from programs installed with the GNU C Library.  For
-     example, ‘--with-pkgversion='FooBar GNU/Linux glibc build 123'’.
-     The default value is ‘GNU libc’.
+     example, '--with-pkgversion='FooBar GNU/Linux glibc build 123''.
+     The default value is 'GNU libc'.
 
-‘--with-bugurl=URL’
+'--with-bugurl=URL'
      Specify the URL that users should visit if they wish to report a
-     bug, to be included in ‘--help’ output from programs installed with
+     bug, to be included in '--help' output from programs installed with
      the GNU C Library.  The default value refers to the main
      bug-reporting information for the GNU C Library.
 
-‘--enable-fortify-source’
-‘--enable-fortify-source=LEVEL’
-     Use -D_FORTIFY_SOURCE=‘LEVEL’ to control hardening in the GNU C
-     Library.  If not provided, ‘LEVEL’ defaults to highest possible
+'--enable-fortify-source'
+'--enable-fortify-source=LEVEL'
+     Use -D_FORTIFY_SOURCE='LEVEL' to control hardening in the GNU C
+     Library.  If not provided, 'LEVEL' defaults to highest possible
      value supported by the build compiler.
 
      Default is to disable fortification.
 
-   To build the library and related programs, type ‘make’.  This will
-produce a lot of output, some of which may look like errors from ‘make’
-but aren’t.  Look for error messages from ‘make’ containing ‘***’.
+   To build the library and related programs, type 'make'.  This will
+produce a lot of output, some of which may look like errors from 'make'
+but aren't.  Look for error messages from 'make' containing '***'.
 Those indicate that something is seriously wrong.
 
    The compilation process can take a long time, depending on the
@@ -279,91 +279,91 @@ configuration and the speed of your machine.  Some complex modules may
 take a very long time to compile, as much as several minutes on slower
 machines.  Do not panic if the compiler appears to hang.
 
-   If you want to run a parallel make, simply pass the ‘-j’ option with
-an appropriate numeric parameter to ‘make’.  You need a recent GNU
-‘make’ version, though.
+   If you want to run a parallel make, simply pass the '-j' option with
+an appropriate numeric parameter to 'make'.  You need a recent GNU
+'make' version, though.
 
    To build and run test programs which exercise some of the library
-facilities, type ‘make check’.  If it does not complete successfully, do
+facilities, type 'make check'.  If it does not complete successfully, do
 not use the built library, and report a bug after verifying that the
 problem is not already known.  *Note Reporting Bugs::, for instructions
 on reporting bugs.  Note that some of the tests assume they are not
-being run by ‘root’.  We recommend you compile and test the GNU C
+being run by 'root'.  We recommend you compile and test the GNU C
 Library as an unprivileged user.
 
    Before reporting bugs make sure there is no problem with your system.
 The tests (and later installation) use some pre-existing files of the
-system such as ‘/etc/passwd’, ‘/etc/nsswitch.conf’ and others.  These
+system such as '/etc/passwd', '/etc/nsswitch.conf' and others.  These
 files must all contain correct and sensible content.
 
-   Normally, ‘make check’ will run all the tests before reporting all
+   Normally, 'make check' will run all the tests before reporting all
 problems found and exiting with error status if any problems occurred.
-You can specify ‘stop-on-test-failure=y’ when running ‘make check’ to
+You can specify 'stop-on-test-failure=y' when running 'make check' to
 make the test run stop and exit with an error status immediately when a
 failure occurs.
 
-   To format the ‘GNU C Library Reference Manual’ for printing, type
-‘make dvi’.  You need a working TeX installation to do this.  The
+   To format the 'GNU C Library Reference Manual' for printing, type
+'make dvi'.  You need a working TeX installation to do this.  The
 distribution builds the on-line formatted version of the manual, as Info
 files, as part of the build process.  You can build them manually with
-‘make info’.
+'make info'.
 
    The library has a number of special-purpose configuration parameters
-which you can find in ‘Makeconfig’.  These can be overwritten with the
-file ‘configparms’.  To change them, create a ‘configparms’ in your
+which you can find in 'Makeconfig'.  These can be overwritten with the
+file 'configparms'.  To change them, create a 'configparms' in your
 build directory and add values as appropriate for your system.  The file
-is included and parsed by ‘make’ and has to follow the conventions for
+is included and parsed by 'make' and has to follow the conventions for
 makefiles.
 
    It is easy to configure the GNU C Library for cross-compilation by
-setting a few variables in ‘configparms’.  Set ‘CC’ to the
+setting a few variables in 'configparms'.  Set 'CC' to the
 cross-compiler for the target you configured the library for; it is
-important to use this same ‘CC’ value when running ‘configure’, like
-this: ‘configure TARGET CC=TARGET-gcc’.  Set ‘BUILD_CC’ to the compiler
+important to use this same 'CC' value when running 'configure', like
+this: 'configure TARGET CC=TARGET-gcc'.  Set 'BUILD_CC' to the compiler
 to use for programs run on the build system as part of compiling the
-library.  You may need to set ‘AR’ to cross-compiling versions of ‘ar’
+library.  You may need to set 'AR' to cross-compiling versions of 'ar'
 if the native tools are not configured to work with object files for the
 target you configured for.  When cross-compiling the GNU C Library, it
-may be tested using make check
-test-wrapper="SRCDIR/scripts/cross-test-ssh.sh HOSTNAME", where SRCDIR
+may be tested using 'make check
+test-wrapper="SRCDIR/scripts/cross-test-ssh.sh HOSTNAME"', where SRCDIR
 is the absolute directory name for the main source directory and
 HOSTNAME is the host name of a system that can run the newly built
 binaries of the GNU C Library.  The source and build directories must be
 visible at the same locations on both the build system and HOSTNAME.
-The ‘cross-test-ssh.sh’ script requires ‘flock’ from ‘util-linux’ to
+The 'cross-test-ssh.sh' script requires 'flock' from 'util-linux' to
 work when GLIBC_TEST_ALLOW_TIME_SETTING environment variable is set.
 
    It is also possible to execute tests, which require setting the date
 on the target machine.  Following use cases are supported:
-   • ‘GLIBC_TEST_ALLOW_TIME_SETTING’ is set in the environment in which
+   * 'GLIBC_TEST_ALLOW_TIME_SETTING' is set in the environment in which
      eligible tests are executed and have the privilege to run
-     ‘clock_settime’.  In this case, nothing prevents those tests from
+     'clock_settime'.  In this case, nothing prevents those tests from
      running in parallel, so the caller shall assure that those tests
      are serialized or provide a proper wrapper script for them.
 
-   • The ‘cross-test-ssh.sh’ script is used and one passes the
-     ‘--allow-time-setting’ flag.  In this case, both sets
-     ‘GLIBC_TEST_ALLOW_TIME_SETTING’ and serialization of test execution
+   * The 'cross-test-ssh.sh' script is used and one passes the
+     '--allow-time-setting' flag.  In this case, both sets
+     'GLIBC_TEST_ALLOW_TIME_SETTING' and serialization of test execution
      are assured automatically.
 
-   In general, when testing the GNU C Library, ‘test-wrapper’ may be set
+   In general, when testing the GNU C Library, 'test-wrapper' may be set
 to the name and arguments of any program to run newly built binaries.
 This program must preserve the arguments to the binary being run, its
 working directory and the standard input, output and error file
-descriptors.  If ‘TEST-WRAPPER env’ will not work to run a program with
-environment variables set, then ‘test-wrapper-env’ must be set to a
+descriptors.  If 'TEST-WRAPPER env' will not work to run a program with
+environment variables set, then 'test-wrapper-env' must be set to a
 program that runs a newly built program with environment variable
-assignments in effect, those assignments being specified as ‘VAR=VALUE’
+assignments in effect, those assignments being specified as 'VAR=VALUE'
 before the name of the program to be run.  If multiple assignments to
 the same variable are specified, the last assignment specified must take
-precedence.  Similarly, if ‘TEST-WRAPPER env -i’ will not work to run a
+precedence.  Similarly, if 'TEST-WRAPPER env -i' will not work to run a
 program with an environment completely empty of variables except those
-directly assigned, then ‘test-wrapper-env-only’ must be set; its use has
-the same syntax as ‘test-wrapper-env’, the only difference in its
+directly assigned, then 'test-wrapper-env-only' must be set; its use has
+the same syntax as 'test-wrapper-env', the only difference in its
 semantics being starting with an empty set of environment variables
 rather than the ambient set.
 
-   For AArch64 with SVE, when testing the GNU C Library, ‘test-wrapper’
+   For AArch64 with SVE, when testing the GNU C Library, 'test-wrapper'
 may be set to "SRCDIR/sysdeps/unix/sysv/linux/aarch64/vltest.py
 VECTOR-LENGTH" to change Vector Length.
 
@@ -371,51 +371,51 @@ Installing the C Library
 ========================
 
 To install the library and its header files, and the Info files of the
-manual, type ‘make install’.  This will build things, if necessary,
+manual, type 'make install'.  This will build things, if necessary,
 before installing them; however, you should still compile everything
 first.  If you are installing the GNU C Library as your primary C
 library, we recommend that you shut the system down to single-user mode
 first, and reboot afterward.  This minimizes the risk of breaking things
 when the library changes out from underneath.
 
-   ‘make install’ will do the entire job of upgrading from a previous
+   'make install' will do the entire job of upgrading from a previous
 installation of the GNU C Library version 2.x.  There may sometimes be
 headers left behind from the previous installation, but those are
 generally harmless.  If you want to avoid leaving headers behind you can
 do things in the following order.
 
-   You must first build the library (‘make’), optionally check it (‘make
-check’), switch the include directories and then install (‘make
-install).  The steps must be done in this order.  Not moving the
+   You must first build the library ('make'), optionally check it ('make
+check'), switch the include directories and then install ('make
+install').  The steps must be done in this order.  Not moving the
 directory before install will result in an unusable mixture of header
 files from both libraries, but configuring, building, and checking the
 library requires the ability to compile and run programs against the old
-library.  The new ‘/usr/include’, after switching the include
+library.  The new '/usr/include', after switching the include
 directories and before installing the library should contain the Linux
 headers, but nothing else.  If you do this, you will need to restore any
 headers from libraries other than the GNU C Library yourself after
 installing the library.
 
    You can install the GNU C Library somewhere other than where you
-configured it to go by setting the ‘DESTDIR’ GNU standard make variable
-on the command line for ‘make install’.  The value of this variable is
+configured it to go by setting the 'DESTDIR' GNU standard make variable
+on the command line for 'make install'.  The value of this variable is
 prepended to all the paths for installation.  This is useful when
 setting up a chroot environment or preparing a binary distribution.  The
 directory should be specified with an absolute file name.  Installing
-with the ‘prefix’ and ‘exec_prefix’ GNU standard make variables set is
+with the 'prefix' and 'exec_prefix' GNU standard make variables set is
 not supported.
 
-   The GNU C Library includes a daemon called ‘nscd’, which you may or
-may not want to run.  ‘nscd’ caches name service lookups; it can
+   The GNU C Library includes a daemon called 'nscd', which you may or
+may not want to run.  'nscd' caches name service lookups; it can
 dramatically improve performance with NIS+, and may help with DNS as
 well.
 
-   One auxiliary program, ‘/usr/libexec/pt_chown’, is installed setuid
-‘root’ if the ‘--enable-pt_chown’ configuration option is used.  This
-program is invoked by the ‘grantpt’ function; it sets the permissions on
+   One auxiliary program, '/usr/libexec/pt_chown', is installed setuid
+'root' if the '--enable-pt_chown' configuration option is used.  This
+program is invoked by the 'grantpt' function; it sets the permissions on
 a pseudoterminal so it can be used by the calling process.  If you are
-using a Linux kernel with the ‘devpts’ filesystem enabled and mounted at
-‘/dev/pts’, you don’t need this program.
+using a Linux kernel with the 'devpts' filesystem enabled and mounted at
+'/dev/pts', you don't need this program.
 
    After installation you should configure the timezone and install
 locales for your system.  The time zone configuration ensures that your
@@ -425,34 +425,34 @@ expectations of your language and geographic region.
 
    The GNU C Library is able to use two kinds of localization
 information sources, the first is a locale database named
-‘locale-archive’ which is generally installed as
-‘/usr/lib/locale/locale-archive’.  The locale archive has the benefit of
+'locale-archive' which is generally installed as
+'/usr/lib/locale/locale-archive'.  The locale archive has the benefit of
 taking up less space and being very fast to load, but only if you plan
 to install sixty or more locales.  If you plan to install one or two
 locales you can instead install individual locales into their self-named
-directories e.g. ‘/usr/lib/locale/en_US.utf8’.  For example to install
-the German locale using the character set for UTF-8 with name ‘de_DE’
-into the locale archive issue the command localedef -i de_DE -f UTF-8
-de_DE’, and to install just the one locale issue the command ‘localedef
---no-archive -i de_DE -f UTF-8 de_DE.  To configure all locales that
+directories e.g. '/usr/lib/locale/en_US.utf8'.  For example to install
+the German locale using the character set for UTF-8 with name 'de_DE'
+into the locale archive issue the command 'localedef -i de_DE -f UTF-8
+de_DE', and to install just the one locale issue the command 'localedef
+--no-archive -i de_DE -f UTF-8 de_DE'.  To configure all locales that
 are supported by the GNU C Library, you can issue from your build
-directory the command ‘make localedata/install-locales’ to install all
-locales into the locale archive or make
-localedata/install-locale-files to install all locales as files in the
+directory the command 'make localedata/install-locales' to install all
+locales into the locale archive or 'make
+localedata/install-locale-files' to install all locales as files in the
 default configured locale installation directory (derived from
-‘--prefix’ or ‘--localedir’).  To install into an alternative system
-root use ‘DESTDIR’ e.g. ‘make localedata/install-locale-files
-DESTDIR=/opt/glibc, but note that this does not change the configured
+'--prefix' or '--localedir').  To install into an alternative system
+root use 'DESTDIR' e.g. 'make localedata/install-locale-files
+DESTDIR=/opt/glibc', but note that this does not change the configured
 prefix.
 
-   To configure the locally used timezone, set the ‘TZ’ environment
-variable.  The script ‘tzselect’ helps you to select the right value.
-As an example, for Germany, ‘tzselect’ would tell you to use
-‘TZ='Europe/Berlin'’.  For a system wide installation (the given paths
-are for an installation with ‘--prefix=/usr’), link the timezone file
-which is in ‘/usr/share/zoneinfo’ to the file ‘/etc/localtime’.  For
-Germany, you might execute ln -s /usr/share/zoneinfo/Europe/Berlin
-/etc/localtime.
+   To configure the locally used timezone, set the 'TZ' environment
+variable.  The script 'tzselect' helps you to select the right value.
+As an example, for Germany, 'tzselect' would tell you to use
+'TZ='Europe/Berlin''.  For a system wide installation (the given paths
+are for an installation with '--prefix=/usr'), link the timezone file
+which is in '/usr/share/zoneinfo' to the file '/etc/localtime'.  For
+Germany, you might execute 'ln -s /usr/share/zoneinfo/Europe/Berlin
+/etc/localtime'.
 
 Recommended Tools for Compilation
 =================================
@@ -460,12 +460,12 @@ Recommended Tools for Compilation
 We recommend installing the following GNU tools before attempting to
 build the GNU C Library:
 
-   • GNU ‘make’ 4.0 or newer
+   * GNU 'make' 4.0 or newer
 
-     As of release time, GNU ‘make’ 4.4.1 is the newest verified to work
+     As of release time, GNU 'make' 4.4.1 is the newest verified to work
      to build the GNU C Library.
 
-    GCC 6.2 or newer
+   * GCC 6.2 or newer
 
      GCC 6.2 or higher is required.  In general it is recommended to use
      the newest version of the compiler that is known to work for
@@ -474,9 +474,9 @@ build the GNU C Library:
      verified to work to build the GNU C Library.
 
      For PowerPC 64-bits little-endian (powerpc64le), a GCC version with
-     support for ‘-mno-gnu-attribute’, ‘-mabi=ieeelongdouble’, and
-     ‘-mabi=ibmlondouble’ is required.  Likewise, the compiler must also
-     support passing ‘-mlong-double-128’ with the preceding options.  As
+     support for '-mno-gnu-attribute', '-mabi=ieeelongdouble', and
+     '-mabi=ibmlondouble' is required.  Likewise, the compiler must also
+     support passing '-mlong-double-128' with the preceding options.  As
      of release, this implies GCC 7.4 and newer (excepting GCC 7.5.0,
      see GCC PR94200).  These additional features are required for
      building the GNU C Library with support for IEEE long double.
@@ -493,10 +493,10 @@ build the GNU C Library:
      been built with support for GNU indirect functions.  This ensures
      that correct debugging information is generated for functions
      selected by IFUNC resolvers.  This support can either be enabled by
-     configuring GCC with ‘--enable-gnu-indirect-function’, or by
-     enabling it by default by setting ‘default_gnu_indirect_function’
+     configuring GCC with '--enable-gnu-indirect-function', or by
+     enabling it by default by setting 'default_gnu_indirect_function'
      variable for a particular architecture in the GCC source file
-     ‘gcc/config.gcc’.
+     'gcc/config.gcc'.
 
      You can use whatever compiler you like to compile programs that use
      the GNU C Library.
@@ -504,100 +504,100 @@ build the GNU C Library:
      Check the FAQ for any special compiler issues on particular
      platforms.
 
-   • GNU ‘binutils’ 2.25 or later
+   * GNU 'binutils' 2.25 or later
 
-     You must use GNU ‘binutils’ (as and ld) to build the GNU C Library.
+     You must use GNU 'binutils' (as and ld) to build the GNU C Library.
      No other assembler or linker has the necessary functionality at the
-     moment.  As of release time, GNU ‘binutils’ 2.42 is the newest
+     moment.  As of release time, GNU 'binutils' 2.42 is the newest
      verified to work to build the GNU C Library.
 
-     For PowerPC 64-bits little-endian (powerpc64le), ‘objcopy’ is
-     required to support ‘--update-section’.  This option requires
+     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
+     required to support '--update-section'.  This option requires
      binutils 2.26 or newer.
 
-     ARC architecture needs ‘binutils’ 2.32 or higher for TLS related
+     ARC architecture needs 'binutils' 2.32 or higher for TLS related
      fixes.
 
-   • GNU ‘texinfo’ 4.7 or later
+   * GNU 'texinfo' 4.7 or later
 
      To correctly translate and install the Texinfo documentation you
-     need this version of the ‘texinfo’ package.  Earlier versions do
+     need this version of the 'texinfo' package.  Earlier versions do
      not understand all the tags used in the document, and the
      installation mechanism for the info files is not present or works
-     differently.  As of release time, ‘texinfo’ 7.0.3 is the newest
+     differently.  As of release time, 'texinfo' 7.0.3 is the newest
      verified to work to build the GNU C Library.
 
-   • GNU ‘awk’ 3.1.2, or higher
+   * GNU 'awk' 3.1.2, or higher
 
-     ‘awk’ is used in several places to generate files.  Some ‘gawk’
-     extensions are used, including the ‘asorti’ function, which was
-     introduced in version 3.1.2 of ‘gawk’.  As of release time, ‘gawk’
+     'awk' is used in several places to generate files.  Some 'gawk'
+     extensions are used, including the 'asorti' function, which was
+     introduced in version 3.1.2 of 'gawk'.  As of release time, 'gawk'
      version 5.2.2 is the newest verified to work to build the GNU C
      Library.
 
-   • GNU ‘bison’ 2.7 or later
+   * GNU 'bison' 2.7 or later
 
-     ‘bison’ is used to generate the ‘yacc’ parser code in the ‘intl’
-     subdirectory.  As of release time, ‘bison’ version 3.8.2 is the
+     'bison' is used to generate the 'yacc' parser code in the 'intl'
+     subdirectory.  As of release time, 'bison' version 3.8.2 is the
      newest verified to work to build the GNU C Library.
 
-    Perl 5
+   * Perl 5
 
      Perl is not required, but if present it is used in some tests and
-     the ‘mtrace’ program, to build the GNU C Library manual.  As of
-     release time ‘perl’ version 5.38.2 is the newest verified to work
+     the 'mtrace' program, to build the GNU C Library manual.  As of
+     release time 'perl' version 5.38.2 is the newest verified to work
      to build the GNU C Library.
 
-   • GNU ‘sed’ 3.02 or newer
+   * GNU 'sed' 3.02 or newer
 
-     ‘Sed’ is used in several places to generate files.  Most scripts
-     work with any version of ‘sed’.  As of release time, ‘sed’ version
+     'Sed' is used in several places to generate files.  Most scripts
+     work with any version of 'sed'.  As of release time, 'sed' version
      4.9 is the newest verified to work to build the GNU C Library.
 
-    Python 3.4 or later
+   * Python 3.4 or later
 
      Python is required to build the GNU C Library.  As of release time,
      Python 3.11 is the newest verified to work for building and testing
      the GNU C Library.
 
-    PExpect 4.0
+   * PExpect 4.0
 
      The pretty printer tests drive GDB through test programs and
-     compare its output to the printers.  PExpect is used to capture
+     compare its output to the printers'.  PExpect is used to capture
      the output of GDB, and should be compatible with the Python version
      in your system.  As of release time PExpect 4.8.0 is the newest
      verified to work to test the pretty printers.
 
-   • The Python ‘abnf’ module.
+   * The Python 'abnf' module.
 
      This module is optional and used to verify some ABNF grammars in
      the manual.  Version 2.2.0 has been confirmed to work as expected.
-     A missing ‘abnf’ module does not reduce the test coverage of the
+     A missing 'abnf' module does not reduce the test coverage of the
      library itself.
 
-    GDB 7.8 or later with support for Python 2.7/3.4 or later
+   * GDB 7.8 or later with support for Python 2.7/3.4 or later
 
      GDB itself needs to be configured with Python support in order to
      use the pretty printers.  Notice that your system having Python
-     available doesnt imply that GDB supports it, nor that your
-     system’s Python and GDB’s have the same version.  As of release
-     time GNU ‘debugger’ 13.2 is the newest verified to work to test the
+     available doesn't imply that GDB supports it, nor that your
+     system's Python and GDB's have the same version.  As of release
+     time GNU 'debugger' 13.2 is the newest verified to work to test the
      pretty printers.
 
      Unless Python, PExpect and GDB with Python support are present, the
-     printer tests will report themselves as ‘UNSUPPORTED’.  Notice that
+     printer tests will report themselves as 'UNSUPPORTED'.  Notice that
      some of the printer tests require the GNU C Library to be compiled
      with debugging symbols.
 
-If you change any of the ‘configure.ac’ files you will also need
+If you change any of the 'configure.ac' files you will also need
 
-   • GNU ‘autoconf’ 2.71 (exactly)
+   * GNU 'autoconf' 2.71 (exactly)
 
 and if you change any of the message translation files you will need
 
-   • GNU ‘gettext’ 0.10.36 or later
+   * GNU 'gettext' 0.10.36 or later
 
-     As of release time, GNU ‘gettext’ version 0.21.1 is the newest
+     As of release time, GNU 'gettext' version 0.21.1 is the newest
      version verified to work to build the GNU C Library.
 
 You may also need these packages if you upgrade your source tree using
@@ -608,40 +608,40 @@ Specific advice for GNU/Linux systems
 
 If you are installing the GNU C Library on GNU/Linux systems, you need
 to have the header files from a 3.2 or newer kernel around for
-reference.  These headers must be installed using make
-headers_install; the headers present in the kernel source directory are
+reference.  These headers must be installed using 'make
+headers_install'; the headers present in the kernel source directory are
 not suitable for direct use by the GNU C Library.  You do not need to
 use that kernel, just have its headers installed where the GNU C Library
 can access them, referred to here as INSTALL-DIRECTORY.  The easiest way
 to do this is to unpack it in a directory such as
-‘/usr/src/linux-VERSION’.  In that directory, run ‘make headers_install
-INSTALL_HDR_PATH=INSTALL-DIRECTORY.  Finally, configure the GNU C
-Library with the option ‘--with-headers=INSTALL-DIRECTORY/include’.  Use
+'/usr/src/linux-VERSION'.  In that directory, run 'make headers_install
+INSTALL_HDR_PATH=INSTALL-DIRECTORY'.  Finally, configure the GNU C
+Library with the option '--with-headers=INSTALL-DIRECTORY/include'.  Use
 the most recent kernel you can get your hands on.  (If you are
 cross-compiling the GNU C Library, you need to specify
-‘ARCH=ARCHITECTURE’ in the ‘make headers_install’ command, where
+'ARCH=ARCHITECTURE' in the 'make headers_install' command, where
 ARCHITECTURE is the architecture name used by the Linux kernel, such as
-‘x86’ or ‘powerpc’.)
+'x86' or 'powerpc'.)
 
    After installing the GNU C Library, you may need to remove or rename
-directories such as ‘/usr/include/linux’ and ‘/usr/include/asm’, and
-replace them with copies of directories such as ‘linux’ and ‘asm’ from
-‘INSTALL-DIRECTORY/include’.  All directories present in
-‘INSTALL-DIRECTORY/include’ should be copied, except that the GNU C
-Library provides its own version of ‘/usr/include/scsi’; the files
+directories such as '/usr/include/linux' and '/usr/include/asm', and
+replace them with copies of directories such as 'linux' and 'asm' from
+'INSTALL-DIRECTORY/include'.  All directories present in
+'INSTALL-DIRECTORY/include' should be copied, except that the GNU C
+Library provides its own version of '/usr/include/scsi'; the files
 provided by the kernel should be copied without replacing those provided
-by the GNU C Library.  The ‘linux’, ‘asm’ and ‘asm-generic’ directories
+by the GNU C Library.  The 'linux', 'asm' and 'asm-generic' directories
 are required to compile programs using the GNU C Library; the other
 directories describe interfaces to the kernel but are not required if
 not compiling programs using those interfaces.  You do not need to copy
 kernel headers if you did not specify an alternate kernel header source
-using ‘--with-headers’.
+using '--with-headers'.
 
    The Filesystem Hierarchy Standard for GNU/Linux systems expects some
-components of the GNU C Library installation to be in ‘/lib’ and some in
-‘/usr/lib’.  This is handled automatically if you configure the GNU C
-Library with ‘--prefix=/usr’.  If you set some other prefix or allow it
-to default to ‘/usr/local’, then all the components are installed there.
+components of the GNU C Library installation to be in '/lib' and some in
+'/usr/lib'.  This is handled automatically if you configure the GNU C
+Library with '--prefix=/usr'.  If you set some other prefix or allow it
+to default to '/usr/local', then all the components are installed there.
 
    As of release time, Linux version 6.1.5 is the newest stable version
 verified to work to build the GNU C Library.
@@ -651,30 +651,30 @@ Reporting Bugs
 
 There are probably bugs in the GNU C Library.  There are certainly
 errors and omissions in this manual.  If you report them, they will get
-fixed.  If you dont, no one will ever know about them and they will
+fixed.  If you don't, no one will ever know about them and they will
 remain unfixed for all eternity, if not longer.
 
    It is a good idea to verify that the problem has not already been
-reported.  Bugs are documented in two places: The file ‘BUGS’ describes
+reported.  Bugs are documented in two places: The file 'BUGS' describes
 a number of well known bugs and the central GNU C Library bug tracking
 system has a WWW interface at <https://sourceware.org/bugzilla/>.  The
 WWW interface gives you access to open and closed reports.  A closed
 report normally includes a patch or a hint on solving the problem.
 
    To report a bug, first you must find it.  With any luck, this will be
-the hard part.  Once you’ve found a bug, make sure it’s really a bug.  A
+the hard part.  Once you've found a bug, make sure it's really a bug.  A
 good way to do this is to see if the GNU C Library behaves the same way
 some other C library does.  If so, probably you are wrong and the
 libraries are right (but not necessarily).  If not, one of the libraries
 is probably wrong.  It might not be the GNU C Library.  Many historical
-Unix C libraries permit things that we dont, such as closing a file
+Unix C libraries permit things that we don't, such as closing a file
 twice.
 
    If you think you have found some way in which the GNU C Library does
 not conform to the ISO and POSIX standards (*note Standards and
 Portability::), that is definitely a bug.  Report it!
 
-   Once you’re sure you’ve found a bug, try to narrow it down to the
+   Once you're sure you've found a bug, try to narrow it down to the
 smallest test case that reproduces the problem.  In the case of a C
 library, you really only need to narrow it down to one library function
 call, if possible.  This should not be too difficult.
@@ -683,8 +683,8 @@ call, if possible.  This should not be too difficult.
 Do this at <https://www.gnu.org/software/libc/bugs.html>.
 
    If you are not sure how a function should behave, and this manual
-doesn’t tell you, that’s a bug in the manual.  Report that too!  If the
-functions behavior disagrees with the manual, then either the library
+doesn't tell you, that's a bug in the manual.  Report that too!  If the
+function's behavior disagrees with the manual, then either the library
 or the manual has a bug, so report the disagreement.  If you find any
 errors or omissions in this manual, please report them to the bug
 database.  If you refer to specific sections of the manual, please
index e5837657124aa7617e7bbe84324efc17a9556d8d..61ff1d0d9bdc2f5c74b80e28a3c70dfc54f75eba 100644 (file)
@@ -360,6 +360,8 @@ whole-archive = -Wl,--whole-archive
 # Installed name of the startup code.
 # The ELF convention is that the startfile is called crt1.o
 start-installed-name = crt1.o
+# Similar to crt1.o, but without _IO_stdin_used.
+start-name-2.0 = crt1-2.0.o
 # On systems that do not need a special startfile for statically linked
 # binaries, simply set it to the normal name.
 ifndef static-start-installed-name
@@ -537,6 +539,25 @@ else  # build-static
 endif  # build-shared
 endif  # +link
 
+# Command for linking test programs with crt1.o from glibc 2.0.
++link-2.0-before-inputs = -nostdlib -nostartfiles $(no-pie-ldflag) \
+             $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \
+             $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \
+             $(firstword $(CRT-$(@F)) $(csu-objpfx)$(start-name-2.0)) \
+             $(+preinit) $(+prector)
++link-2.0-before-libc = -o $@ $(+link-2.0-before-inputs) \
+             $(filter-out $(addprefix $(csu-objpfx),start.o \
+                                                    $(start-name-2.0))\
+                          $(+preinit) $(link-extra-libs) \
+                          $(common-objpfx)libc% $(+postinit),$^) \
+             $(link-extra-libs)
++link-after-libc = $(+postctor) $(+postinit)
+define +link-2.0-tests
+$(CC) $(+link-2.0-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+  $(+link-after-libc)
+$(call after-link,$@)
+endef
+
 # The pretty printer test programs need to be compiled without optimizations
 # so they won't confuse gdb.  We could use either the 'GCC optimize' pragma
 # or the 'optimize' function attribute to achieve this; however, at least on
index 7052b46df83ec25d70160dce4ec6c33086c72de6..adf47491240b85ef2193823072b6ce5e500ccc5f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -577,6 +577,13 @@ $(objpfx)lint-makefiles.out: scripts/lint-makefiles.sh
        $(SHELL) $< "$(PYTHON)" `pwd` > $@ ; \
        $(evaluate-test)
 
+# Link libc.a as a whole to verify that it does not contain multiple
+# definitions of any symbols.
+tests-special += $(objpfx)link-static-libc.out
+$(objpfx)link-static-libc.out:
+       $(LINK.o) $(whole-archive) -r $(objpfx)libc.a -o /dev/null > $@ 2>&1; \
+       $(evaluate-test)
+
 # Print test summary for tests in $1 .sum file;
 # $2 is optional test identifier.
 # Fail if there are unexpected failures in the test results.
@@ -737,7 +744,7 @@ endif
 INSTALL: manual/install-plain.texi manual/macros.texi \
         $(common-objpfx)manual/pkgvers.texi manual/install.texi
        makeinfo --no-validate --plaintext --no-number-sections \
-                -I$(common-objpfx)manual $< -o $@-tmp
+                --disable-encoding -I$(common-objpfx)manual $< -o $@-tmp
        $(AWK) 'NF == 0 { ++n; next } \
                NF != 0 { while (n-- > 0) print ""; n = 0; print }' \
          < $@-tmp > $@-tmp2
diff --git a/NEWS b/NEWS
index cf6078cf200e8502662468467bfe96d887b5d9a4..2234021a95b2e9dd610b8dbdfb07b8e71b0ea775 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -177,6 +177,25 @@ found in the advisories directory of the release tarball:
   GLIBC-SA-2024-0003:
     syslog: Integer overflow in __vsyslog_internal (CVE-2023-6780)
 
+  GLIBC-SA-2024-0004:
+    ISO-2022-CN-EXT: fix out-of-bound writes when writing escape
+    sequence (CVE-2024-2961)
+
+  GLIBC-SA-2024-0005:
+    nscd: Stack-based buffer overflow in netgroup cache (CVE-2024-33599)
+
+  GLIBC-SA-2024-0006:
+    nscd: Null pointer crashes after notfound response
+    (CVE-2024-33600)
+
+  GLIBC-SA-2024-0007:
+    nscd: netgroup cache may terminate daemon on memory allocation
+    failure (CVE-2024-33601)
+
+  GLIBC-SA-2024-0008:
+    nscd: netgroup cache assumes NSS callback uses in-buffer strings
+    (CVE-2024-33602)
+
 The following bugs are resolved with this release:
 
   [14522] localedata: fy_DE: LC_IDENTIFICATION data looks weird
diff --git a/Rules b/Rules
index c7db0a486958f00b679c41e3add789c7ab74c707..9010c5d5b269a805bfcf9965cc8f623cfd1065ba 100644 (file)
--- a/Rules
+++ b/Rules
@@ -188,6 +188,7 @@ binaries-all = $(binaries-all-notests) $(binaries-all-tests)
 binaries-static-notests = $(others-static)
 binaries-static-tests = $(tests-static) $(xtests-static)
 binaries-static = $(binaries-static-notests) $(binaries-static-tests)
+binaries-shared-2.0-tests = $(tests-2.0)
 ifeq (yesyes,$(have-fpie)$(build-shared))
 binaries-pie-tests = $(tests-pie) $(xtests-pie)
 binaries-pie-notests = $(others-pie)
@@ -215,7 +216,8 @@ binaries-malloc-hugetlb2-tests =
 endif
 
 binaries-pie = $(binaries-pie-tests) $(binaries-pie-notests)
-binaries-shared-tests = $(filter-out $(binaries-pie) $(binaries-static), \
+binaries-shared-tests = $(filter-out $(binaries-pie) $(binaries-static) \
+                                    $(binaries-shared-2.0-tests), \
                                     $(binaries-all-tests))
 binaries-shared-notests = $(filter-out $(binaries-pie) $(binaries-static), \
                                       $(binaries-all-notests))
@@ -235,6 +237,15 @@ $(addprefix $(objpfx),$(binaries-shared-tests)): %: %.o \
        $(+link-tests)
 endif
 
+# Linking test programs with crt1.o from glibc 2.0.
+ifneq "$(strip $(binaries-shared-2.0-tests))" ""
+$(addprefix $(objpfx),$(binaries-shared-2.0-tests)): %: %.o \
+  $(link-extra-libs-tests) \
+  $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
+  $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
+       $(+link-2.0-tests)
+endif
+
 ifneq "$(strip $(binaries-mcheck-tests))" ""
 $(addprefix $(objpfx),$(binaries-mcheck-tests)): %-mcheck: %.o \
   $(link-extra-libs-tests) \
diff --git a/advisories/GLIBC-SA-2024-0005 b/advisories/GLIBC-SA-2024-0005
new file mode 100644 (file)
index 0000000..a595966
--- /dev/null
@@ -0,0 +1,22 @@
+nscd: Stack-based buffer overflow in netgroup cache
+
+If the Name Service Cache Daemon's (nscd) fixed size cache is exhausted
+by client requests then a subsequent client request for netgroup data
+may result in a stack-based buffer overflow.  This flaw was introduced
+in glibc 2.15 when the cache was added to nscd.
+
+This vulnerability is only present in the nscd binary.
+
+CVE-Id: CVE-2024-33599
+Public-Date: 2024-04-23
+Vulnerable-Commit: 684ae515993269277448150a1ca70db3b94aa5bd (2.15)
+Fix-Commit: 69c58d5ef9f584ea198bd00f7964d364d0e6b921 (2.31-155)
+Fix-Commit: a77064893bfe8a701770e2f53a4d33805bc47a5a (2.32-141)
+Fix-Commit: 5c75001a96abcd50cbdb74df24c3f013188d076e (2.33-264)
+Fix-Commit: 52f73e5c4e29b14e79167272297977f360ae1e97 (2.34-460)
+Fix-Commit: 7a95873543ce225376faf13bb71c43dea6d24f86 (2.35-316)
+Fix-Commit: caa3151ca460bdd9330adeedd68c3112d97bffe4 (2.36-165)
+Fix-Commit: f75c298e747b2b8b41b1c2f551c011a52c41bfd1 (2.37-91)
+Fix-Commit: 5968aebb86164034b8f8421b4abab2f837a5bdaf (2.38-72)
+Fix-Commit: 1263d583d2e28afb8be53f8d6922f0842036f35d (2.39-35)
+Fix-Commit: 87801a8fd06db1d654eea3e4f7626ff476a9bdaa (2.40)
diff --git a/advisories/GLIBC-SA-2024-0006 b/advisories/GLIBC-SA-2024-0006
new file mode 100644 (file)
index 0000000..d44148d
--- /dev/null
@@ -0,0 +1,32 @@
+nscd: Null pointer crash after notfound response
+
+If the Name Service Cache Daemon's (nscd) cache fails to add a not-found
+netgroup response to the cache, the client request can result in a null
+pointer dereference.  This flaw was introduced in glibc 2.15 when the
+cache was added to nscd.
+
+This vulnerability is only present in the nscd binary.
+
+CVE-Id: CVE-2024-33600
+Public-Date: 2024-04-24
+Vulnerable-Commit: 684ae515993269277448150a1ca70db3b94aa5bd (2.15)
+Fix-Commit: b048a482f088e53144d26a61c390bed0210f49f2 (2.40)
+Fix-Commit: 7835b00dbce53c3c87bbbb1754a95fb5e58187aa (2.40)
+Fix-Commit: c99f886de54446cd4447db6b44be93dabbdc2f8b (2.39-37)
+Fix-Commit: 5a508e0b508c8ad53bd0d2fb48fd71b242626341 (2.39-36)
+Fix-Commit: 2ae9446c1b7a3064743b4a51c0bbae668ee43e4c (2.38-74)
+Fix-Commit: 541ea5172aa658c4bd5c6c6d6fd13903c3d5bb0a (2.38-73)
+Fix-Commit: a8070b31043c7585c36ba68a74298c4f7af075c3 (2.37-93)
+Fix-Commit: 5eea50c4402e39588de98aa1d4469a79774703d4 (2.37-92)
+Fix-Commit: f205b3af56740e3b014915b1bd3b162afe3407ef (2.36-167)
+Fix-Commit: c34f470a615b136170abd16142da5dd0c024f7d1 (2.36-166)
+Fix-Commit: bafadc589fbe21ae330e8c2af74db9da44a17660 (2.35-318)
+Fix-Commit: 4370bef52b0f3f3652c6aa13d7a9bb3ac079746d (2.35-317)
+Fix-Commit: 1f94122289a9bf7dba573f5d60327aaa2b85cf2e (2.34-462)
+Fix-Commit: 966d6ac9e40222b84bb21674cc4f83c8d72a5a26 (2.34-461)
+Fix-Commit: e3eef1b8fbdd3a7917af466ca9c4b7477251ca79 (2.33-266)
+Fix-Commit: f20a8d696b13c6261b52a6434899121f8b19d5a7 (2.33-265)
+Fix-Commit: be602180146de37582a3da3a0caa4b719645de9c (2.32-143)
+Fix-Commit: 394eae338199078b7961b051c191539870742d7b (2.32-142)
+Fix-Commit: 8d7949183760170c61e55def723c1d8050187874 (2.31-157)
+Fix-Commit: 304ce5fe466c4762b21b36c26926a4657b59b53e (2.31-156)
diff --git a/advisories/GLIBC-SA-2024-0007 b/advisories/GLIBC-SA-2024-0007
new file mode 100644 (file)
index 0000000..b6928fa
--- /dev/null
@@ -0,0 +1,28 @@
+nscd: netgroup cache may terminate daemon on memory allocation failure
+
+The Name Service Cache Daemon's (nscd) netgroup cache uses xmalloc or
+xrealloc and these functions may terminate the process due to a memory
+allocation failure resulting in a denial of service to the clients.  The
+flaw was introduced in glibc 2.15 when the cache was added to nscd.
+
+This vulnerability is only present in the nscd binary.
+
+Subsequent refactoring of the netgroup cache only added more uses of
+xmalloc and xrealloc. Uses of xmalloc and xrealloc in other parts of
+nscd only occur during startup of the daemon and so are not affected by
+client requests that could trigger an out of memory followed by
+termination.
+
+CVE-Id: CVE-2024-33601
+Public-Date: 2024-04-24
+Vulnerable-Commit: 684ae515993269277448150a1ca70db3b94aa5bd (2.15)
+Fix-Commit: c04a21e050d64a1193a6daab872bca2528bda44b (2.40)
+Fix-Commit: a9a8d3eebb145779a18d90e3966009a1daa63cd8 (2.39-38)
+Fix-Commit: 71af8ca864345d39b746d5cee84b94b430fad5db (2.38-75)
+Fix-Commit: 6e106dc214d6a033a4e945d1c6cf58061f1c5f1f (2.37-94)
+Fix-Commit: b6742463694b1dfdd5120b91ee21cf05d15ec2e2 (2.36-168)
+Fix-Commit: 7a5864cac60e06000394128a5a2817b03542f5a3 (2.35-319)
+Fix-Commit: 86f1d5f4129c373ac6fb6df5bcf38273838843cb (2.34-463)
+Fix-Commit: 4d27d4b9a188786fc6a56745506cec2acfc51f83 (2.33-267)
+Fix-Commit: 3ed195a8ec89da281e3c4bf887a13d281b72d8f4 (2.32-144)
+Fix-Commit: bbf5a58ccb55679217f94de706164d15372fbbc0 (2.31-158)
diff --git a/advisories/GLIBC-SA-2024-0008 b/advisories/GLIBC-SA-2024-0008
new file mode 100644 (file)
index 0000000..d93e2a6
--- /dev/null
@@ -0,0 +1,26 @@
+nscd: netgroup cache assumes NSS callback uses in-buffer strings
+
+The Name Service Cache Daemon's (nscd) netgroup cache can corrupt memory
+when the NSS callback does not store all strings in the provided buffer.
+The flaw was introduced in glibc 2.15 when the cache was added to nscd.
+
+This vulnerability is only present in the nscd binary.
+
+There is no guarantee from the NSS callback API that the returned
+strings are all within the buffer. However, the netgroup cache code
+assumes that the NSS callback uses in-buffer strings and if it doesn't
+the buffer resizing logic could lead to potential memory corruption.
+
+CVE-Id: CVE-2024-33602
+Public-Date: 2024-04-24
+Vulnerable-Commit: 684ae515993269277448150a1ca70db3b94aa5bd (2.15)
+Fix-Commit: c04a21e050d64a1193a6daab872bca2528bda44b (2.40)
+Fix-Commit: a9a8d3eebb145779a18d90e3966009a1daa63cd8 (2.39-38)
+Fix-Commit: 71af8ca864345d39b746d5cee84b94b430fad5db (2.38-75)
+Fix-Commit: 6e106dc214d6a033a4e945d1c6cf58061f1c5f1f (2.37-94)
+Fix-Commit: b6742463694b1dfdd5120b91ee21cf05d15ec2e2 (2.36-168)
+Fix-Commit: 7a5864cac60e06000394128a5a2817b03542f5a3 (2.35-319)
+Fix-Commit: 86f1d5f4129c373ac6fb6df5bcf38273838843cb (2.34-463)
+Fix-Commit: 4d27d4b9a188786fc6a56745506cec2acfc51f83 (2.33-267)
+Fix-Commit: 3ed195a8ec89da281e3c4bf887a13d281b72d8f4 (2.32-144)
+Fix-Commit: bbf5a58ccb55679217f94de706164d15372fbbc0 (2.31-158)
index 946fd910314296262f5a3bf29a66a3e94ca0defb..777d6720a70bef5ab7003ab3a0707d10792f7a99 100644 (file)
@@ -42,6 +42,7 @@ csu-dummies = $(filter-out $(start-installed-name),crt1.o Mcrt1.o)
 extra-objs = \
   $(csu-dummies) \
   $(start-installed-name) \
+  $(start-name-2.0) \
   S$(start-installed-name) \
   g$(start-installed-name) \
   start.o \
@@ -182,6 +183,9 @@ ifndef start-installed-name-rule
 $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
                                  $(objpfx)init.o $(objpfx)static-reloc.o
        $(link-relocatable)
+$(objpfx)$(start-name-2.0): $(objpfx)start.o $(objpfx)abi-note.o \
+                           $(objpfx)static-reloc.o
+       $(link-relocatable)
 $(objpfx)r$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
                                  $(objpfx)init.o
        $(link-relocatable)
index 1616c635d53344f76b2ffdc8bad6abe9f6031c5d..7bdb4d0ea9809ad28c266ed408894ab57d552509 100644 (file)
@@ -300,8 +300,6 @@ __hurd_at_flags (int *at_flags, int *flags)
     *flags &= ~O_NOLINK;
   *at_flags &= ~AT_SYMLINK_FOLLOW;
 
-  if (*at_flags & AT_NO_AUTOMOUNT)
-    *flags |= O_NOTRANS;
   *at_flags &= ~AT_NO_AUTOMOUNT;
 
   if (*at_flags != 0)
index 27623c92a941fd050f5f3225f4b3758b83b34a43..0c1f16ee3b54c2d32fe930aed398c2a049d8175b 100644 (file)
@@ -68,22 +68,76 @@ routines_no_fortify += \
   wprintf \
   # routines_no_fortify
 
-tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
-       tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \
-       tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf           \
-       tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof          \
-       tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
-       tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
-       tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
-       bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
-       tst-memstream1 tst-memstream2 tst-memstream3 tst-memstream4 \
-       tst-wmemstream1 tst-wmemstream2 tst-wmemstream3 tst-wmemstream4 \
-       tst-wmemstream5 bug-memstream1 bug-wmemstream1 \
-       tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
-       tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
-       tst-ftell-append tst-fputws tst-bz22415 tst-fgetc-after-eof \
-       tst-sprintf-ub tst-sprintf-chk-ub tst-bz24051 tst-bz24153 \
-       tst-wfile-sync tst-bz28828 tst-getdelim
+tests = \
+  bug-fopena+ \
+  bug-fseek \
+  bug-ftell \
+  bug-memstream1 \
+  bug-mmap-fflush \
+  bug-rewind \
+  bug-rewind2 \
+  bug-ungetc \
+  bug-ungetc2 \
+  bug-ungetc3 \
+  bug-ungetc4 \
+  bug-ungetwc1 \
+  bug-ungetwc2 \
+  bug-wfflush \
+  bug-wmemstream1 \
+  bug-wsetpos \
+  test-fmemopen \
+  tst-atime \
+  tst-bz22415 \
+  tst-bz24051 \
+  tst-bz24153 \
+  tst-bz28828 \
+  tst-eof \
+  tst-ext \
+  tst-ext2 \
+  tst-fgetc-after-eof \
+  tst-fgetwc \
+  tst-fgetws \
+  tst-fopenloc2 \
+  tst-fputws \
+  tst-freopen \
+  tst-fseek \
+  tst-ftell-active-handler \
+  tst-ftell-append \
+  tst-ftell-partial-wide \
+  tst-fwrite-error \
+  tst-getdelim \
+  tst-memstream1 \
+  tst-memstream2 \
+  tst-memstream3 \
+  tst-memstream4 \
+  tst-mmap-eofsync \
+  tst-mmap-fflushsync \
+  tst-mmap-offend \
+  tst-mmap-setvbuf \
+  tst-mmap2-eofsync \
+  tst-popen1 \
+  tst-setvbuf1 \
+  tst-sprintf-chk-ub \
+  tst-sprintf-ub \
+  tst-sscanf \
+  tst-swscanf \
+  tst-ungetwc1 \
+  tst-ungetwc2 \
+  tst-wfile-sync \
+  tst-widetext \
+  tst-wmemstream1 \
+  tst-wmemstream2 \
+  tst-wmemstream3 \
+  tst-wmemstream4 \
+  tst-wmemstream5 \
+  tst_getwc \
+  tst_putwc \
+  tst_swprintf \
+  tst_swscanf \
+  tst_wprintf \
+  tst_wprintf2 \
+  tst_wscanf \
+  # tests
 
 tests-internal = tst-vtables tst-vtables-interposed
 
@@ -212,6 +266,12 @@ aux        := fileops genops stdfiles stdio strops
 ifeq ($(build-shared),yes)
 generated += tst-bz24228.mtrace tst-bz24228.check
 aux    += oldfileops oldstdfiles
+tests += \
+  tst-stderr-compat \
+# tests
+tests-2.0 += \
+  tst-stderr-compat \
+# tests-2.0
 endif
 
 shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops   \
@@ -229,16 +289,26 @@ tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out \
                 $(objpfx)tst-bz24228-mem.out
 endif
 
-tests += tst-cleanup-default tst-cleanup-default-static
+tests += \
+  tst-cleanup-default \
+  tst-cleanup-default-static \
+  # tests
 tests-static += tst-cleanup-default-static
 tests-special += $(objpfx)tst-cleanup-default-cmp.out $(objpfx)tst-cleanup-default-static-cmp.out
 LDFLAGS-tst-cleanup-default = -Wl,--gc-sections
 LDFLAGS-tst-cleanup-default-static = -Wl,--gc-sections
 
 ifeq ($(have-gnu-retain)$(have-z-start-stop-gc),yesyes)
-tests += tst-cleanup-start-stop-gc tst-cleanup-start-stop-gc-static \
-               tst-cleanup-nostart-stop-gc tst-cleanup-nostart-stop-gc-static
-tests-static += tst-cleanup-start-stop-gc-static tst-cleanup-nostart-stop-gc-static
+tests += \
+  tst-cleanup-nostart-stop-gc \
+  tst-cleanup-nostart-stop-gc-static \
+  tst-cleanup-start-stop-gc \
+  tst-cleanup-start-stop-gc-static \
+  # tests
+tests-static += \
+  tst-cleanup-nostart-stop-gc-static \
+  tst-cleanup-start-stop-gc-static \
+  # tests-static
 tests-special += $(objpfx)tst-cleanup-start-stop-gc-cmp.out \
                $(objpfx)tst-cleanup-start-stop-gc-static-cmp.out \
                $(objpfx)tst-cleanup-nostart-stop-gc-cmp.out \
diff --git a/libio/tst-stderr-compat.c b/libio/tst-stderr-compat.c
new file mode 100644 (file)
index 0000000..8221415
--- /dev/null
@@ -0,0 +1,52 @@
+/* Test that fclose works on stderr from glibc 2.0.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+
+#if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
+# define _LIBC
+# define _IO_USE_OLD_IO_FILE
+# include <stdio.h>
+# include <support/check.h>
+
+extern FILE _IO_stderr_;
+compat_symbol_reference (libc, _IO_stderr_, _IO_stderr_, GLIBC_2_0);
+compat_symbol_reference (libc, fclose, fclose, GLIBC_2_0);
+
+__attribute__ ((weak, noclone, noinline))
+void
+do_fclose (FILE *fp)
+{
+  TEST_VERIFY_EXIT (fclose (fp) == 0);
+}
+
+static int
+do_test (void)
+{
+  do_fclose (&_IO_stderr_);
+  return 0;
+}
+#else
+static int
+do_test (void)
+{
+  return 0;
+}
+#endif
+
+#include <support/test-driver.c>
index a9fef9e2db7e321d9af03dc9b538fb72d57ba98e..435939aedb95880d19d5dc62e3171f898b4fd761 100644 (file)
@@ -566,6 +566,9 @@ tests += \
   test-matherr \
   test-matherr-2 \
   # tests
+tests-2.0 += \
+  test-matherr-2 \
+  # tests-2.0
 endif
 
 # These tests use internal (unexported) GMP functions and are linked
index e8fe041846b75cb9ae314d90ed6ab254821e7bf9..5fdcf4204ef73dd27dd74e6a1e1aefdec15621c0 100644 (file)
@@ -522,7 +522,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
   if (__glibc_unlikely (dataset == NULL))
     {
       cacheable = false;
-      /* The alloca is safe because nscd_run_worker verfies that
+      /* The alloca is safe because nscd_run_worker verifies that
         key_len is not larger than MAXKEYLEN.  */
       dataset = alloca (sizeof (*dataset) + req->key_len);
     }
@@ -680,8 +680,8 @@ readdinnetgr (struct database_dyn *db, struct hashentry *he,
       .key_len = he->len
     };
 
-  int timeout = addinnetgrX (db, -1, &req, db->data + he->key, he->owner,
-                            he, dh);
+  time_t timeout = addinnetgrX (db, -1, &req, db->data + he->key, he->owner,
+                               he, dh);
   if (timeout < 0)
     timeout = 0;
   return timeout;
index 35dac538e5321d3a90c210cfedff99ea02ebb21f..38eb9f2dd226c3a61796c7b11720435b0fda1dec 100755 (executable)
@@ -362,8 +362,9 @@ class Context(object):
                         gcc_cfg=['--enable-obsolete'])
         self.add_config(arch='or1k',
                         os_name='linux-gnu',
-                        variant='soft',
-                        gcc_cfg=['--with-multilib-list=mcmov'])
+                        gcc_cfg=['--with-multilib-list=mcmov,mhard-float'],
+                        glibcs=[{'variant': 'soft'},
+                                {'variant': 'hard', 'ccopts': '-mhard-float'}])
         self.add_config(arch='powerpc',
                         os_name='linux-gnu',
                         gcc_cfg=['--disable-multilib', '--enable-secureplt'],
index 5f2da91ebbd0adafb0d84ec503b0f902f566da5a..31782b66f95eac086affcff6c2498c3e0a21da90 100644 (file)
 #define IS_THUNDERX2(midr) (MIDR_IMPLEMENTOR(midr) == 'C'       \
                           && MIDR_PARTNUM(midr) == 0xaf)
 
-#define IS_NEOVERSE_N1(midr) (MIDR_IMPLEMENTOR(midr) == 'A'                  \
-                             && MIDR_PARTNUM(midr) == 0xd0c)
-#define IS_NEOVERSE_N2(midr) (MIDR_IMPLEMENTOR(midr) == 'A'                  \
-                             && MIDR_PARTNUM(midr) == 0xd49)
-#define IS_NEOVERSE_V1(midr) (MIDR_IMPLEMENTOR(midr) == 'A'                  \
-                             && MIDR_PARTNUM(midr) == 0xd40)
-
 #define IS_EMAG(midr) (MIDR_IMPLEMENTOR(midr) == 'P'                         \
                        && MIDR_PARTNUM(midr) == 0x000)
 
index 3e26f112d685e1482246baa932d368d215a0652f..79856d498af90f66a948460c92d1b14fedfa8aee 100644 (file)
@@ -26,7 +26,7 @@
 #define LEN    SRC+4
 
         .text
-#if defined PIC && IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
 ENTRY (__memcpy_chk)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
index f230359ad62b2443083d22f8b8def9fa29726986..effd958120082b0425afca41cb726bbbbf3777e3 100644 (file)
@@ -29,7 +29,7 @@
 #define SRC    DEST+4
 #define LEN    SRC+4
 
-#if defined PIC && IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
 ENTRY_CHK (__memmove_chk)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
index f02f5a6df763d4e9ad7b3ae191242c512c8941b2..ab06771ea0ca071f2a6feb724385012f80fde145 100644 (file)
@@ -27,7 +27,7 @@
 #define LEN    CHR+4
 
         .text
-#if defined PIC && IS_IN (libc)
+#if defined SHARED && IS_IN (libc)
 ENTRY_CHK (__memset_chk)
        movl    12(%esp), %eax
        cmpl    %eax, 16(%esp)
diff --git a/sysdeps/or1k/fpu/fclrexcpt.c b/sysdeps/or1k/fpu/fclrexcpt.c
new file mode 100644 (file)
index 0000000..44224f9
--- /dev/null
@@ -0,0 +1,44 @@
+/* Clear given exceptions in current floating-point environment.
+   OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feclearexcept (int excepts)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  /* Mask out unsupported bits/exceptions.  */
+  excepts &= FE_ALL_EXCEPT;
+
+  /* Read the complete control word.  */
+  _FPU_GETCW (cw);
+
+  cw_new = cw & ~excepts;
+
+  /* Put the new data in effect.  */
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (feclearexcept)
diff --git a/sysdeps/or1k/fpu/fegetenv.c b/sysdeps/or1k/fpu/fegetenv.c
new file mode 100644 (file)
index 0000000..70c75aa
--- /dev/null
@@ -0,0 +1,32 @@
+/* Store current floating-point environment.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+__fegetenv (fenv_t *envp)
+{
+  _FPU_GETCW (*envp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__fegetenv)
+weak_alias (__fegetenv, fegetenv)
+libm_hidden_weak (fegetenv)
diff --git a/sysdeps/or1k/fpu/fegetmode.c b/sysdeps/or1k/fpu/fegetmode.c
new file mode 100644 (file)
index 0000000..7fffd2e
--- /dev/null
@@ -0,0 +1,29 @@
+/* Store current floating-point control modes.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fegetmode (femode_t *modep)
+{
+  _FPU_GETCW (*modep);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/or1k/fpu/fegetround.c b/sysdeps/or1k/fpu/fegetround.c
new file mode 100644 (file)
index 0000000..7e993b9
--- /dev/null
@@ -0,0 +1,29 @@
+/* Return current rounding direction.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <get-rounding-mode.h>
+
+int
+__fegetround (void)
+{
+  return get_rounding_mode ();
+}
+libm_hidden_def (__fegetround)
+weak_alias (__fegetround, fegetround)
+libm_hidden_weak (fegetround)
diff --git a/sysdeps/or1k/fpu/feholdexcpt.c b/sysdeps/or1k/fpu/feholdexcpt.c
new file mode 100644 (file)
index 0000000..0036e41
--- /dev/null
@@ -0,0 +1,33 @@
+/* Store current floating-point environment and clear exceptions.
+   OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__feholdexcept (fenv_t *envp)
+{
+  libc_feholdexcept_or1k (envp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__feholdexcept)
+weak_alias (__feholdexcept, feholdexcept)
+libm_hidden_weak (feholdexcept)
diff --git a/sysdeps/or1k/fpu/fenv_private.h b/sysdeps/or1k/fpu/fenv_private.h
new file mode 100644 (file)
index 0000000..4f401e7
--- /dev/null
@@ -0,0 +1,199 @@
+/* Private floating point rounding and exceptions handling.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef OR1K_FENV_PRIVATE_H
+#define OR1K_FENV_PRIVATE_H 1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+static __always_inline void
+libc_feholdexcept_or1k (fenv_t *envp)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  /* Get and store the environment.  */
+  _FPU_GETCW (cw);
+  *envp = cw;
+
+  /* Clear the exception status flags.  */
+  cw_new = cw & ~FE_ALL_EXCEPT;
+
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+}
+
+#define libc_feholdexcept  libc_feholdexcept_or1k
+#define libc_feholdexceptf libc_feholdexcept_or1k
+#define libc_feholdexceptl libc_feholdexcept_or1k
+
+static __always_inline void
+libc_fesetround_or1k (int round)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  _FPU_GETCW (cw);
+  cw_new = cw & ~_FPU_FPCSR_RM_MASK;
+  cw_new |= round;
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+}
+
+#define libc_fesetround  libc_fesetround_or1k
+#define libc_fesetroundf libc_fesetround_or1k
+#define libc_fesetroundl libc_fesetround_or1k
+
+static __always_inline void
+libc_feholdexcept_setround_or1k (fenv_t *envp, int round)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  /* Get and store the environment.  */
+  _FPU_GETCW (cw);
+  *envp = cw;
+
+  /* Clear the status flags and rounding mode.  */
+  cw_new = cw & ~(FE_ALL_EXCEPT | _FPU_FPCSR_RM_MASK);
+
+  /* Set rounding mode.  */
+  cw_new |= round;
+
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+}
+
+#define libc_feholdexcept_setround  libc_feholdexcept_setround_or1k
+#define libc_feholdexcept_setroundf libc_feholdexcept_setround_or1k
+#define libc_feholdexcept_setroundl libc_feholdexcept_setround_or1k
+
+static __always_inline int
+libc_fetestexcept_or1k (int ex)
+{
+  fpu_control_t cw;
+
+  /* Get current control word.  */
+  _FPU_GETCW (cw);
+
+  /* Check if any of the queried exception flags are set.  */
+  return cw & ex & FE_ALL_EXCEPT;
+}
+
+#define libc_fetestexcept  libc_fetestexcept_or1k
+#define libc_fetestexceptf libc_fetestexcept_or1k
+#define libc_fetestexceptl libc_fetestexcept_or1k
+
+static __always_inline void
+libc_fesetenv_or1k (const fenv_t *envp)
+{
+  if (envp == FE_DFL_ENV)
+    _FPU_SETCW (_FPU_DEFAULT);
+  else
+    _FPU_SETCW (*envp);
+}
+
+#define libc_fesetenv  libc_fesetenv_or1k
+#define libc_fesetenvf libc_fesetenv_or1k
+#define libc_fesetenvl libc_fesetenv_or1k
+#define libc_feresetround_noex  libc_fesetenv_or1k
+#define libc_feresetround_noexf libc_fesetenv_or1k
+#define libc_feresetround_noexl libc_fesetenv_or1k
+
+static __always_inline int
+libc_feupdateenv_test_or1k (const fenv_t *envp, int ex)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+  int excepts;
+
+  /* Get current control word.  */
+  _FPU_GETCW (cw);
+
+  /* Merge current exception flags with the passed fenv.  */
+  excepts = cw & FE_ALL_EXCEPT;
+  cw_new = (envp == FE_DFL_ENV ? _FPU_DEFAULT : *envp) | excepts;
+
+  if (__glibc_unlikely (cw != cw_new))
+    _FPU_SETCW (cw_new);
+
+  /* Raise the exceptions if enabled in the new FP state.  */
+  if (__glibc_unlikely (excepts))
+    __feraiseexcept (excepts);
+
+  return excepts & ex;
+}
+
+#define libc_feupdateenv_test  libc_feupdateenv_test_or1k
+#define libc_feupdateenv_testf libc_feupdateenv_test_or1k
+#define libc_feupdateenv_testl libc_feupdateenv_test_or1k
+
+static __always_inline void
+libc_feupdateenv_or1k (const fenv_t *envp)
+{
+  libc_feupdateenv_test_or1k (envp, 0);
+}
+
+#define libc_feupdateenv  libc_feupdateenv_or1k
+#define libc_feupdateenvf libc_feupdateenv_or1k
+#define libc_feupdateenvl libc_feupdateenv_or1k
+
+static __always_inline void
+libc_feholdsetround_or1k (fenv_t *envp, int round)
+{
+  fpu_control_t cw;
+
+  _FPU_GETCW (cw);
+  *envp = cw;
+
+  /* Check whether rounding modes are different.  */
+  round = (cw ^ round) & _FPU_FPCSR_RM_MASK;
+
+  /* Set new rounding mode if different.  */
+  if (__glibc_unlikely (round != 0))
+    _FPU_SETCW (cw ^ round);
+}
+
+#define libc_feholdsetround  libc_feholdsetround_or1k
+#define libc_feholdsetroundf libc_feholdsetround_or1k
+#define libc_feholdsetroundl libc_feholdsetround_or1k
+
+static __always_inline void
+libc_feresetround_or1k (fenv_t *envp)
+{
+  fpu_control_t cw;
+  int round;
+
+  _FPU_GETCW (cw);
+
+  /* Check whether rounding modes are different.  */
+  round = (*envp ^ cw) & _FPU_FPCSR_RM_MASK;
+
+  /* Restore the rounding mode if it was changed.  */
+  if (__glibc_unlikely (round != 0))
+    _FPU_SETCW (cw ^ round);
+}
+
+#define libc_feresetround  libc_feresetround_or1k
+#define libc_feresetroundf libc_feresetround_or1k
+#define libc_feresetroundl libc_feresetround_or1k
+
+#include_next <fenv_private.h>
+
+#endif
diff --git a/sysdeps/or1k/fpu/fesetenv.c b/sysdeps/or1k/fpu/fesetenv.c
new file mode 100644 (file)
index 0000000..742ca71
--- /dev/null
@@ -0,0 +1,32 @@
+/* Install given floating-point environment.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fesetenv (const fenv_t *envp)
+{
+  libc_fesetenv_or1k (envp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__fesetenv)
+weak_alias (__fesetenv, fesetenv)
+libm_hidden_weak (fesetenv)
diff --git a/sysdeps/or1k/fpu/fesetexcept.c b/sysdeps/or1k/fpu/fesetexcept.c
new file mode 100644 (file)
index 0000000..43734ea
--- /dev/null
@@ -0,0 +1,35 @@
+/* Set given exception flags.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexcept (int excepts)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  _FPU_GETCW (cw);
+  cw_new = cw | (excepts & FE_ALL_EXCEPT);
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/or1k/fpu/fesetmode.c b/sysdeps/or1k/fpu/fesetmode.c
new file mode 100644 (file)
index 0000000..d455692
--- /dev/null
@@ -0,0 +1,39 @@
+/* Install given floating-point control modes.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetmode (const femode_t *modep)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  _FPU_GETCW (cw);
+  cw_new = cw & ~_FPU_FPCSR_RM_MASK;
+  if (modep == FE_DFL_MODE)
+    cw_new |= (_FPU_DEFAULT & _FPU_FPCSR_RM_MASK);
+  else
+    cw_new |= (*modep & _FPU_FPCSR_RM_MASK);
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/or1k/fpu/fesetround.c b/sysdeps/or1k/fpu/fesetround.c
new file mode 100644 (file)
index 0000000..c2ada98
--- /dev/null
@@ -0,0 +1,39 @@
+/* Set current rounding direction.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__fesetround (int round)
+{
+  switch (round)
+    {
+    case FE_TONEAREST:
+    case FE_TOWARDZERO:
+    case FE_DOWNWARD:
+    case FE_UPWARD:
+      libc_fesetround_or1k (round);
+      return 0;
+    default:
+      return round; /* A nonzero value.  */
+    }
+}
+libm_hidden_def (__fesetround)
+weak_alias (__fesetround, fesetround)
+libm_hidden_weak (fesetround)
diff --git a/sysdeps/or1k/fpu/feupdateenv.c b/sysdeps/or1k/fpu/feupdateenv.c
new file mode 100644 (file)
index 0000000..3355bf6
--- /dev/null
@@ -0,0 +1,33 @@
+/* Install given floating-point environment and raise exceptions.
+   OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+__feupdateenv (const fenv_t *envp)
+{
+  libc_feupdateenv_or1k (envp);
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__feupdateenv)
+weak_alias (__feupdateenv, feupdateenv)
+libm_hidden_weak (feupdateenv)
diff --git a/sysdeps/or1k/fpu/fgetexcptflg.c b/sysdeps/or1k/fpu/fgetexcptflg.c
new file mode 100644 (file)
index 0000000..a954f6a
--- /dev/null
@@ -0,0 +1,29 @@
+/* Store current state of exceptions.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fegetexceptflag (fexcept_t *flagp, int excepts)
+{
+  *flagp = libc_fetestexcept_or1k (excepts);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/or1k/fpu/fix-fp-int-convert-overflow.h b/sysdeps/or1k/fpu/fix-fp-int-convert-overflow.h
new file mode 100644 (file)
index 0000000..7810428
--- /dev/null
@@ -0,0 +1,38 @@
+/* Fix for conversion of floating point to integer overflow.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef FIX_FP_INT_CONVERT_OVERFLOW_H
+#define FIX_FP_INT_CONVERT_OVERFLOW_H  1
+
+/* The generic libgcc2.c conversions from floating point to long long
+   may not raise the correct exceptions on overflow (and may raise
+   spurious "inexact" exceptions even in non-overflow cases, see
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59412>).  */
+#define FIX_FLT_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT_LLONG_CONVERT_OVERFLOW 1
+
+#define FIX_DBL_LONG_CONVERT_OVERFLOW 0
+#define FIX_DBL_LLONG_CONVERT_OVERFLOW 1
+
+#define FIX_LDBL_LONG_CONVERT_OVERFLOW 0
+#define FIX_LDBL_LLONG_CONVERT_OVERFLOW 0
+
+#define FIX_FLT128_LONG_CONVERT_OVERFLOW 0
+#define FIX_FLT128_LLONG_CONVERT_OVERFLOW 0
+
+#endif /* fix-fp-int-convert-overflow.h */
diff --git a/sysdeps/or1k/fpu/fraiseexcpt.c b/sysdeps/or1k/fpu/fraiseexcpt.c
new file mode 100644 (file)
index 0000000..bbacfd5
--- /dev/null
@@ -0,0 +1,67 @@
+/* Raise given exceptions.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+#include <float.h>
+#include <math.h>
+
+int
+__feraiseexcept (int excepts)
+{
+  if (excepts == 0)
+    return 0;
+
+  /* Raise exceptions represented by EXPECTS.  */
+
+  if (excepts & FE_INEXACT)
+  {
+    float d = 1.0, x = 3.0;
+    __asm__ volatile ("lf.div.s %0, %0, %1" : "+r" (d) : "r" (x));
+  }
+
+  if (excepts & FE_UNDERFLOW)
+  {
+    float d = FLT_MIN;
+    __asm__ volatile ("lf.mul.s %0, %0, %0" : "+r" (d));
+  }
+
+  if (excepts & FE_OVERFLOW)
+  {
+    float d = FLT_MAX;
+    __asm__ volatile ("lf.mul.s %0, %0, %0" : "+r" (d) : "r" (d));
+  }
+
+  if (excepts & FE_DIVBYZERO)
+  {
+    float d = 1.0, x = 0.0;
+    __asm__ volatile ("lf.div.s %0, %0, %1" : "+r" (d) : "r" (x));
+  }
+
+  if (excepts & FE_INVALID)
+  {
+    float d = HUGE_VAL, x = 0.0;
+    __asm__ volatile ("lf.mul.s %0, %1, %0" : "+r" (d) : "r" (x));
+  }
+
+  /* Success.  */
+  return 0;
+}
+libm_hidden_def (__feraiseexcept)
+weak_alias (__feraiseexcept, feraiseexcept)
+libm_hidden_weak (feraiseexcept)
diff --git a/sysdeps/or1k/fpu/fsetexcptflg.c b/sysdeps/or1k/fpu/fsetexcptflg.c
new file mode 100644 (file)
index 0000000..c327e4c
--- /dev/null
@@ -0,0 +1,43 @@
+/* Set floating-point environment exception handling.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetexceptflag (const fexcept_t *flagp, int excepts)
+{
+  fpu_control_t cw;
+  fpu_control_t cw_new;
+
+  /* Get the current exceptions.  */
+  _FPU_GETCW (cw);
+
+  /* Make sure the flags we want restored are legal.  */
+  excepts &= FE_ALL_EXCEPT;
+
+  /* Now set selected bits from flagp. Note that we ignore all non-flag
+     bits from *flagp, so they don't matter.  */
+  cw_new = (cw & ~excepts) | (*flagp & excepts);
+
+  if (cw != cw_new)
+    _FPU_SETCW (cw_new);
+
+  /* Success.  */
+  return 0;
+}
diff --git a/sysdeps/or1k/fpu/ftestexcept.c b/sysdeps/or1k/fpu/ftestexcept.c
new file mode 100644 (file)
index 0000000..59f06af
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test exception in current environment.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <fenv.h>
+#include <fenv_private.h>
+
+int
+fetestexcept (int excepts)
+{
+  return libc_fetestexcept_or1k (excepts);
+}
+libm_hidden_def (fetestexcept)
diff --git a/sysdeps/or1k/fpu/get-rounding-mode.h b/sysdeps/or1k/fpu/get-rounding-mode.h
new file mode 100644 (file)
index 0000000..a66d553
--- /dev/null
@@ -0,0 +1,38 @@
+/* Determine floating-point rounding mode within libc.  OpenRISC version.
+
+   Copyright (C) 2024 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _OR1K_GET_ROUNDING_MODE_H
+#define _OR1K_GET_ROUNDING_MODE_H      1
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+/* Return the floating-point rounding mode.  */
+
+static inline int
+get_rounding_mode (void)
+{
+  fpu_control_t cw;
+
+  _FPU_GETCW (cw);
+  return cw & _FPU_FPCSR_RM_MASK;
+}
+
+#endif /* get-rounding-mode.h */
diff --git a/sysdeps/or1k/fpu/libm-test-ulps b/sysdeps/or1k/fpu/libm-test-ulps
new file mode 100644 (file)
index 0000000..948ec01
--- /dev/null
@@ -0,0 +1,1115 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+double: 1
+float: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+
+Function: "acosh":
+double: 2
+float: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+
+Function: "asin":
+double: 1
+float: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+
+Function: "asin_upward":
+double: 2
+float: 1
+
+Function: "asinh":
+double: 2
+float: 2
+
+Function: "asinh_downward":
+double: 3
+float: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+
+Function: "atan":
+double: 1
+float: 1
+
+Function: "atan2":
+float: 2
+
+Function: "atan2_downward":
+double: 5
+float: 2
+
+Function: "atan2_towardzero":
+double: 5
+float: 2
+
+Function: "atan2_upward":
+double: 8
+float: 2
+
+Function: "atan_downward":
+double: 1
+float: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+
+Function: "atanh":
+double: 2
+float: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+
+Function: "cabs":
+double: 1
+
+Function: "cabs_downward":
+double: 1
+
+Function: "cabs_towardzero":
+double: 1
+
+Function: "cabs_upward":
+double: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 7
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+
+Function: "carg":
+float: 1
+
+Function: "carg_downward":
+double: 5
+float: 2
+
+Function: "carg_towardzero":
+double: 5
+float: 2
+
+Function: "carg_upward":
+double: 8
+float: 2
+
+Function: Real part of "casin":
+double: 1
+float: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 7
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 7
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "catan_upward":
+double: 2
+float: 1
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 2
+float: 1
+
+Function: "cbrt":
+double: 4
+float: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+
+Function: Real part of "ccos_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+
+Function: Real part of "ccosh":
+double: 2
+float: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+
+Function: Real part of "ccosh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+
+Function: Real part of "cexp_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+
+Function: Real part of "cexp_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "cexp_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 3
+float: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+
+Function: Imaginary part of "clog":
+double: 1
+float: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+
+Function: Real part of "clog10_downward":
+double: 7
+float: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 8
+float: 4
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 5
+
+Function: Imaginary part of "clog10_towardzero":
+double: 8
+float: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+
+Function: Imaginary part of "clog10_upward":
+double: 5
+float: 4
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+
+Function: Imaginary part of "clog_downward":
+double: 5
+float: 2
+
+Function: Real part of "clog_towardzero":
+double: 8
+float: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 5
+float: 3
+
+Function: Real part of "clog_upward":
+double: 8
+float: 3
+
+Function: Imaginary part of "clog_upward":
+double: 8
+float: 2
+
+Function: "cos":
+double: 1
+float: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+
+Function: "cos_towardzero":
+double: 4
+float: 1
+
+Function: "cos_upward":
+double: 4
+float: 1
+
+Function: "cosh":
+double: 2
+float: 2
+
+Function: "cosh_downward":
+double: 3
+float: 1
+
+Function: "cosh_towardzero":
+double: 3
+float: 1
+
+Function: "cosh_upward":
+double: 2
+float: 2
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 2
+float: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+
+Function: Imaginary part of "cpow_upward":
+double: 2
+float: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_downward":
+double: 3
+float: 1
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+
+Function: Real part of "csinh":
+float: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+
+Function: Real part of "csinh_downward":
+double: 3
+float: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+
+Function: Real part of "csinh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 3
+float: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 3
+
+Function: Imaginary part of "ctan_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+
+Function: Imaginary part of "ctan_upward":
+double: 2
+float: 1
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+
+Function: Real part of "ctanh_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 3
+
+Function: Real part of "ctanh_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 2
+float: 3
+
+Function: "erf":
+double: 1
+float: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+
+Function: "erfc":
+double: 5
+float: 3
+
+Function: "erfc_downward":
+double: 5
+float: 6
+
+Function: "erfc_towardzero":
+double: 3
+float: 4
+
+Function: "erfc_upward":
+double: 5
+float: 6
+
+Function: "exp":
+double: 1
+float: 1
+
+Function: "exp10":
+double: 2
+float: 1
+
+Function: "exp10_downward":
+double: 3
+float: 1
+
+Function: "exp10_towardzero":
+double: 3
+float: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+
+Function: "exp2":
+double: 1
+
+Function: "exp2_downward":
+double: 1
+
+Function: "exp2_towardzero":
+double: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+
+Function: "expm1":
+double: 1
+float: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+
+Function: "expm1_upward":
+double: 1
+float: 1
+
+Function: "gamma":
+double: 4
+float: 7
+
+Function: "gamma_downward":
+double: 7
+float: 7
+
+Function: "gamma_towardzero":
+double: 7
+float: 7
+
+Function: "gamma_upward":
+double: 5
+float: 6
+
+Function: "hypot":
+double: 1
+float: 1
+
+Function: "hypot_downward":
+double: 1
+
+Function: "hypot_towardzero":
+double: 1
+
+Function: "hypot_upward":
+double: 1
+
+Function: "j0":
+double: 2
+float: 9
+
+Function: "j0_downward":
+double: 5
+float: 9
+
+Function: "j0_towardzero":
+double: 6
+float: 9
+
+Function: "j0_upward":
+double: 9
+float: 9
+
+Function: "j1":
+double: 4
+float: 9
+
+Function: "j1_downward":
+double: 5
+float: 8
+
+Function: "j1_towardzero":
+double: 4
+float: 8
+
+Function: "j1_upward":
+double: 9
+float: 9
+
+Function: "jn":
+double: 4
+float: 4
+
+Function: "jn_downward":
+double: 7
+float: 9
+
+Function: "jn_towardzero":
+double: 7
+float: 9
+
+Function: "jn_upward":
+double: 7
+float: 9
+
+Function: "lgamma":
+double: 4
+float: 7
+
+Function: "lgamma_downward":
+double: 7
+float: 7
+
+Function: "lgamma_towardzero":
+double: 7
+float: 7
+
+Function: "lgamma_upward":
+double: 5
+float: 6
+
+Function: "log10":
+double: 2
+float: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 1
+
+Function: "log10_upward":
+double: 2
+float: 2
+
+Function: "log1p":
+double: 1
+float: 1
+
+Function: "log1p_downward":
+double: 2
+float: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+
+Function: "log2":
+float: 1
+
+Function: "log2_downward":
+double: 1
+
+Function: "log2_towardzero":
+double: 1
+
+Function: "log2_upward":
+double: 1
+
+Function: "pow":
+double: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+
+Function: "pow_upward":
+double: 1
+float: 1
+
+Function: "sin":
+double: 1
+float: 1
+
+Function: "sin_downward":
+double: 4
+float: 1
+
+Function: "sin_towardzero":
+double: 3
+float: 1
+
+Function: "sin_upward":
+double: 7
+float: 1
+
+Function: "sincos":
+double: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+
+Function: "sincos_towardzero":
+double: 4
+float: 1
+
+Function: "sincos_upward":
+double: 1
+float: 1
+
+Function: "sinh":
+double: 2
+float: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+
+Function: "sinh_towardzero":
+double: 3
+float: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+
+Function: "tan":
+float: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+
+Function: "tanh":
+double: 2
+float: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+
+Function: "tanh_upward":
+double: 3
+float: 3
+
+Function: "tgamma":
+double: 9
+float: 8
+
+Function: "tgamma_downward":
+double: 9
+float: 9
+
+Function: "tgamma_towardzero":
+double: 9
+float: 8
+
+Function: "tgamma_upward":
+double: 9
+float: 8
+
+Function: "y0":
+double: 3
+float: 9
+
+Function: "y0_downward":
+double: 3
+float: 9
+
+Function: "y0_towardzero":
+double: 4
+float: 9
+
+Function: "y0_upward":
+double: 3
+float: 9
+
+Function: "y1":
+double: 3
+float: 9
+
+Function: "y1_downward":
+double: 6
+float: 9
+
+Function: "y1_towardzero":
+double: 3
+float: 9
+
+Function: "y1_upward":
+double: 7
+float: 9
+
+Function: "yn":
+double: 3
+float: 3
+
+Function: "yn_downward":
+double: 6
+float: 8
+
+Function: "yn_towardzero":
+double: 8
+float: 8
+
+Function: "yn_upward":
+double: 8
+float: 8
+
+# end of automatic generation
diff --git a/sysdeps/or1k/fpu/libm-test-ulps-name b/sysdeps/or1k/fpu/libm-test-ulps-name
new file mode 100644 (file)
index 0000000..7f72f7a
--- /dev/null
@@ -0,0 +1 @@
+OpenRISC hard-float
diff --git a/sysdeps/or1k/fpu_control.h b/sysdeps/or1k/fpu_control.h
new file mode 100644 (file)
index 0000000..f89364a
--- /dev/null
@@ -0,0 +1,89 @@
+/* FPU control word bits.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _FPU_CONTROL_H
+#define _FPU_CONTROL_H
+
+#ifndef __or1k_hard_float__
+
+# define _FPU_RESERVED 0xffffffff
+# define _FPU_DEFAULT  0x00000000
+# define _FPU_GETCW(cw) (cw) = 0
+# define _FPU_SETCW(cw) (void) (cw)
+
+#else /* __or1k_hard_float__ */
+
+/* Layout of FPCSR:
+
+   The bits of the FPCSR are defined as follows, this should help
+   explain how the masks below have come to be.
+
+   +-----------+----------------------------+-----+----+
+   |  32 - 12  | 11 10  9  8  7  6  5  4  3 | 2-1 |  0 |
+   +-----------+----------------------------+-----+----+
+   |  Reserved | DZ IN IV IX  Z QN SN UN OV | RM  | EE |
+   +-----------+----------------------------+-----+----+
+
+   Exception flags:
+
+     DZ - divide by zero flag.
+     IN - infinite flag.
+     IV - invalid flag.
+     IX - inexact flag.
+      Z - zero flag.
+     QN - qnan flag.
+     SN - snan flag.
+     UN - underflow flag.
+     OV - overflow flag.
+
+   Rounding modes:
+
+   The FPCSR bits 2-1 labeled above as RM specify the rounding mode.
+
+     00 - round to nearest
+     01 - round to zero
+     10 - round to positive infinity
+     11 - round to negative infinity
+
+   Enabling exceptions:
+
+     EE - set to enable FPU exceptions.
+
+ */
+
+# define _FPU_RESERVED 0xfffff000
+/* Default: rounding to nearest with exceptions disabled.  */
+# define _FPU_DEFAULT  0
+/* IEEE: Same as above with exceptions enabled.  */
+# define _FPU_IEEE     (_FPU_DEFAULT | 1)
+
+# define _FPU_FPCSR_RM_MASK (0x3 << 1)
+
+/* Macros for accessing the hardware control word.  */
+# define _FPU_GETCW(cw) __asm__ volatile ("l.mfspr %0,r0,20" : "=r" (cw))
+# define _FPU_SETCW(cw) __asm__ volatile ("l.mtspr r0,%0,20" : : "r" (cw))
+
+#endif /* __or1k_hard_float__ */
+
+/* Type of the control word.  */
+typedef unsigned int fpu_control_t;
+
+/* Default control word set at startup.  */
+extern fpu_control_t __fpu_control;
+
+#endif /* fpu_control.h */
diff --git a/sysdeps/or1k/libm-test-ulps-name b/sysdeps/or1k/libm-test-ulps-name
deleted file mode 100644 (file)
index 0af6591..0000000
+++ /dev/null
@@ -1 +0,0 @@
-OpenRISC
diff --git a/sysdeps/or1k/math-tests-snan-payload.h b/sysdeps/or1k/math-tests-snan-payload.h
new file mode 100644 (file)
index 0000000..62467a3
--- /dev/null
@@ -0,0 +1,26 @@
+/* Configuration for math tests: sNaN payloads.  OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef OR1K_MATH_TESTS_SNAN_PAYLOAD_H
+#define OR1K_MATH_TESTS_SNAN_PAYLOAD_H 1
+
+/* OpenRISC floating-point instructions do not preserve NaN
+   payloads.  */
+#define SNAN_TESTS_PRESERVE_PAYLOAD    0
+
+#endif /* math-tests-snan-payload.h */
diff --git a/sysdeps/or1k/math-tests-trap.h b/sysdeps/or1k/math-tests-trap.h
new file mode 100644 (file)
index 0000000..a95b42d
--- /dev/null
@@ -0,0 +1,27 @@
+/* Configuration for math tests: support for enabling exception traps.
+   OpenRISC version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef OR1K_MATH_TESTS_TRAP_H
+#define OR1K_MATH_TESTS_TRAP_H 1
+
+#include <fenv.h>
+
+#define EXCEPTION_ENABLE_SUPPORTED(EXCEPT)     ((EXCEPT) == 0)
+
+#endif /* math-tests-trap.h */
diff --git a/sysdeps/or1k/nofpu/libm-test-ulps-name b/sysdeps/or1k/nofpu/libm-test-ulps-name
new file mode 100644 (file)
index 0000000..76c66a0
--- /dev/null
@@ -0,0 +1 @@
+OpenRISC soft-float
index d17fd3773031153ea5dca9fca20b29c0b5b07df0..70aa421ef0e32b3d5cbf58ab4aec8e1d05852dea 100644 (file)
 
 #define FP_ROUNDMODE (_fpcsr & FP_RND_MASK)
 
+#ifdef __or1k_hard_float__
+#define FP_INIT_ROUNDMODE                                      \
+do {                                                           \
+  __asm__ volatile ("l.mfspr %0,r0,20" : "=r" (_fpcsr));       \
+} while (0)
+
+#define FP_HANDLE_EXCEPTIONS                                   \
+do {                                                           \
+  if (__builtin_expect (_fex, 0))                              \
+    {                                                          \
+      _fpcsr &= ~FP_EX_ALL;                                    \
+      _fpcsr |= _fex;                                          \
+      __asm__ volatile ("l.mtspr r0,%0,20" : : "r" (_fpcsr));  \
+    }                                                          \
+} while (0)
+#endif /* __or1k_hard_float__ */
+
 #define _FP_TININESS_AFTER_ROUNDING 0
diff --git a/sysdeps/powerpc/powerpc64/le/power10/strncmp.S b/sysdeps/powerpc/powerpc64/le/power10/strncmp.S
new file mode 100644 (file)
index 0000000..d4ba76a
--- /dev/null
@@ -0,0 +1,271 @@
+/* Optimized strncmp implementation for PowerPC64/POWER10.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* Implements the function
+
+   int [r3] strncmp (const char *s1 [r3], const char *s2 [r4], size_t [r5] n)
+
+   The implementation uses unaligned doubleword access to avoid specialized
+   code paths depending of data alignment for first 32 bytes and uses
+   vectorised loops after that.  */
+
+#ifndef STRNCMP
+# define STRNCMP strncmp
+#endif
+
+/* TODO: Change this to actual instructions when minimum binutils is upgraded
+   to 2.27.  Macros are defined below for these newer instructions in order
+   to maintain compatibility.  */
+
+#define LXVP(xtp,dq,ra)              \
+       .long(((6)<<(32-6))          \
+       | ((((xtp)-32)>>1)<<(32-10)) \
+       | ((1)<<(32-11))             \
+       | ((ra)<<(32-16))            \
+       | dq)
+
+#define COMPARE_16(vreg1,vreg2,offset) \
+       lxv       vreg1+32,offset(r3); \
+       lxv       vreg2+32,offset(r4); \
+       vcmpnezb. v7,vreg1,vreg2;      \
+       bne       cr6,L(different);    \
+       cmpldi    cr7,r5,16;           \
+       ble       cr7,L(ret0);         \
+       addi      r5,r5,-16;
+
+#define COMPARE_32(vreg1,vreg2,offset,label1,label2) \
+       LXVP(vreg1+32,offset,r3);                    \
+       LXVP(vreg2+32,offset,r4);                    \
+       vcmpnezb. v7,vreg1+1,vreg2+1;                \
+       bne       cr6,L(label1);                     \
+       vcmpnezb. v7,vreg1,vreg2;                    \
+       bne       cr6,L(label2);                     \
+       cmpldi    cr7,r5,32;                         \
+       ble       cr7,L(ret0);                       \
+       addi      r5,r5,-32;
+
+#define TAIL_FIRST_16B(vreg1,vreg2) \
+       vctzlsbb r6,v7;             \
+       cmpld    cr7,r5,r6;         \
+       ble      cr7,L(ret0);       \
+       vextubrx r5,r6,vreg1;       \
+       vextubrx r4,r6,vreg2;       \
+       subf     r3,r4,r5;          \
+       blr;
+
+#define TAIL_SECOND_16B(vreg1,vreg2) \
+       vctzlsbb r6,v7;              \
+       addi     r0,r6,16;           \
+       cmpld    cr7,r5,r0;          \
+       ble      cr7,L(ret0);        \
+       vextubrx r5,r6,vreg1;        \
+       vextubrx r4,r6,vreg2;        \
+       subf     r3,r4,r5;           \
+       blr;
+
+#define CHECK_N_BYTES(reg1,reg2,len_reg) \
+       sldi      r6,len_reg,56;         \
+       lxvl      32+v4,reg1,r6;         \
+       lxvl      32+v5,reg2,r6;         \
+       add       reg1,reg1,len_reg;     \
+       add       reg2,reg2,len_reg;     \
+       vcmpnezb  v7,v4,v5;              \
+       vctzlsbb  r6,v7;                 \
+       cmpld     cr7,r6,len_reg;        \
+       blt       cr7,L(different);      \
+       cmpld     cr7,r5,len_reg;        \
+       ble       cr7,L(ret0);           \
+       sub       r5,r5,len_reg;         \
+
+       /* TODO: change this to .machine power10 when the minimum required
+        binutils allows it.  */
+       .machine  power9
+ENTRY_TOCLESS (STRNCMP, 4)
+       /* Check if size is 0.  */
+       cmpdi    cr0,r5,0
+       beq      cr0,L(ret0)
+       andi.   r7,r3,4095
+       andi.   r8,r4,4095
+       cmpldi  cr0,r7,4096-16
+       cmpldi  cr1,r8,4096-16
+       bgt     cr0,L(crosses)
+       bgt     cr1,L(crosses)
+       COMPARE_16(v4,v5,0)
+       addi    r3,r3,16
+       addi    r4,r4,16
+
+L(crosses):
+       andi.    r7,r3,15
+       subfic   r7,r7,16       /* r7(nalign1) = 16 - (str1 & 15).  */
+       andi.    r9,r4,15
+       subfic   r8,r9,16       /* r8(nalign2) = 16 - (str2 & 15).  */
+       cmpld    cr7,r7,r8
+       beq      cr7,L(same_aligned)
+       blt      cr7,L(nalign1_min)
+
+       /* nalign2 is minimum and s2 pointer is aligned.  */
+       CHECK_N_BYTES(r3,r4,r8)
+       /* Are we on the 64B hunk which crosses a page?  */
+       andi.   r10,r3,63       /* Determine offset into 64B hunk.  */
+       andi.   r8,r3,15        /* The offset into the 16B hunk.  */
+       neg     r7,r3
+       andi.   r9,r7,15        /* Number of bytes after a 16B cross.  */
+       rlwinm. r7,r7,26,0x3F   /* ((r4-4096))>>6&63.  */
+       beq     L(compare_64_pagecross)
+       mtctr   r7
+       b       L(compare_64B_unaligned)
+
+       /* nalign1 is minimum and s1 pointer is aligned.  */
+L(nalign1_min):
+       CHECK_N_BYTES(r3,r4,r7)
+       /* Are we on the 64B hunk which crosses a page?  */
+       andi.   r10,r4,63       /* Determine offset into 64B hunk.  */
+       andi.   r8,r4,15        /* The offset into the 16B hunk.  */
+       neg     r7,r4
+       andi.   r9,r7,15        /* Number of bytes after a 16B cross.  */
+       rlwinm. r7,r7,26,0x3F   /* ((r4-4096))>>6&63.  */
+       beq     L(compare_64_pagecross)
+       mtctr   r7
+
+       .p2align 5
+L(compare_64B_unaligned):
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       COMPARE_16(v4,v5,32)
+       COMPARE_16(v4,v5,48)
+       addi    r3,r3,64
+       addi    r4,r4,64
+       bdnz    L(compare_64B_unaligned)
+
+       /* Cross the page boundary of s2, carefully. Only for first
+       iteration we have to get the count of 64B blocks to be checked.
+       From second iteration and beyond, loop counter is always 63.  */
+L(compare_64_pagecross):
+       li      r11, 63
+       mtctr   r11
+       cmpldi  r10,16
+       ble     L(cross_4)
+       cmpldi  r10,32
+       ble     L(cross_3)
+       cmpldi  r10,48
+       ble     L(cross_2)
+L(cross_1):
+       CHECK_N_BYTES(r3,r4,r9)
+       CHECK_N_BYTES(r3,r4,r8)
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       COMPARE_16(v4,v5,32)
+       addi    r3,r3,48
+       addi    r4,r4,48
+       b       L(compare_64B_unaligned)
+L(cross_2):
+       COMPARE_16(v4,v5,0)
+       addi    r3,r3,16
+       addi    r4,r4,16
+       CHECK_N_BYTES(r3,r4,r9)
+       CHECK_N_BYTES(r3,r4,r8)
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       addi    r3,r3,32
+       addi    r4,r4,32
+       b       L(compare_64B_unaligned)
+L(cross_3):
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       addi    r3,r3,32
+       addi    r4,r4,32
+       CHECK_N_BYTES(r3,r4,r9)
+       CHECK_N_BYTES(r3,r4,r8)
+       COMPARE_16(v4,v5,0)
+       addi    r3,r3,16
+       addi    r4,r4,16
+       b       L(compare_64B_unaligned)
+L(cross_4):
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       COMPARE_16(v4,v5,32)
+       addi    r3,r3,48
+       addi    r4,r4,48
+       CHECK_N_BYTES(r3,r4,r9)
+       CHECK_N_BYTES(r3,r4,r8)
+       b       L(compare_64B_unaligned)
+
+L(same_aligned):
+       CHECK_N_BYTES(r3,r4,r7)
+       /* Align s1 to 32B and adjust s2 address.
+          Use lxvp only if both s1 and s2 are 32B aligned.  */
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       COMPARE_16(v4,v5,32)
+       COMPARE_16(v4,v5,48)
+       addi    r3,r3,64
+       addi    r4,r4,64
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       addi    r5,r5,32
+
+       clrldi  r6,r3,59
+       subfic  r7,r6,32
+       add     r3,r3,r7
+       add     r4,r4,r7
+       subf    r5,r7,r5
+       andi.   r7,r4,0x1F
+       beq     cr0,L(32B_aligned_loop)
+
+       .p2align 5
+L(16B_aligned_loop):
+       COMPARE_16(v4,v5,0)
+       COMPARE_16(v4,v5,16)
+       COMPARE_16(v4,v5,32)
+       COMPARE_16(v4,v5,48)
+       addi    r3,r3,64
+       addi    r4,r4,64
+       b       L(16B_aligned_loop)
+
+       /* Calculate and return the difference.  */
+L(different):
+       TAIL_FIRST_16B(v4,v5)
+
+       .p2align 5
+L(32B_aligned_loop):
+       COMPARE_32(v14,v16,0,tail1,tail2)
+       COMPARE_32(v18,v20,32,tail3,tail4)
+       COMPARE_32(v22,v24,64,tail5,tail6)
+       COMPARE_32(v26,v28,96,tail7,tail8)
+       addi    r3,r3,128
+       addi    r4,r4,128
+       b       L(32B_aligned_loop)
+
+L(tail1): TAIL_FIRST_16B(v15,v17)
+L(tail2): TAIL_SECOND_16B(v14,v16)
+L(tail3): TAIL_FIRST_16B(v19,v21)
+L(tail4): TAIL_SECOND_16B(v18,v20)
+L(tail5): TAIL_FIRST_16B(v23,v25)
+L(tail6): TAIL_SECOND_16B(v22,v24)
+L(tail7): TAIL_FIRST_16B(v27,v29)
+L(tail8): TAIL_SECOND_16B(v26,v28)
+
+       .p2align 5
+L(ret0):
+       li      r3,0
+       blr
+
+END(STRNCMP)
+libc_hidden_builtin_def(strncmp)
index a38ff464482258cc029d3cb53698137607def012..b847c1904989e27e18cfc05eb7cbb23d392b00a1 100644 (file)
@@ -34,7 +34,7 @@ ifneq (,$(filter %le,$(config-machine)))
 sysdep_routines += memchr-power10 memcmp-power10 memcpy-power10 \
                   memmove-power10 memset-power10 rawmemchr-power9 \
                   rawmemchr-power10 strcmp-power9 strcmp-power10 \
-                  strncmp-power9 strcpy-power9 stpcpy-power9 \
+                  strncmp-power9 strncmp-power10 strcpy-power9 stpcpy-power9 \
                   strlen-power9 strncpy-power9 stpncpy-power9 strlen-power10
 endif
 CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
index 30fd89e109d17a39d63ee5572c19fd8b06973ab4..2bb47d352778d404a1ac78eaca8dbca532b46c60 100644 (file)
@@ -164,6 +164,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c.  */
   IFUNC_IMPL (i, name, strncmp,
 #ifdef __LITTLE_ENDIAN__
+             IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_1
+                             && hwcap & PPC_FEATURE_HAS_VSX,
+                             __strncmp_power10)
              IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00
                              && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strncmp_power9)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp-power10.S b/sysdeps/powerpc/powerpc64/multiarch/strncmp-power10.S
new file mode 100644 (file)
index 0000000..d7026c1
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#if defined __LITTLE_ENDIAN__ && IS_IN (libc)
+#define STRNCMP __strncmp_power10
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/le/power10/strncmp.S>
+#endif
index 6178f4a432bb33a457dd5e18e54aab2944456d36..a5ed67f766317aa35590f24188184eabafbffc76 100644 (file)
@@ -29,6 +29,7 @@ extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
 extern __typeof (strncmp) __strncmp_power8 attribute_hidden;
 # ifdef __LITTLE_ENDIAN__
 extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
+extern __typeof (strncmp) __strncmp_power10 attribute_hidden;
 # endif
 # undef strncmp
 
@@ -36,6 +37,9 @@ extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strncmp, strncmp,
 # ifdef __LITTLE_ENDIAN__
+                       (hwcap2 & PPC_FEATURE2_ARCH_3_1
+                        && hwcap & PPC_FEATURE_HAS_VSX)
+                       ? __strncmp_power10 :
                        (hwcap2 & PPC_FEATURE2_ARCH_3_00
                         && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                        ? __strncmp_power9 :
index f9efb5076455e07e08b72e769d71666824d16ecb..04ea56559ef3a79bf334f1e783865a9c3960cdad 100644 (file)
@@ -282,6 +282,10 @@ tests += \
   tst-vfork2x \
   # tests
 
+tests-2.0 += \
+  tst-pthread_kill-exited
+  # tests-2.0
+
 tests-time64 += \
   tst-abstime-time64 \
   tst-cnd-timedwait-time64 \
diff --git a/sysdeps/unix/sysv/linux/or1k/Versions b/sysdeps/unix/sysv/linux/or1k/Versions
new file mode 100644 (file)
index 0000000..c1299de
--- /dev/null
@@ -0,0 +1,14 @@
+libc {
+  GLIBC_2.35 {
+    getcontext;
+    setcontext;
+    swapcontext;
+    makecontext;
+  }
+  GLIBC_2.40 {
+    getcontext;
+    setcontext;
+    swapcontext;
+    makecontext;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/or1k/getcontext-common.S b/sysdeps/unix/sysv/linux/or1k/getcontext-common.S
new file mode 100644 (file)
index 0000000..9187749
--- /dev/null
@@ -0,0 +1,88 @@
+/* Save current context.  OpenRISC common version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This common getcontext template helps define different
+   implementations using control macros.  Before including
+   this file in another file define the following:
+
+     __CONTEXT_FUNC_NAME
+     __CONTEXT_ENABLE_FPCSR
+     __CONTEXT_SIGMASK_OFFSET
+ */
+
+/* int getcontext (ucontext_t *ucp)
+
+   Returns 0 on success -1 and errno on failure.
+ */
+       .text
+ENTRY(__CONTEXT_FUNC_NAME)
+       /* Store r1, the stack pointer.  */
+       l.sw    (UCONTEXT_MCONTEXT +  1*4)(r3), r1
+       /* Store r2, the frame pointer.  */
+       l.sw    (UCONTEXT_MCONTEXT +  2*4)(r3), r2
+       /* Store r9, the link register.  */
+       l.sw    (UCONTEXT_MCONTEXT +  9*4)(r3), r9
+       /* Store r9 to reg[11] too, as we need two links for makecontext.  */
+       l.sw    (UCONTEXT_MCONTEXT + 11*4)(r3), r9
+       /* Store r10, the TLS register.  */
+       l.sw    (UCONTEXT_MCONTEXT + 10*4)(r3), r10
+       /* Store r14-r30 even, callee saved registers.  */
+       l.sw    (UCONTEXT_MCONTEXT + 14*4)(r3), r14
+       l.sw    (UCONTEXT_MCONTEXT + 16*4)(r3), r16
+       l.sw    (UCONTEXT_MCONTEXT + 18*4)(r3), r18
+       l.sw    (UCONTEXT_MCONTEXT + 20*4)(r3), r20
+       l.sw    (UCONTEXT_MCONTEXT + 22*4)(r3), r22
+       l.sw    (UCONTEXT_MCONTEXT + 24*4)(r3), r24
+       l.sw    (UCONTEXT_MCONTEXT + 26*4)(r3), r26
+       l.sw    (UCONTEXT_MCONTEXT + 28*4)(r3), r28
+       l.sw    (UCONTEXT_MCONTEXT + 30*4)(r3), r30
+
+#ifdef __CONTEXT_ENABLE_FPCSR
+# ifdef __or1k_hard_float__
+       /* Store the floating point state.  */
+       l.mfspr r4, r0, 20
+       l.sw    (MCONTEXT_FPCSR)(r3), r4
+# else
+       /* Store zero to indicate default rounding as per softfloat.  */
+       l.sw    (MCONTEXT_FPCSR)(r3), r0
+# endif /* __or1k_hard_float__ */
+#endif /* __CONTEXT_ENABLE_FPCSR */
+
+       /* Get signal mask.  */
+       /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
+       l.ori   r6, r0, _NSIG8
+       l.addi  r5, r3, __CONTEXT_SIGMASK_OFFSET
+       l.ori   r4, r0, 0
+       l.ori   r3, r0, SIG_BLOCK
+       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
+       /* Do the syscall.  */
+       l.sys   1
+        l.nop
+
+       /* if -4096 < ret < 0 holds, it's an error */
+       l.sfgeui r11, 0xf001
+       l.bf    1f
+        l.nop
+
+       l.jr    r9
+        l.ori r11, r0, 0
+
+1:     l.j     __syscall_error
+        l.ori  r3, r11, 0
+
+END(__CONTEXT_FUNC_NAME)
index a25b377bda46b00d3f00998ecb62d6498e64da77..da69e6999c99b4e6daecaf404c377a5db821cbae 100644 (file)
    <https://www.gnu.org/licenses/>.  */
 
 #include <sysdep.h>
+#include <shlib-compat.h>
 #include "ucontext_i.h"
 
-/* int getcontext (ucontext_t *ucp)
+#define __CONTEXT_FUNC_NAME __getcontext
+#define __CONTEXT_ENABLE_FPCSR 1
+#define __CONTEXT_SIGMASK_OFFSET UCONTEXT_SIGMASK
 
-   Returns 0 on success -1 and errno on failure.
- */
-       .text
-ENTRY(__getcontext)
-       /* Store r1, the stack pointer.  */
-       l.sw    (UCONTEXT_MCONTEXT +  1*4)(r3), r1
-       /* Store r2, the frame pointer.  */
-       l.sw    (UCONTEXT_MCONTEXT +  2*4)(r3), r2
-       /* Store r9, the link register.  */
-       l.sw    (UCONTEXT_MCONTEXT +  9*4)(r3), r9
-       /* Store r9 to reg[11] too, as we need two links for makecontext.  */
-       l.sw    (UCONTEXT_MCONTEXT + 11*4)(r3), r9
-       /* Store r10, the TLS register.  */
-       l.sw    (UCONTEXT_MCONTEXT + 10*4)(r3), r10
-       /* Store r14-r30 even, callee saved registers.  */
-       l.sw    (UCONTEXT_MCONTEXT + 14*4)(r3), r14
-       l.sw    (UCONTEXT_MCONTEXT + 16*4)(r3), r16
-       l.sw    (UCONTEXT_MCONTEXT + 18*4)(r3), r18
-       l.sw    (UCONTEXT_MCONTEXT + 20*4)(r3), r20
-       l.sw    (UCONTEXT_MCONTEXT + 22*4)(r3), r22
-       l.sw    (UCONTEXT_MCONTEXT + 24*4)(r3), r24
-       l.sw    (UCONTEXT_MCONTEXT + 26*4)(r3), r26
-       l.sw    (UCONTEXT_MCONTEXT + 28*4)(r3), r28
-       l.sw    (UCONTEXT_MCONTEXT + 30*4)(r3), r30
+#include "getcontext-common.S"
 
-       /* Get signal mask.  */
-       /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
-       l.ori   r6, r0, _NSIG8
-       l.addi  r5, r3, UCONTEXT_SIGMASK
-       l.ori   r4, r0, 0
-       l.ori   r3, r0, SIG_BLOCK
-       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
-       /* Do the syscall.  */
-       l.sys   1
-        l.nop
+versioned_symbol (libc, __getcontext, getcontext, GLIBC_2_40)
 
-       /* if -4096 < ret < 0 holds, it's an error */
-       l.sfgeui r11, 0xf001
-       l.bf    1f
-        l.nop
+#if SHLIB_COMPAT (libc, GLIBC_2_35, GLIBC_2_40)
 
-       l.jr    r9
-        l.ori r11, r0, 0
+/* Define a compat version of getcontext for glibc's before the fpcsr
+   field was added to mcontext_t.  The offset sigmask changed with this
+   introduction, the change was done because glibc's definition of
+   ucontext_t was initially defined incompatible with the Linux
+   definition of ucontext_t.  We keep the compatability definition to
+   allow getcontext, setcontext and swapcontext to work in older
+   binaries.  */
 
-1:     l.j     __syscall_error
-        l.ori  r3, r11, 0
+# undef __CONTEXT_FUNC_NAME
+# undef __CONTEXT_ENABLE_FPCSR
+# undef __CONTEXT_SIGMASK_OFFSET
+# define __CONTEXT_FUNC_NAME __getcontext_nofpcsr
+# define __CONTEXT_SIGMASK_OFFSET (UCONTEXT_SIGMASK - 4)
 
-END(__getcontext)
-weak_alias(__getcontext, getcontext)
+# include "getcontext-common.S"
+
+compat_symbol (libc, __getcontext_nofpcsr, getcontext, GLIBC_2_35)
+
+#endif
index c40c843aaf471d84604244b8d5b2168cfdeea72f..959e59e7e76b8db01f8ca55d5d5edec7003fd0b7 100644 (file)
@@ -2255,3 +2255,7 @@ GLIBC_2.39 stdc_trailing_zeros_ui F
 GLIBC_2.39 stdc_trailing_zeros_ul F
 GLIBC_2.39 stdc_trailing_zeros_ull F
 GLIBC_2.39 stdc_trailing_zeros_us F
+GLIBC_2.40 getcontext F
+GLIBC_2.40 makecontext F
+GLIBC_2.40 setcontext F
+GLIBC_2.40 swapcontext F
index fa6626e7deda8d3ea1f1ef15b6e62743e1d166b5..7e131bae418b003e52075ab1c9fa1580fc5c8a63 100644 (file)
@@ -16,6 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include <sysdep.h>
 #include <stdarg.h>
 #include <stdint.h>
      r1     : stack pointer
      r2     : frame pointer, set to NULL
 */
-void
-__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
+static void
+do_makecontext (ucontext_t *ucp, void (*startcontext) (void),
+               void (*func) (void), int argc, va_list ap)
 {
-  extern void __startcontext (void);
   unsigned long int *sp;
-  va_list ap;
   int i;
 
   sp = (unsigned long int *)
@@ -55,8 +55,8 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 
   /* Keep uc_link in r14.  */
   ucp->uc_mcontext.__gprs[14] = (uintptr_t) ucp->uc_link;
-  /* Return address points to function __startcontext.  */
-  ucp->uc_mcontext.__gprs[9] = (uintptr_t) &__startcontext;
+  /* Return address points to function startcontext.  */
+  ucp->uc_mcontext.__gprs[9] = (uintptr_t) startcontext;
   /* Frame pointer is null.  */
   ucp->uc_mcontext.__gprs[2] = (uintptr_t) 0;
   /* Restart in user-space starting at 'func'.  */
@@ -64,14 +64,47 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
   /* Set stack pointer.  */
   ucp->uc_mcontext.__gprs[1] = (uintptr_t) sp;
 
-  va_start (ap, argc);
   for (i = 0; i < argc; ++i)
     if (i < 6)
       ucp->uc_mcontext.__gprs[i + 3] = va_arg (ap, unsigned long int);
     else
       sp[i - 6] = va_arg (ap, unsigned long int);
+}
 
+void
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
+{
+  extern void __startcontext (void);
+  va_list ap;
+
+  va_start (ap, argc);
+  do_makecontext (ucp, &__startcontext, func, argc, ap);
   va_end (ap);
 }
 
-weak_alias (__makecontext, makecontext)
+versioned_symbol (libc, __makecontext, makecontext, GLIBC_2_40);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_35, GLIBC_2_40)
+
+/* Define a compat version of makecontext for glibc's before the fpcsr
+   field was added to mcontext_t.  The offset sigmask changed with this
+   introduction, the change was done because glibc's definition of
+   ucontext_t was initially defined incompatible with the Linux
+   definition of ucontext_t.  We keep the compatability definition to
+   allow getcontext, setcontext and swapcontext to work in older
+   binaries.  */
+
+void
+__makecontext_nofpcsr (ucontext_t *ucp, void (*func) (void), int argc, ...)
+{
+  extern void __startcontext_nofpcsr (void);
+  va_list ap;
+
+  va_start (ap, argc);
+  do_makecontext (ucp, &__startcontext_nofpcsr, func, argc, ap);
+  va_end (ap);
+}
+
+compat_symbol (libc, __makecontext_nofpcsr, makecontext, GLIBC_2_35);
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/or1k/setcontext-common.S b/sysdeps/unix/sysv/linux/or1k/setcontext-common.S
new file mode 100644 (file)
index 0000000..8a4f147
--- /dev/null
@@ -0,0 +1,120 @@
+/* Set current context.  OpenRISC common version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This common setcontext and startcontext template helps define
+   different implementations using control macros.  Before including
+   this file in another file define the following:
+
+     __CONTEXT_FUNC_NAME
+     __CONTEXT_ENABLE_FPCSR
+     __CONTEXT_SIGMASK_OFFSET
+     __STARTCONTEXT_FUNC_NAME
+ */
+
+/* int setcontext (const ucontext_t *ucp) */
+       .text
+ENTRY(__CONTEXT_FUNC_NAME)
+       l.ori   r30, r3, 0
+
+       /* Restore signal mask.  */
+       /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+       l.ori   r6, r0, _NSIG8
+       l.ori   r5, r0, 0
+       l.addi  r4, r3, __CONTEXT_SIGMASK_OFFSET
+       l.ori   r3, r0, SIG_SETMASK
+       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
+       /* Do the syscall.  */
+       l.sys 1
+        l.nop
+
+       /* if -4096 < ret < 0 holds, it's an error */
+       l.sfgeui r11, 0xf001
+       l.bf    1f
+        l.nop
+#ifdef __CONTEXT_ENABLE_FPCSR
+# ifdef __or1k_hard_float__
+       /* Restore the floating point state.  */
+       l.lwz   r28, (MCONTEXT_FPCSR)(r30)
+       l.mtspr r0, r28, 20
+# endif /* __or1k_hard_float__ */
+#endif /* __CONTEXT_ENABLE_FPCSR */
+       /* Restore argument registers, for the makecontext case.  */
+       l.lwz   r3, (UCONTEXT_MCONTEXT +  3*4)(r30)
+       l.lwz   r4, (UCONTEXT_MCONTEXT +  4*4)(r30)
+       l.lwz   r5, (UCONTEXT_MCONTEXT +  5*4)(r30)
+       l.lwz   r6, (UCONTEXT_MCONTEXT +  6*4)(r30)
+       l.lwz   r7, (UCONTEXT_MCONTEXT +  7*4)(r30)
+       l.lwz   r8, (UCONTEXT_MCONTEXT +  8*4)(r30)
+
+       /* Restore registers stored in getcontext.  */
+       l.lwz   r1,  (UCONTEXT_MCONTEXT +  1*4)(r30)
+       l.lwz   r2,  (UCONTEXT_MCONTEXT +  2*4)(r30)
+       l.lwz   r9,  (UCONTEXT_MCONTEXT +  9*4)(r30)
+       l.lwz   r10, (UCONTEXT_MCONTEXT + 10*4)(r30)
+       l.lwz   r11, (UCONTEXT_MCONTEXT + 11*4)(r30)
+       /* Restore r14-r30 even, callee saved registers.  */
+       l.lwz   r14, (UCONTEXT_MCONTEXT + 14*4)(r30)
+       l.lwz   r16, (UCONTEXT_MCONTEXT + 16*4)(r30)
+       l.lwz   r18, (UCONTEXT_MCONTEXT + 18*4)(r30)
+       l.lwz   r20, (UCONTEXT_MCONTEXT + 20*4)(r30)
+       l.lwz   r22, (UCONTEXT_MCONTEXT + 22*4)(r30)
+       l.lwz   r24, (UCONTEXT_MCONTEXT + 24*4)(r30)
+       l.lwz   r26, (UCONTEXT_MCONTEXT + 26*4)(r30)
+       l.lwz   r28, (UCONTEXT_MCONTEXT + 28*4)(r30)
+       l.lwz   r30, (UCONTEXT_MCONTEXT + 30*4)(r30)
+
+       l.jr    r11
+        l.ori  r11, r0, 0
+
+1:     l.j     __syscall_error
+        l.ori  r3, r11, 0
+
+END (__CONTEXT_FUNC_NAME)
+
+       /* We add a NOP here because when the unwinder is looking for the
+          enclosing function of the link register (r9) address FDE lookup will
+          use '$r9 - 1' finding setcontext which is wrong.  This is because in
+          makecontext we have set r9 to the start of &__startcontext.
+
+          If this NOP did not exist the unwinder would repeatedly find
+          __setcontext's FDE in an infinite loop.  Modifying/deleting the below
+          __startcontext's FDE has no help on this.  */
+       l.nop
+
+ENTRY(__STARTCONTEXT_FUNC_NAME)
+
+       l.ori   r3, r14, 0
+       l.sfeq  r3, r0
+       /* If uc_link is not 0 resume there, otherwise exit.  */
+       l.bnf   __CONTEXT_FUNC_NAME
+        l.nop
+
+#ifdef SHARED
+       /* Obtain a pointer to .got in r16 */
+       l.jal   0x8
+        l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
+       l.ori   r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
+       l.add   r16, r16, r9
+       l.lwz   r16, got(exit)(r16)
+       l.jr    r16
+#else
+       l.j     exit
+#endif
+        l.nop
+
+END(__STARTCONTEXT_FUNC_NAME)
index d28a0ac0aa28ec32b9fd03d779718cba2da6c805..a49a5c51c3be0736f2a88b1991a1fd065e3e132b 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include <sysdep.h>
 #include "ucontext_i.h"
 
-/* int setcontext (const ucontext_t *ucp) */
-       .text
-ENTRY(__setcontext)
-       l.ori   r30, r3, 0
+#define __CONTEXT_FUNC_NAME __setcontext
+#define __CONTEXT_ENABLE_FPCSR 1
+#define __CONTEXT_SIGMASK_OFFSET UCONTEXT_SIGMASK
+#define __STARTCONTEXT_FUNC_NAME __startcontext
 
-       /* Restore signal mask.  */
-       /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
-       l.ori   r6, r0, _NSIG8
-       l.ori   r5, r0, 0
-       l.addi  r4, r3, UCONTEXT_SIGMASK
-       l.ori   r3, r0, SIG_SETMASK
-       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
-       /* Do the syscall.  */
-       l.sys 1
-        l.nop
+#include "setcontext-common.S"
 
-       /* if -4096 < ret < 0 holds, it's an error */
-       l.sfgeui r11, 0xf001
-       l.bf    1f
-        l.nop
+versioned_symbol (libc, __setcontext, setcontext, GLIBC_2_40)
 
-       /* Restore argument registers, for the makecontext case.  */
-       l.lwz   r3, (UCONTEXT_MCONTEXT +  3*4)(r30)
-       l.lwz   r4, (UCONTEXT_MCONTEXT +  4*4)(r30)
-       l.lwz   r5, (UCONTEXT_MCONTEXT +  5*4)(r30)
-       l.lwz   r6, (UCONTEXT_MCONTEXT +  6*4)(r30)
-       l.lwz   r7, (UCONTEXT_MCONTEXT +  7*4)(r30)
-       l.lwz   r8, (UCONTEXT_MCONTEXT +  8*4)(r30)
+#if SHLIB_COMPAT (libc, GLIBC_2_35, GLIBC_2_40)
 
-       /* Restore registers stored in getcontext.  */
-       l.lwz   r1,  (UCONTEXT_MCONTEXT +  1*4)(r30)
-       l.lwz   r2,  (UCONTEXT_MCONTEXT +  2*4)(r30)
-       l.lwz   r9,  (UCONTEXT_MCONTEXT +  9*4)(r30)
-       l.lwz   r10, (UCONTEXT_MCONTEXT + 10*4)(r30)
-       l.lwz   r11, (UCONTEXT_MCONTEXT + 11*4)(r30)
-       /* Restore r14-r30 even, callee saved registers.  */
-       l.lwz   r14, (UCONTEXT_MCONTEXT + 14*4)(r30)
-       l.lwz   r16, (UCONTEXT_MCONTEXT + 16*4)(r30)
-       l.lwz   r18, (UCONTEXT_MCONTEXT + 18*4)(r30)
-       l.lwz   r20, (UCONTEXT_MCONTEXT + 20*4)(r30)
-       l.lwz   r22, (UCONTEXT_MCONTEXT + 22*4)(r30)
-       l.lwz   r24, (UCONTEXT_MCONTEXT + 24*4)(r30)
-       l.lwz   r26, (UCONTEXT_MCONTEXT + 26*4)(r30)
-       l.lwz   r28, (UCONTEXT_MCONTEXT + 28*4)(r30)
-       l.lwz   r30, (UCONTEXT_MCONTEXT + 30*4)(r30)
+/* Define a compat version of setcontext for glibc's before the fpcsr
+   field was added to mcontext_t.  The offset sigmask changed with this
+   introduction, the change was done because glibc's definition of
+   ucontext_t was initially defined incompatible with the Linux
+   definition of ucontext_t.  We keep the compatability definition to
+   allow getcontext, setcontext and swapcontext to work in older
+   binaries.  */
 
-       l.jr    r11
-        l.ori  r11, r0, 0
+# undef __CONTEXT_FUNC_NAME
+# undef __CONTEXT_ENABLE_FPCSR
+# undef __CONTEXT_SIGMASK_OFFSET
+# undef __STARTCONTEXT_FUNC_NAME
+# define __CONTEXT_FUNC_NAME __setcontext_nofpcsr
+# define __CONTEXT_SIGMASK_OFFSET (UCONTEXT_SIGMASK - 4)
+# define __STARTCONTEXT_FUNC_NAME __startcontext_nofpcsr
 
-1:     l.j     __syscall_error
-        l.ori  r3, r11, 0
+# include "setcontext-common.S"
 
-END (__setcontext)
-weak_alias (__setcontext, setcontext)
+compat_symbol (libc, __setcontext_nofpcsr, setcontext, GLIBC_2_35)
 
-       /* We add a NOP here because when the unwinder is looking for the
-          enclosing function of the link register (r9) address FDE lookup will
-          use '$r9 - 1' finding setcontext which is wrong.  This is because in
-          makecontext we have set r9 to the start of &__startcontext.
-
-          If this NOP did not exist the unwinder would repeatedly find
-          __setcontext's FDE in an infinite loop.  Modifying/deleting the below
-          __startcontext's FDE has no help on this.  */
-       l.nop
-
-ENTRY(__startcontext)
-
-       l.ori   r3, r14, 0
-       l.sfeq  r3, r0
-       /* If uc_link is not 0 resume there, otherwise exit.  */
-       l.bnf   __setcontext
-        l.nop
-
-#ifdef SHARED
-       /* Obtain a pointer to .got in r16 */
-       l.jal   0x8
-        l.movhi r16, gotpchi(_GLOBAL_OFFSET_TABLE_-4)
-       l.ori   r16, r16, gotpclo(_GLOBAL_OFFSET_TABLE_+0)
-       l.add   r16, r16, r9
-       l.lwz   r16, got(exit)(r16)
-       l.jr    r16
-#else
-       l.j     exit
 #endif
-        l.nop
-
-END(__startcontext)
diff --git a/sysdeps/unix/sysv/linux/or1k/swapcontext-common.S b/sysdeps/unix/sysv/linux/or1k/swapcontext-common.S
new file mode 100644 (file)
index 0000000..b7e2d4c
--- /dev/null
@@ -0,0 +1,139 @@
+/* Swap two contexts.  OpenRISC version.
+   Copyright (C) 2022-2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* This common swapcontext template helps define different
+   implementations using control macros.  Before including this file
+   in another file define the following:
+
+     __CONTEXT_FUNC_NAME
+     __CONTEXT_ENABLE_FPCSR
+     __CONTEXT_SIGMASK_OFFSET
+ */
+
+/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
+       .text
+ENTRY(__CONTEXT_FUNC_NAME)
+
+       /* Same as getcontext.  */
+       /* Store r1, the stack pointer.  */
+       l.sw    (UCONTEXT_MCONTEXT +  1*4)(r3), r1
+       /* Store r2, the frame pointer.  */
+       l.sw    (UCONTEXT_MCONTEXT +  2*4)(r3), r2
+       /* Store r9, the link register.  */
+       l.sw    (UCONTEXT_MCONTEXT +  9*4)(r3), r9
+       /* Store r9 to reg[11] too, as we need two links for makecontext.  */
+       l.sw    (UCONTEXT_MCONTEXT + 11*4)(r3), r9
+       /* Store r10, the TLS register.  */
+       l.sw    (UCONTEXT_MCONTEXT + 10*4)(r3), r10
+       /* Store r14-r30 even, callee saved registers.  */
+       l.sw    (UCONTEXT_MCONTEXT + 14*4)(r3), r14
+       l.sw    (UCONTEXT_MCONTEXT + 16*4)(r3), r16
+       l.sw    (UCONTEXT_MCONTEXT + 18*4)(r3), r18
+       l.sw    (UCONTEXT_MCONTEXT + 20*4)(r3), r20
+       l.sw    (UCONTEXT_MCONTEXT + 22*4)(r3), r22
+       l.sw    (UCONTEXT_MCONTEXT + 24*4)(r3), r24
+       l.sw    (UCONTEXT_MCONTEXT + 26*4)(r3), r26
+       l.sw    (UCONTEXT_MCONTEXT + 28*4)(r3), r28
+       l.sw    (UCONTEXT_MCONTEXT + 30*4)(r3), r30
+
+#ifdef __CONTEXT_ENABLE_FPCSR
+# ifdef __or1k_hard_float__
+       /* Store the floating point state.  */
+       l.mfspr r6, r0, 20
+       l.sw    (MCONTEXT_FPCSR)(r3), r6
+# else
+       /* Store zero to indicate default rounding as per softfloat.  */
+       l.sw    (MCONTEXT_FPCSR)(r3), r0
+# endif /* __or1k_hard_float__ */
+#endif /* __CONTEXT_ENABLE_FPCSR */
+       /* Store ucp to non-argument syscall preserved register.  */
+       l.ori   r30, r4, 0
+
+       /* Get signal mask.  */
+       /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
+       l.ori   r6, r0, _NSIG8
+       l.addi  r5, r3, __CONTEXT_SIGMASK_OFFSET
+       l.ori   r4, r0, 0
+       l.ori   r3, r0, SIG_BLOCK
+       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
+       /* Do the syscall.  */
+       l.sys   1
+        l.nop
+
+       /* if -4096 < ret < 0 holds, it's an error */
+       l.sfgeui r11, 0xf001
+       l.bf    1f
+        l.nop
+
+       /* Same as setcontext.  */
+
+       /* Restore signal mask.  */
+       /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
+       l.ori   r6, r0, _NSIG8
+       l.ori   r5, r0, 0
+       l.addi  r4, r30, __CONTEXT_SIGMASK_OFFSET
+       l.ori   r3, r0, SIG_SETMASK
+       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
+       /* Do the syscall.  */
+       l.sys 1
+        l.nop
+
+       /* if -4096 < ret < 0 holds, it's an error */
+       l.sfgeui r11, 0xf001
+       l.bf    1f
+        l.nop
+
+#ifdef __CONTEXT_ENABLE_FPCSR
+# ifdef __or1k_hard_float__
+       /* Restore the floating point state.  */
+       l.lwz   r28, (MCONTEXT_FPCSR)(r30)
+       l.mtspr r0, r28, 20
+# endif /* __or1k_hard_float__ */
+#endif /* __CONTEXT_ENABLE_FPCSR */
+
+       /* Restore argument registers, for the makecontext case.  */
+       l.lwz   r3, (UCONTEXT_MCONTEXT +  3*4)(r30)
+       l.lwz   r4, (UCONTEXT_MCONTEXT +  4*4)(r30)
+       l.lwz   r5, (UCONTEXT_MCONTEXT +  5*4)(r30)
+       l.lwz   r6, (UCONTEXT_MCONTEXT +  6*4)(r30)
+       l.lwz   r7, (UCONTEXT_MCONTEXT +  7*4)(r30)
+       l.lwz   r8, (UCONTEXT_MCONTEXT +  8*4)(r30)
+
+       /* Restore registers stored in getcontext.  */
+       l.lwz   r1,  (UCONTEXT_MCONTEXT +  1*4)(r30)
+       l.lwz   r2,  (UCONTEXT_MCONTEXT +  2*4)(r30)
+       l.lwz   r9,  (UCONTEXT_MCONTEXT +  9*4)(r30)
+       l.lwz   r10, (UCONTEXT_MCONTEXT + 10*4)(r30)
+       l.lwz   r11, (UCONTEXT_MCONTEXT + 11*4)(r30)
+       l.lwz   r14, (UCONTEXT_MCONTEXT + 14*4)(r30)
+       l.lwz   r16, (UCONTEXT_MCONTEXT + 16*4)(r30)
+       l.lwz   r18, (UCONTEXT_MCONTEXT + 18*4)(r30)
+       l.lwz   r20, (UCONTEXT_MCONTEXT + 20*4)(r30)
+       l.lwz   r22, (UCONTEXT_MCONTEXT + 22*4)(r30)
+       l.lwz   r24, (UCONTEXT_MCONTEXT + 24*4)(r30)
+       l.lwz   r26, (UCONTEXT_MCONTEXT + 26*4)(r30)
+       l.lwz   r28, (UCONTEXT_MCONTEXT + 28*4)(r30)
+       l.lwz   r30, (UCONTEXT_MCONTEXT + 30*4)(r30)
+
+       l.jr    r11
+        l.ori  r11, r0, 0
+
+1:     l.j     __syscall_error
+        l.ori  r3, r11, 0
+
+END (__CONTEXT_FUNC_NAME)
index d09651a5b253e3774d3c5b981d1a29b0c1fe6e7c..861c1e26ba197225861ec7e6956bb79c91a3be54 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include <sysdep.h>
 #include "ucontext_i.h"
 
-/* int swapcontext (ucontext_t *oucp, const ucontext_t *ucp) */
-       .text
-ENTRY(__swapcontext)
+#define __CONTEXT_FUNC_NAME __swapcontext
+#define __CONTEXT_ENABLE_FPCSR 1
+#define __CONTEXT_SIGMASK_OFFSET UCONTEXT_SIGMASK
 
-       /* Same as getcontext.  */
-       /* Store r1, the stack pointer.  */
-       l.sw    (UCONTEXT_MCONTEXT +  1*4)(r3), r1
-       /* Store r2, the frame pointer.  */
-       l.sw    (UCONTEXT_MCONTEXT +  2*4)(r3), r2
-       /* Store r9, the link register.  */
-       l.sw    (UCONTEXT_MCONTEXT +  9*4)(r3), r9
-       /* Store r9 to reg[11] too, as we need two links for makecontext.  */
-       l.sw    (UCONTEXT_MCONTEXT + 11*4)(r3), r9
-       /* Store r10, the TLS register.  */
-       l.sw    (UCONTEXT_MCONTEXT + 10*4)(r3), r10
-       /* Store r14-r30 even, callee saved registers.  */
-       l.sw    (UCONTEXT_MCONTEXT + 14*4)(r3), r14
-       l.sw    (UCONTEXT_MCONTEXT + 16*4)(r3), r16
-       l.sw    (UCONTEXT_MCONTEXT + 18*4)(r3), r18
-       l.sw    (UCONTEXT_MCONTEXT + 20*4)(r3), r20
-       l.sw    (UCONTEXT_MCONTEXT + 22*4)(r3), r22
-       l.sw    (UCONTEXT_MCONTEXT + 24*4)(r3), r24
-       l.sw    (UCONTEXT_MCONTEXT + 26*4)(r3), r26
-       l.sw    (UCONTEXT_MCONTEXT + 28*4)(r3), r28
-       l.sw    (UCONTEXT_MCONTEXT + 30*4)(r3), r30
+#include "swapcontext-common.S"
 
-       /* Store ucp to non-argument syscall preserved register.  */
-       l.ori   r30, r4, 0
+versioned_symbol (libc, __swapcontext, swapcontext, GLIBC_2_40)
 
-       /* Get signal mask.  */
-       /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
-       l.ori   r6, r0, _NSIG8
-       l.addi  r5, r3, UCONTEXT_SIGMASK
-       l.ori   r4, r0, 0
-       l.ori   r3, r0, SIG_BLOCK
-       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
-       /* Do the syscall.  */
-       l.sys   1
-        l.nop
+#if SHLIB_COMPAT (libc, GLIBC_2_35, GLIBC_2_40)
 
-       /* if -4096 < ret < 0 holds, it's an error */
-       l.sfgeui r11, 0xf001
-       l.bf    1f
-        l.nop
+/* Define a compat version of swapcontext for glibc's before the fpcsr
+   field was added to mcontext_t.  The offset sigmask changed with this
+   introduction, the change was done because glibc's definition of
+   ucontext_t was initially defined incompatible with the Linux
+   definition of ucontext_t.  We keep the compatability definition to
+   allow getcontext, setcontext and swapcontext to work in older
+   binaries.  */
 
-       /* Same as setcontext.  */
+# undef __CONTEXT_FUNC_NAME
+# undef __CONTEXT_ENABLE_FPCSR
+# undef __CONTEXT_SIGMASK_OFFSET
+# define __CONTEXT_FUNC_NAME __swapcontext_nofpcsr
+# define __CONTEXT_SIGMASK_OFFSET (UCONTEXT_SIGMASK - 4)
 
-       /* Restore signal mask.  */
-       /* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8) */
-       l.ori   r6, r0, _NSIG8
-       l.ori   r5, r0, 0
-       l.addi  r4, r30, UCONTEXT_SIGMASK
-       l.ori   r3, r0, SIG_SETMASK
-       l.ori   r11, r0, SYS_ify (rt_sigprocmask)
-       /* Do the syscall.  */
-       l.sys 1
-        l.nop
+# include "swapcontext-common.S"
 
-       /* if -4096 < ret < 0 holds, it's an error */
-       l.sfgeui r11, 0xf001
-       l.bf    1f
-        l.nop
+compat_symbol (libc, __swapcontext_nofpcsr, swapcontext, GLIBC_2_35)
 
-       /* Restore argument registers, for the makecontext case.  */
-       l.lwz   r3, (UCONTEXT_MCONTEXT +  3*4)(r30)
-       l.lwz   r4, (UCONTEXT_MCONTEXT +  4*4)(r30)
-       l.lwz   r5, (UCONTEXT_MCONTEXT +  5*4)(r30)
-       l.lwz   r6, (UCONTEXT_MCONTEXT +  6*4)(r30)
-       l.lwz   r7, (UCONTEXT_MCONTEXT +  7*4)(r30)
-       l.lwz   r8, (UCONTEXT_MCONTEXT +  8*4)(r30)
-
-       /* Restore registers stored in getcontext.  */
-       l.lwz   r1,  (UCONTEXT_MCONTEXT +  1*4)(r30)
-       l.lwz   r2,  (UCONTEXT_MCONTEXT +  2*4)(r30)
-       l.lwz   r9,  (UCONTEXT_MCONTEXT +  9*4)(r30)
-       l.lwz   r10, (UCONTEXT_MCONTEXT + 10*4)(r30)
-       l.lwz   r11, (UCONTEXT_MCONTEXT + 11*4)(r30)
-       l.lwz   r14, (UCONTEXT_MCONTEXT + 14*4)(r30)
-       l.lwz   r16, (UCONTEXT_MCONTEXT + 16*4)(r30)
-       l.lwz   r18, (UCONTEXT_MCONTEXT + 18*4)(r30)
-       l.lwz   r20, (UCONTEXT_MCONTEXT + 20*4)(r30)
-       l.lwz   r22, (UCONTEXT_MCONTEXT + 22*4)(r30)
-       l.lwz   r24, (UCONTEXT_MCONTEXT + 24*4)(r30)
-       l.lwz   r26, (UCONTEXT_MCONTEXT + 26*4)(r30)
-       l.lwz   r28, (UCONTEXT_MCONTEXT + 28*4)(r30)
-       l.lwz   r30, (UCONTEXT_MCONTEXT + 30*4)(r30)
-
-       l.jr    r11
-        l.ori  r11, r0, 0
-
-1:     l.j     __syscall_error
-        l.ori  r3, r11, 0
-
-END (__swapcontext)
-weak_alias (__swapcontext, swapcontext)
+#endif
index b17e91915461b5f2095682efd174e7612d2ec119..1b428592eebfc4c1a95db8f4a5f5c56d9b201f50 100644 (file)
@@ -38,6 +38,7 @@ typedef struct
     unsigned long int __gprs[__NGREG];
     unsigned long int __pc;
     unsigned long int __sr;
+    unsigned long int __fpcsr;
   } mcontext_t;
 
 /* Userlevel context.  */
index a8d4db080f7789a449f274e2e8be6fe2d7cd8aa8..45cd72527d7f4176c7551d5a2e9d89cec195d64d 100644 (file)
@@ -13,6 +13,7 @@ _NSIG8                                (_NSIG / 8)
 -- Offsets of the fields in the ucontext_t structure.
 #define ucontext(member)       offsetof (ucontext_t, member)
 #define stack(member)          ucontext (uc_stack.member)
+#define mcontext(member)       ucontext (uc_mcontext.member)
 
 UCONTEXT_LINK                  ucontext (uc_link)
 UCONTEXT_STACK                 ucontext (uc_stack)
@@ -23,4 +24,6 @@ STACK_SP                      stack (ss_sp)
 STACK_SIZE                     stack (ss_size)
 STACK_FLAGS                    stack (ss_flags)
 
+MCONTEXT_FPCSR                 mcontext (__fpcsr)
+
 UCONTEXT_SIZE                  sizeof (ucontext_t)
index c6e5e6628928523b4cd7437644e550f0d40bfddf..778d1e33548d23691eacda2a1c90bc94ffc0b1d4 100644 (file)
@@ -5,7 +5,7 @@
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
-   version 2.1 of the License.
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5acebe2a2cb99ccfe714d3f51d99e0a36bf1f4fa..2eef9e512c6f650ec17734741db22314d50796e1 100644 (file)
@@ -5,7 +5,7 @@
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
-   version 2.1 of the License.
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
index 4d6c5c59a6bbaf2b0c4eac8e7397e1b6d7e06458..579d02d63821465fb0fd2345c6f9fd6939b92995 100644 (file)
@@ -64,6 +64,11 @@ Fatal glibc error: CPU does not support x86-64-v%d\n", 4);
 #    endif /* ISA level 4 */
 #   endif /* ISA level 3 */
 #  endif /* ISA level 2 */
+# ifdef GCCMACRO__APX_F__
+      if (!CPU_FEATURE_USABLE_P (cpu_features, APX_F))
+       _dl_fatal_printf ("\
+Fatal glibc error: CPU does not support APX\n");
+# endif
 # endif /* IS_IN (rtld) */
     }
 }
index b031e42ca20c1eea07c7101e0ede55e6ff1357ef..26a044bca6e7f9fe103f4c3ba4b3ba4470042df6 100644 (file)
@@ -4,7 +4,7 @@
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
-   version 2.1 of the License.
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
index edb397507cdfc2fae2345567c7b4117ecd7ab534..2e18b8bcacfec498db713ede42372ae09262a73f 100644 (file)
@@ -5,7 +5,7 @@
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
-   version 2.1 of the License.
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of