]> sourceware.org Git - glibc.git/log
glibc.git
2 months agostdlib: Make abort AS-safe (BZ 26275) azanella/bz26275-abort-as
Adhemerval Zanella [Mon, 31 Jul 2023 15:44:37 +0000 (12:44 -0300)]
stdlib: Make abort AS-safe (BZ 26275)

The recursive lock used on abort does not synchronize with new
process creation (either by fork-like interfaces or posix_spawn
ones), nor it is reinitialized after fork.

Also, the SIGABRT unblock before raise shows another race-condition,
where a fork or posix_spawn call by another thread just after
the recursive lock release and before the SIGABRT raise might create
programs with a non-expected signal mask.

To fix the AS-safe, the raise is issues without changing the process
signal mask, and an AS-safe lock is used if a SIGABRT is installed or
the process is blocked or ignored.  The the signal mask change removal,
there is no need to use a recursive lock.  The lock is also on
both _Fork and posix_spawn, to avoid the spawn process to see the
abort handler as SIG_DFL.

The posix_spawn possible issue is if caller sets a SIG_IGN for
SIGABRT, calls abort, and another thread issues posix_spawn just
after the sigaction returns.  With default options (not setting
POSIX_SPAWN_SETSIGDEF), the process can still see SIG_DFL for
SIGABRT, where it should be SIG_IGN.

The fallback is also simplified, there is no nned to use a loop of
ABORT_INSTRUCTION after _exit (if the syscall does not terminate the
process, the system is really broken).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

2 months agosetjmp: Use BSD sematic as default for setjmp
Adhemerval Zanella [Mon, 31 Jul 2023 12:46:52 +0000 (09:46 -0300)]
setjmp: Use BSD sematic as default for setjmp

POSIX relaxed the relation of setjmp/longjmp and the signal mask
save/restore, meaning that setjmp does not require to be routed to
_setjmp to be standard compliant.

This is done to avoid breakage of SIGABRT handlers, since to fully
make abort AS-safe, it is required to remove the recurisve lock
used to unblock SIGABRT prior raised the signal.

Also, it allows caller to actually use setjmp, since from
7011c2622fe3e10a29dbe74f06aaebd07710127d the symbol is unconditionally
routed to _setjmp.

Checked on x86_64-linux-gnu.

2 months agos390x: Regenerate ULPs.
Stefan Liebler [Wed, 19 Jun 2024 06:42:30 +0000 (08:42 +0200)]
s390x: Regenerate ULPs.

Needed due to:
- "Implement C23 log10p1"
  commit ID 55eb99e9a9d840ba452b128be14d6529c2dde039
- "Implement C23 exp2m1, exp10m1"
  commit ID 7ec903e028271d029818378fd60ddaf6b76b89ac

2 months agoLoongArch: Fix _dl_tlsdesc_dynamic in LSX case
mengqinggang [Fri, 14 Jun 2024 03:58:30 +0000 (11:58 +0800)]
LoongArch: Fix _dl_tlsdesc_dynamic in LSX case

HWCAP value is overwritten at the first comparison of the LASX case.
The second comparison at LSX get incorrect result.
Change to use t0 to save HWCAP value, and use t1 to save comparison
result.

2 months agoarm: Update ulps
Adhemerval Zanella [Tue, 18 Jun 2024 20:02:34 +0000 (20:02 +0000)]
arm: Update ulps

For the exp10m1, exp2m1, and log10p1 implementations.

2 months agoaarch64: Update ulps
Adhemerval Zanella [Tue, 18 Jun 2024 20:01:40 +0000 (20:01 +0000)]
aarch64: Update ulps

For the exp10m1, exp2m1, and log10p1 implementations.

2 months agopowerpc: Update ulps
Adhemerval Zanella [Tue, 18 Jun 2024 20:02:48 +0000 (23:02 +0300)]
powerpc: Update ulps

For the exp10m1, exp2m1, and log10p1 implementations.

2 months agoLinux: Include <dl-symbol-redir-ifunc.h> in dl-sysdep.c
Florian Weimer [Tue, 18 Jun 2024 08:56:34 +0000 (10:56 +0200)]
Linux: Include <dl-symbol-redir-ifunc.h> in dl-sysdep.c

The _dl_sysdep_parse_arguments function contains initalization
of a large on-stack variable:

  dl_parse_auxv_t auxv_values = { 0, };

This uses a non-inline version of memset on powerpc64le-linux-gnu,
so it must use the baseline memset.

2 months agolinux: add definitions for hugetlb page size encodings
Carlos Llamas [Tue, 18 Jun 2024 08:56:34 +0000 (10:56 +0200)]
linux: add definitions for hugetlb page size encodings

A desired hugetlb page size can be encoded in the flags parameter of
system calls such as mmap() and shmget(). The Linux UAPI headers have
included explicit definitions for these encodings since v4.14.

This patch adds these definitions that are used along with MAP_HUGETLB
and SHM_HUGETLB flags as specified in the corresponding man pages. This
relieves programs from having to duplicate and/or compute the encodings
manually.

Additionally, the filter on these definitions in tst-mman-consts.py is
removed, as suggested by Florian. I then ran this tests successfully,
confirming the alignment with the kernel headers.

  PASS: misc/tst-mman-consts
  original exit status 0

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Tested-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 months agoelf: Remove HWCAP_IMPORTANT
Stefan Liebler [Fri, 7 Jun 2024 11:42:44 +0000 (13:42 +0200)]
elf: Remove HWCAP_IMPORTANT

Remove the definitions of HWCAP_IMPORTANT after removal of
LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask.  There HWCAP_IMPORTANT
was used as default value.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask
Stefan Liebler [Fri, 7 Jun 2024 11:42:43 +0000 (13:42 +0200)]
elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask

Remove the environment variable LD_HWCAP_MASK and the tunable
glibc.cpu.hwcap_mask as those are not used anymore in common-code
after removal in elf/dl-cache.c:search_cache().

The only remaining user is sparc32 where it is used in
elf_machine_matches_host().  If sparc32 does not need it anymore,
we can get rid of it at all.  Otherwise we could also move
LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask to be sparc32 specific.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove _DL_PLATFORMS_COUNT
Stefan Liebler [Fri, 7 Jun 2024 11:42:42 +0000 (13:42 +0200)]
elf: Remove _DL_PLATFORMS_COUNT

Remove the definitions of _DL_PLATFORMS_COUNT as those are not used
anymore after removal in elf/dl-cache.c:search_cache().

Note: On x86, we can also get rid of the definitions
HWCAP_PLATFORMS_START and HWCAP_PLATFORMS_COUNT.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove _DL_FIRST_PLATFORM
Stefan Liebler [Fri, 7 Jun 2024 11:42:41 +0000 (13:42 +0200)]
elf: Remove _DL_FIRST_PLATFORM

Remove the definitions of _DL_FIRST_PLATFORM as those were only used
in the _DL_HWCAP_PLATFORM definitions and in _dl_string_platform().
Both were removed.

Note: Removed on every architecture despite of powerpc, where
_dl_string_platform() is still used.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove _DL_HWCAP_PLATFORM
Stefan Liebler [Fri, 7 Jun 2024 11:42:40 +0000 (13:42 +0200)]
elf: Remove _DL_HWCAP_PLATFORM

Remove the definitions of _DL_HWCAP_PLATFORM as those are not used
anymore after removal in elf/dl-cache.c:search_cache().
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove platform strings in dl-procinfo.c
Stefan Liebler [Wed, 12 Jun 2024 07:32:36 +0000 (09:32 +0200)]
elf: Remove platform strings in dl-procinfo.c

Remove the platform strings in dl-procinfo.c where also
the implementation of _dl_string_platform() was removed.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove _dl_string_platform
Stefan Liebler [Fri, 7 Jun 2024 11:42:38 +0000 (13:42 +0200)]
elf: Remove _dl_string_platform

Despite of powerpc where the returned integer is stored in tcb,
and the diagnostics output, there is no user anymore.

Thus this patch removes the diagnostics output and
_dl_string_platform for all other platforms.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoelf: Remove loading legacy hwcaps/platform entries in dynamic loader
Stefan Liebler [Fri, 7 Jun 2024 11:42:37 +0000 (13:42 +0200)]
elf: Remove loading legacy hwcaps/platform entries in dynamic loader

The legacy hwcaps mechanism was removed with glibc 2.37:
See this commit series:
d178c67535f0d159df73843e7c18cbdb39b4d25d
x86_64: Remove platform directory library loading test
6099908fb84debee4c3bcb05d88769410c2aecd1
elf: Remove legacy hwcaps support from the dynamic loader
b78ff5a25dc8ba9d8c6df10bb0a533254bdd193f
elf: Remove legacy hwcaps support from ldconfig
4a7094119ce05cadf927f52cc5d723e2195e65f9
elf: Remove hwcap parameter from add_to_cache signature
cfbf883db36727a84ef7929af49ef68c195b5972
elf: Remove hwcap and bits_hwcap fields from struct cache_entry
78d9a1620b840deb0880686e4159eaf70708866a
Add NEWS entry for legacy hwcaps removal
ab40f20364f4a417a63dd51fdd943742070bfe96
elf: Remove _dl_string_hwcap
e76369ed6371734f77f468eab097ef4e5b5db1c5
elf: Simplify output of hwcap subdirectories in ld.so help

According to Florian Weimer, this was an oversight and should also
have been removed.

As ldconfig does not generate ld.so.cache entries with hwcap/platform
bits in the hwcap-field anymore, this patch now skips those entries.
Thus currently only named-hwcap-entries and the default entries are
allowed.
For named-hwcap entries bit 62 is set and also the isa-level bits can
be set.
For the default entries the hwcap-field is 0.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agox86: Remove HWCAP_START and HWCAP_COUNT
Stefan Liebler [Fri, 7 Jun 2024 11:42:36 +0000 (13:42 +0200)]
x86: Remove HWCAP_START and HWCAP_COUNT

Both defines are not used anymore.  Those were only used for
_dl_string_hwcap(), which itself was removed with commit
ab40f20364f4a417a63dd51fdd943742070bfe96
"elf: Remove _dl_string_hwcap"

Just clean up.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agomath: Update mips32/mips64 ulps for log2p1
YunQiang Su [Fri, 31 May 2024 15:50:38 +0000 (23:50 +0800)]
math: Update mips32/mips64 ulps for log2p1

2 months agoConvert to autoconf 2.72 (vanilla release, no distribution patches)
Andreas K. Hüttel [Tue, 11 Jun 2024 21:34:54 +0000 (23:34 +0200)]
Convert to autoconf 2.72 (vanilla release, no distribution patches)

As discussed at the patch review meeting

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Reviewed-by: Simon Chopin <simon.chopin@canonical.com>
2 months agoImplement C23 exp2m1, exp10m1
Joseph Myers [Mon, 17 Jun 2024 16:31:49 +0000 (16:31 +0000)]
Implement C23 exp2m1, exp10m1

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the exp2m1 and exp10m1 functions (exp2(x)-1 and
exp10(x)-1, like expm1).

As with other such functions, these use type-generic templates that
could be replaced with faster and more accurate type-specific
implementations in future.  Test inputs are copied from those for
expm1, plus some additions close to the overflow threshold (copied
from exp2 and exp10) and also some near the underflow threshold.

exp2m1 has the unusual property of having an input (M_MAX_EXP) where
whether the function overflows (under IEEE semantics) depends on the
rounding mode.  Although these could reasonably be XFAILed in the
testsuite (as we do in some cases for arguments very close to a
function's overflow threshold when an error of a few ulps in the
implementation can result in the implementation not agreeing with an
ideal one on whether overflow takes place - the testsuite isn't smart
enough to handle this automatically), since these functions aren't
required to be correctly rounding, I made the implementation check for
and handle this case specially.

The Makefile ordering expected by lint-makefiles for the new functions
is a bit peculiar, but I implemented it in this patch so that the test
passes; I don't know why log2 also needed moving in one Makefile
variable setting when it didn't in my previous patches, but the
failure showed a different place was expected for that function as
well.

The powerpc64le IFUNC setup seems not to be as self-contained as one
might hope; it shouldn't be necessary to add IFUNCs for new functions
such as these simply to get them building, but without setting up
IFUNCs for the new functions, there were undefined references to
__GI___expm1f128 (that IFUNC machinery results in no such function
being defined, but doesn't stop include/math.h from doing the
redirection resulting in the exp2m1f128 and exp10m1f128
implementations expecting to call it).

Tested for x86_64 and x86, and with build-many-glibcs.py.

2 months agoImplement C23 log10p1
Joseph Myers [Mon, 17 Jun 2024 13:48:13 +0000 (13:48 +0000)]
Implement C23 log10p1

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the log10p1 functions (log10(1+x): like log1p, but for
base-10 logarithms).

This is directly analogous to the log2p1 implementation (except that
whereas log2p1 has a smaller underflow range than log1p, log10p1 has a
larger underflow range).  The test inputs are copied from those for
log1p and log2p1, plus a few more inputs in that wider underflow
range.

Tested for x86_64 and x86, and with build-many-glibcs.py.

2 months agoImplement C23 logp1
Joseph Myers [Mon, 17 Jun 2024 13:47:09 +0000 (13:47 +0000)]
Implement C23 logp1

C23 adds various <math.h> function families originally defined in TS
18661-4.  Add the logp1 functions (aliases for log1p functions - the
name is intended to be more consistent with the new log2p1 and
log10p1, where clearly it would have been very confusing to name those
functions log21p and log101p).  As aliases rather than new functions,
the content of this patch is somewhat different from those actually
adding new functions.

Tests are shared with log1p, so this patch *does* mechanically update
all affected libm-test-ulps files to expect the same errors for both
functions.

The vector versions of log1p on aarch64 and x86_64 are *not* updated
to have logp1 aliases (and thus there are no corresponding header,
tests, abilist or ulps changes for vector functions either).  It would
be reasonable for such vector aliases and corresponding changes to
other files to be made separately.  For now, the log1p tests instead
avoid testing logp1 in the vector case (a Makefile change is needed to
avoid problems with grep, used in generating the .c files for vector
function tests, matching more than one ALL_RM_TEST line in a file
testing multiple functions with the same inputs, when it assumes that
the .inc file only has a single such line).

Tested for x86_64 and x86, and with build-many-glibcs.py.

2 months agosupport: Include <limits.h> for NAME_MAX use in temp_file.c
Florian Weimer [Mon, 17 Jun 2024 13:14:05 +0000 (15:14 +0200)]
support: Include <limits.h> for NAME_MAX use in temp_file.c

2 months agosupport: Include <stdlib.h> for atoi use in support_wait_for_thread_exit
Florian Weimer [Mon, 17 Jun 2024 13:14:05 +0000 (15:14 +0200)]
support: Include <stdlib.h> for atoi use in support_wait_for_thread_exit

2 months agoExtend tst-getconf.sh test with NPROCESSORS_CONF and NPROCESSORS_ONLN
Jan Kurik [Fri, 14 Jun 2024 18:49:39 +0000 (20:49 +0200)]
Extend tst-getconf.sh test with NPROCESSORS_CONF and NPROCESSORS_ONLN

Reviewed-by: Arjun Shankar <arjun@redhat.com>
2 months agoDefine ISO 639-3 "ltg" (Latgalian) and add ltg_LV locale
Mike FABIAN [Mon, 10 Jun 2024 17:54:42 +0000 (19:54 +0200)]
Define ISO 639-3 "ltg" (Latgalian) and add ltg_LV locale

Resolves: BZ # 31411

References:
https://iso639-3.sil.org/code/ltg
https://en.wikipedia.org/wiki/Latgalian_language
https://github.com/unicode-org/cldr/blob/main/common/main/ltg.xml

2 months agoINSTALL: regenerate
Paul Eggert [Sat, 15 Jun 2024 17:32:34 +0000 (10:32 -0700)]
INSTALL: regenerate

2 months agoMinor code improvement to timespec_subtract example
Paul Eggert [Sat, 15 Jun 2024 15:40:41 +0000 (08:40 -0700)]
Minor code improvement to timespec_subtract example

This saves a few instructions.
BORROW cannot be -1, since NSEC_DIFF is at most 999999999.
Idea taken from Gnulib, here:
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=fe33f943054b93af8b965ce6564b8713b0979a21

2 months agoModernize and fix doc’s “Date and Time” (BZ 31876)
Paul Eggert [Sat, 8 Jun 2024 16:48:25 +0000 (09:48 -0700)]
Modernize and fix doc’s “Date and Time” (BZ 31876)

POSIX.1-2024 (now official) specifies tm_gmtoff and tm_zone.
This is a good time to update the manual’s “Date and Time”
chapter so I went through it, fixed some outdated
stuff that had been in there for decades, and improved it to match
POSIX.1-2024 better and to clarify some implementation-defined
behavior.  Glibc already conforms to POSIX.1-2024 in these matters, so
this is merely a documentation change.

* manual/examples/strftim.c: Use snprintf instead of now-deprecated
  function asctime.  Check for localtime failure.  Simplify by using
  puts instead of fputs.  Prefer ‘buf, sizeof buf’ to less-obvious
  ‘buffer, SIZE’.

* manual/examples/timespec_subtract.c: Modernize to use struct
  timespec not struct timeval, and rename from timeval_subtract.c.
  All uses changed.  Check for overflow.  Do not check for negative
  return value, which ought to be OK since negative time_t is OK.
  Use GNU indenting style.

* manual/time.texi:

  Document CLOCKS_PER_SEC, TIME_UTC, timespec_get, timespec_getres,
  strftime_l.

  Document the storage lifetime of tm_zone and of tzname.

  Caution against use of tzname, timezone and daylight, saying that
  these variables have unspecified values when TZ is geographic.
  This is what glibc actually does (contrary to what the manual said
  before this patch), and POSIX is planned to say the same thing
  <https://austingroupbugs.net/view.php?id=1816>.
  Also say that directly accessing the variables is not thread-safe.

  Say that localtime_r and ctime_r don’t necessarily set time zone
  state.  Similarly, in the tzset documentation, say that it is called
  by ctime, localtime, mktime, strftime, not that it is called by all
  time conversion functions that depend on the time zone.

  Say that tm_isdst is useful mostly just for mktime, and that
  other uses should prefer tm_gmtoff and tm_zone instead.

  Do not say that strftime ignores tm_gmtoff and tm_zone, because
  it doesn’t do that.

  Document what gmtime does to tm_gmtoff and tm_zone.

  Say that the asctime, asctime_r, ctime, and ctime_r are now deprecated
  and/or obsolescent, and that behavior is undefined if the year is <
  1000 or > 9999.  Document strftime before these now-obsolescent
  functions, so that readers see the useful function first.

  Coin the terms “geographical format” and “proleptic format” for the
  two main formats of TZ settings, to simplify exposition.  Use this
  wording consistently.

  Update top-level proleptic syntax to match POSIX.1-2024, which glibc
  already implements.  Document the angle-bracket quoted forms of time
  zone abbreviations in proleptic TZ.  Say that time zone abbreviations
  can contain only ASCII alphanumerics, ‘+’, and ‘-’.

  Document what happens if the proleptic form specifies a DST
  abbreviation and offset but omits the rules.  POSIX says this is
  implementation-defined so we need to document it.  Although this
  documentation mentions ‘posixrules’ tersely, we need to rethink
  ‘posixrules’ since I think it stops working after 2038.

  Clarify wording about TZ settings beginning with ‘;’.

  Say that timegm is in ISO C (as of C23).

  Say that POSIX.1-2024 removed gettimeofday.

  Say that tm_gmtoff and tm_zone are extensions to ISO C, which is
  clearer than saying they are invisible in a struct ISO C enviroment,
  and gives us more wiggle room if we want to make them visible in
  strict ISO C, something that ISO C allows.

  Drop mention of old standards like POSIX.1c and POSIX.2-1992 in the
  text when the history is so old that it’s no longer useful in a
  general-purpose manual.

  Define Coordinated Universal Time (UTC), time zone, time zone ruleset,
  and POSIX Epoch, and use these phrases more consistently.

  Improve TZ examples to show more variety, and to reflect current
  practice and timestamps.  Remove obsolete example about Argentina.
  Add an example for Ireland.

  Don’t rely on GCC extensions when explaining ctime_r.

  Do not say that difftime produces the mathematically correct result,
  since it might be inexact.

  For clock_t don’t say “as in the example above” when there is no
  such example, and don’t say that casting to double works “properly
  and consistently no matter what”, as it suffers from rounding and
  overflow.

  Don’t say broken-down time is not useful for calculations; it’s
  merely painful.

  Say that UTC is not defined before 1960.

  Rename Time Zone Functions to Time Zone State.  All uses changed.

  Update Internet RFC 822 → 5322, 1305 → 5905.  Drop specific years of
  ISO 8601 as they don’t matter.

  Minor style changes: @code{"..."} → @t{"..."} to avoid overquoting in
  info files, @code → @env for environment variables, Daylight Saving
  Time → daylight saving time, white space → whitespace, prime meridian
  → Prime Meridian.

2 months agomanual: minor language fix (bz 31340)
Andreas K. Hüttel [Sat, 15 Jun 2024 13:41:22 +0000 (15:41 +0200)]
manual: minor language fix (bz 31340)

Resolves: https://sourceware.org/bugzilla/show_bug.cgi?id=31340
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 months agox86: Fix value for `x86_memset_non_temporal_threshold` when it is undesirable
Noah Goldstein [Fri, 14 Jun 2024 18:01:58 +0000 (13:01 -0500)]
x86: Fix value for `x86_memset_non_temporal_threshold` when it is undesirable

When we don't want to use non-temporal stores for memset, we set
`x86_memset_non_temporal_threshold` to SIZE_MAX.

The current code, however, we using `maximum_non_temporal_threshold`
as the upper bound which is `SIZE_MAX >> 4` so we ended up with a
value of `0`.

Fix is to just use `SIZE_MAX` as the upper bound for when setting the
tunable.
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 months agoelf: Change module-names to modules-names in comments
H.J. Lu [Fri, 14 Jun 2024 20:29:21 +0000 (13:29 -0700)]
elf: Change module-names to modules-names in comments

module-names should be modules-names.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
2 months agoi686: Regenerate ulps
Andreas K. Hüttel [Fri, 14 Jun 2024 19:23:10 +0000 (21:23 +0200)]
i686: Regenerate ulps

Linux pinacolada 6.6.32-gentoo #1 SMP PREEMPT Sun Jun  9 14:18:17 CEST 2024 x86_64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz GenuineIntel GNU/Linux
32bit build for multilib environment

Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
2 months agoLoongArch: Ensure sp 16-byte aligned for tlsdesc
Xi Ruoyao [Thu, 13 Jun 2024 11:04:05 +0000 (19:04 +0800)]
LoongArch: Ensure sp 16-byte aligned for tlsdesc

"ADDI sp, sp, 24" and "ADDI sp, sp, SZFCSREG" (SZFCSREG = 4) are
misaligning the stack: the ABI mandates a 16-byte alignment.  Fix it
by changing the first one to "ADDI sp, sp, 32", and reuse the spare 4th
slot for saving fcsr.

Reported-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
2 months agoresolv: Track single-request fallback via _res._flags (bug 31476)
Florian Weimer [Thu, 13 Jun 2024 16:56:30 +0000 (18:56 +0200)]
resolv: Track single-request fallback via _res._flags (bug 31476)

This avoids changing _res.options, which inteferes with change
detection as part of automatic reloading of /etc/resolv.conf.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 months agox86: Properly set x86 minimum ISA level [BZ #31883]
H.J. Lu [Wed, 12 Jun 2024 03:14:56 +0000 (20:14 -0700)]
x86: Properly set x86 minimum ISA level [BZ #31883]

Properly set libc_cv_have_x86_isa_level in shell for MINIMUM_X86_ISA_LEVEL
defined as

(__X86_ISA_V1 + __X86_ISA_V2 + __X86_ISA_V3 + __X86_ISA_V4)

Also set __X86_ISA_V2 to 1 for i386 if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
is defined.  There are no changes in config.h nor in config.make on x86-64.
On i386, -march=x86-64-v2 with GCC generates

 #define MINIMUM_X86_ISA_LEVEL 2

in config.h and

have-x86-isa-level = 2

in config.make.  This fixes BZ #31883.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 months agotunables: sort tunables list (BZ 30027)
DJ Delorie [Tue, 11 Jun 2024 23:28:36 +0000 (19:28 -0400)]
tunables: sort tunables list (BZ 30027)

Sort tunables list at the time it's generated.  Note: adding new
tunables will cause other tunable IDs to change, but that was
the case before anyway.  POSIX does not guarantee the order of "foo
in bar" AWK operators, so the order was indeterminate before anyway.
Even depending on the order to be the same across multiple calls,
such as in this script, is undefined, so sorting the list resolves
that also.

Note that sorting is not dependent on the user's locale.

2 months agolinux: Remove __stack_prot
Adhemerval Zanella [Tue, 11 Jun 2024 15:27:04 +0000 (12:27 -0300)]
linux: Remove __stack_prot

The __stack_prot is used by Linux to make the stack executable if
a modules requires it.  It is also marked as RELRO, which requires
to change the segment permission to RW to update it.

Also, there is no need to keep track of the flags: either the stack
will have the default permission of the ABI or should be change to
PROT_READ | PROT_WRITE | PROT_EXEC.  The only additional flag,
PROT_GROWSDOWN or PROT_GROWSUP, is Linux only and can be deducted
from _STACK_GROWS_DOWN/_STACK_GROWS_UP.

Also, the check_consistency function was already removed some time
ago.

Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 months ago<stdio.h>: Acknowledge that getdelim/getline are in POSIX
Philip Kaludercic [Sun, 9 Jun 2024 11:14:59 +0000 (13:14 +0200)]
<stdio.h>: Acknowledge that getdelim/getline are in POSIX

These comments were written in 2003 (added in 2c008571c3a), predating
the addition of getdelim(3)/getline(3) in POSIX.1-2008.

Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 months agolocaledata: Lowercase day and abday in cs_CZ
Mike FABIAN [Mon, 10 Jun 2024 17:54:42 +0000 (19:54 +0200)]
localedata: Lowercase day and abday in cs_CZ

Resolves: BZ # 25119

Also to sync with CLDR

2 months agox86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867]
H.J. Lu [Mon, 10 Jun 2024 20:02:06 +0000 (13:02 -0700)]
x86: Properly set MINIMUM_X86_ISA_LEVEL for i386 [BZ #31867]

On i386, set the default minimum ISA level to 0, not 1 (baseline which
includes SSE2).  There are no changes in config.h nor in config.make on
x86-64.  This fixes BZ #31867.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Tested-by: Ian Jordan <immoloism@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
2 months agox86: Enable non-temporal memset tunable for AMD
Joe Damato [Fri, 7 Jun 2024 23:04:47 +0000 (23:04 +0000)]
x86: Enable non-temporal memset tunable for AMD

In commit 46b5e98ef6f1 ("x86: Add seperate non-temporal tunable for
memset") a tunable threshold for enabling non-temporal memset was added,
but only for Intel hardware.

Since that commit, new benchmark results suggest that non-temporal
memset is beneficial on AMD, as well, so allow this tunable to be set
for AMD.

See:
https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit?usp=sharing
which has been updated to include data using different stategies for
large memset on AMD Zen2, Zen3, and Zen4.

Signed-off-by: Joe Damato <jdamato@fastly.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2 months agohurd: Fix getxattr/listxattr returning ERANGE
Samuel Thibault [Mon, 10 Jun 2024 20:01:40 +0000 (22:01 +0200)]
hurd: Fix getxattr/listxattr returning ERANGE

The manpage says that when the passed size is zero, they should set the
expected size and return 0. ERANGE shall be returned only when the non-zero
passed size is not large enough.

2 months agohurd: Fix setxattr return value on replacing
Samuel Thibault [Mon, 10 Jun 2024 20:00:20 +0000 (22:00 +0200)]
hurd: Fix setxattr return value on replacing

When XATTR_REPLACE is set we shall succeed when the value already
exists, and fail with ENODATA otherwise, instead of the converse.

2 months agohurd: Fix getxattr("gnu.translator") returning ENODATA
Samuel Thibault [Mon, 10 Jun 2024 19:57:53 +0000 (21:57 +0200)]
hurd: Fix getxattr("gnu.translator") returning ENODATA

When no translator is set, __file_get_translator would return EINVAL
which is a confusing value. Better check for a passive translation
before getting the value.

2 months agohurd: Fix lsetxattr return value
Samuel Thibault [Mon, 10 Jun 2024 19:56:13 +0000 (21:56 +0200)]
hurd: Fix lsetxattr return value

The manpage says that lsetxattr returns 0 on success, like setxattr.

2 months agolocaledata: add new locales scn_IT
David Paleino [Wed, 15 May 2024 18:39:46 +0000 (20:39 +0200)]
localedata: add new locales scn_IT

Signed-off-by: David Paleino <dapal@debian.org>
2 months agosupport: Fix typo in xgetsockname error message
Avinal Kumar [Fri, 17 May 2024 15:28:04 +0000 (20:58 +0530)]
support: Fix typo in xgetsockname error message

The error message in xgetsockname was incorrectly referring to a
different function.  This commit fixes that.

Suggested-by: Arjun Shankar <arjun@redhat.com>
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 months agogetconf: Add NPROCESSORS_{CONF,ONLN} [BZ #31661]
Mohamed Akram [Thu, 30 May 2024 14:05:50 +0000 (18:05 +0400)]
getconf: Add NPROCESSORS_{CONF,ONLN} [BZ #31661]

These are required by the upcoming POSIX standard and are available on
other platforms.

Link: https://austingroupbugs.net/view.php?id=339
Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
2 months agoLinux: Add epoll ioctls
Joe Damato [Tue, 28 May 2024 17:37:06 +0000 (17:37 +0000)]
Linux: Add epoll ioctls

As of Linux kernel 6.9, some ioctls and a parameters structure have been
introduced which allow user programs to control whether a particular
epoll context will busy poll.

Update the headers to include these for the convenience of user apps.

The ioctls were added in Linux kernel 6.9 commit 18e2bf0edf4dd
("eventpoll: Add epoll ioctl for epoll_params") [1] to
include/uapi/linux/eventpoll.h.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/?h=v6.9&id=18e2bf0edf4dd

Signed-off-by: Joe Damato <jdamato@fastly.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agoImprove doc for time_t range (BZ 31808)
Paul Eggert [Tue, 28 May 2024 17:07:47 +0000 (10:07 -0700)]
Improve doc for time_t range (BZ 31808)

2 months agodifftime can throw exceptions
Paul Eggert [Tue, 28 May 2024 17:07:47 +0000 (10:07 -0700)]
difftime can throw exceptions

difftime can signal an inexact conversion when converting to double,
so it should not be marked as pure or nothrow (BZ 31808).

Although we could do something more complicated, in which difftime is
plain on modern platforms but const and nothrow on obsolescent
platforms with 32-bit time_t, it hardly seems worth the trouble.
difftime is used so rarely that it's not worth taking pains to
optimize calls to it on obsolescent platforms.

Reviewed-by: DJ Delorie <dj@redhat.com>
2 months agomalloc: New test to check malloc alternate path using memory obstruction
sayan paul [Wed, 29 May 2024 10:01:04 +0000 (15:31 +0530)]
malloc: New test to check malloc alternate path using memory obstruction

The test aims to ensure that malloc uses the alternate path to
allocate memory when sbrk() or brk() fails.To achieve this,
the test first creates an obstruction at current program break,
tests that obstruction with a failing sbrk(), then checks if malloc
is still returning a valid ptr thus inferring that malloc() used
mmap() instead of brk() or sbrk() to allocate the memory.
Reviewed-by: Arjun Shankar <arjun@redhat.com>
Reviewed-by: Zack Weinberg <zack@owlfolio.org>
2 months agomath: Fix exp10 undefined left shift
Szabolcs Nagy [Wed, 22 May 2024 15:33:43 +0000 (16:33 +0100)]
math: Fix exp10 undefined left shift

Left shift of ki is undefined when ki<0, copy the logic from exp,
which uses unsigned arithmetics, to fix it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2 months agolibio: Test for fdopen memory leak without SEEK_END support (bug 31840)
Florian Weimer [Tue, 4 Jun 2024 12:37:35 +0000 (14:37 +0200)]
libio: Test for fdopen memory leak without SEEK_END support (bug 31840)

The bug report used /dev/mem, but /proc/self/mem works as well
(if available).

2 months agoRemove memory leak in fdopen (bug 31840)
Andreas Schwab [Tue, 4 Jun 2024 09:01:11 +0000 (11:01 +0200)]
Remove memory leak in fdopen (bug 31840)

Deallocate the memory for the FILE structure when seeking to the end fails
in append mode.

Fixes: ea33158c96 ("Fix offset caching for streams and use it for ftell (BZ #16680)")
2 months agoAdd new AArch64 HWCAP2 definitions from Linux 6.9 to bits/hwcap.h
Joseph Myers [Tue, 4 Jun 2024 12:25:05 +0000 (12:25 +0000)]
Add new AArch64 HWCAP2 definitions from Linux 6.9 to bits/hwcap.h

Linux 6.9 adds 15 new HWCAP2_* values for AArch64; add them to
bits/hwcap.h in glibc.

Tested with build-many-glibcs.py for aarch64-linux-gnu.

2 months agoAdd more NT_ARM_* constants from Linux kernel to elf.h
Joseph Myers [Tue, 4 Jun 2024 12:24:37 +0000 (12:24 +0000)]
Add more NT_ARM_* constants from Linux kernel to elf.h

Linux 6.9 adds the ELF note type NT_ARM_FPMR.  Add this to glibc's
elf.h, along with the previously missed NT_ARM_SSVE, NT_ARM_ZA and
NT_ARM_ZT (added in older kernel versions).

Tested for x86_64.

2 months agostdlib: Describe __cxa_finalize usage in function comment
Florian Weimer [Mon, 3 Jun 2024 17:04:58 +0000 (19:04 +0200)]
stdlib: Describe __cxa_finalize usage in function comment

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2 months agoelf: Avoid some free (NULL) calls in _dl_update_slotinfo
Florian Weimer [Mon, 3 Jun 2024 08:49:40 +0000 (10:49 +0200)]
elf: Avoid some free (NULL) calls in _dl_update_slotinfo

This has been confirmed to work around some interposed mallocs.  Here
is a discussion of the impact test ust/libc-wrapper/test_libc-wrapper
in lttng-tools:

  New TLS usage in libgcc_s.so.1, compatibility impact
  <https://inbox.sourceware.org/libc-alpha/8734v1ieke.fsf@oldenburg.str.redhat.com/>

Reportedly, this patch also papers over a similar issue when tcmalloc
2.9.1 is not compiled with -ftls-model=initial-exec.  Of course the
goal really should be to compile mallocs with the initial-exec TLS
model, but this commit appears to be a useful interim workaround.

Fixes commit d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow
tls access after dlopen [BZ #19924]").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2 months agox86: Add seperate non-temporal tunable for memset
Noah Goldstein [Fri, 24 May 2024 17:38:51 +0000 (12:38 -0500)]
x86: Add seperate non-temporal tunable for memset

The tuning for non-temporal stores for memset vs memcpy is not always
the same. This includes both the exact value and whether non-temporal
stores are profitable at all for a given arch.

This patch add `x86_memset_non_temporal_threshold`. Currently we
disable non-temporal stores for non Intel vendors as the only
benchmarks showing its benefit have been on Intel hardware.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2 months agox86: Improve large memset perf with non-temporal stores [RHEL-29312]
Noah Goldstein [Fri, 24 May 2024 17:38:50 +0000 (12:38 -0500)]
x86: Improve large memset perf with non-temporal stores [RHEL-29312]

Previously we use `rep stosb` for all medium/large memsets. This is
notably worse than non-temporal stores for large (above a
few MBs) memsets.
See:
https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit?usp=sharing
For data using different stategies for large memset on ICX and SKX.

Using non-temporal stores can be up to 3x faster on ICX and 2x faster
on SKX. Historically, these numbers would not have been so good
because of the zero-over-zero writeback optimization that `rep stosb`
is able to do. But, the zero-over-zero writeback optimization has been
removed as a potential side-channel attack, so there is no longer any
good reason to only rely on `rep stosb` for large memsets. On the flip
size, non-temporal writes can avoid data in their RFO requests saving
memory bandwidth.

All of the other changes to the file are to re-organize the
code-blocks to maintain "good" alignment given the new code added in
the `L(stosb_local)` case.

The results from running the GLIBC memset benchmarks on TGL-client for
N=20 runs:

Geometric Mean across the suite New / Old EXEX256: 0.979
Geometric Mean across the suite New / Old EXEX512: 0.979
Geometric Mean across the suite New / Old AVX2   : 0.986
Geometric Mean across the suite New / Old SSE2   : 0.979

Most of the cases are essentially unchanged, this is mostly to show
that adding the non-temporal case didn't add any regressions to the
other cases.

The results on the memset-large benchmark suite on TGL-client for N=20
runs:

Geometric Mean across the suite New / Old EXEX256: 0.926
Geometric Mean across the suite New / Old EXEX512: 0.925
Geometric Mean across the suite New / Old AVX2   : 0.928
Geometric Mean across the suite New / Old SSE2   : 0.924

So roughly a 7.5% speedup. This is lower than what we see on servers
(likely because clients typically have faster single-core bandwidth so
saving bandwidth on RFOs is less impactful), but still advantageous.

Full test-suite passes on x86_64 w/ and w/o multiarch.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoelf: add note identifier for dlopen metadata
Luca Boccassi [Wed, 15 May 2024 00:10:35 +0000 (01:10 +0100)]
elf: add note identifier for dlopen metadata

This new note type is defined at https://systemd.io/ELF_DLOPEN_METADATA/
and is used to list shared library dependencies loaded via dlopen().
Distro packagers can use this, via tools like those available at
https://github.com/systemd/package-notes to automatically generate
dependencies when building projects that make use of this
specification.

By defining the note id here we can use it in other projects as a
stable identifier, for example in 'readelf' to pretty-print its
content.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
3 months agoelf: update NT_FDO_PACKAGING_METADATA spec URL
Luca Boccassi [Wed, 15 May 2024 00:10:34 +0000 (01:10 +0100)]
elf: update NT_FDO_PACKAGING_METADATA spec URL

Page was renamed some time ago, there's a redirect but better
to point to the right one

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
3 months agoLoongArch: Use "$fcsr0" instead of "$r0" in _FPU_{GET,SET}CW
Xi Ruoyao [Mon, 29 Apr 2024 07:26:24 +0000 (15:26 +0800)]
LoongArch: Use "$fcsr0" instead of "$r0" in _FPU_{GET,SET}CW

Clang inline-asm parser does not allow using "$r0" in
movfcsr2gr/movgr2fcsr, so everything using _FPU_{GET,SET}CW is now
failing to build with Clang on LoongArch.  As we now requires Binutils
>= 2.41 which supports using "$fcsr0" here, use it instead of "$r0" to
fix the issue.

Link: https://github.com/loongson-community/discussions/issues/53#issuecomment-2081507390
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=4142b2368353
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
3 months agox86_64: Reformat elf_machine_rela
Xin Wang [Mon, 27 May 2024 19:06:41 +0000 (03:06 +0800)]
x86_64: Reformat elf_machine_rela

A space is added before the left bracket of the x86_64 elf_machine_rela
function, in order to harmonize with the rest of the implementation of
the function and to make it easier to retrieve the function. The lines
where the function definition is located has been re-indented, as well
as its left curly bracket placed in the correct position.

Signed-off-by: Xin Wang <yw987194828@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoi386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)
Sunil K Pandey [Mon, 27 May 2024 17:08:18 +0000 (10:08 -0700)]
i386: Disable Intel Xeon Phi tests for GCC 15 and above (BZ 31782)

This patch disables Intel Xeon Phi tests for GCC 15 and above.

GCC 15 removed Intel Xeon Phi ISA support.
commit e1a7e2c54d52d0ba374735e285b617af44841ace
Author: Haochen Jiang <haochen.jiang@intel.com>
Date:   Mon May 20 10:43:44 2024 +0800

    i386: Remove Xeon Phi ISA support

Fixes BZ 31782.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agodifftime is pure, not const
Paul Eggert [Mon, 27 May 2024 00:37:17 +0000 (17:37 -0700)]
difftime is pure, not const

Because difftime's behavior depends on the floating-point environment,
the function is pure, not const (BZ 31802).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoparse_fdinfo: Don't advance pointer twice [BZ #31798]
H.J. Lu [Sat, 25 May 2024 12:13:41 +0000 (05:13 -0700)]
parse_fdinfo: Don't advance pointer twice [BZ #31798]

pidfd_getpid.c has

      /* Ignore invalid large values.  */
      if (INT_MULTIPLY_WRAPV (10, n, &n)
          || INT_ADD_WRAPV (n, *l++ - '0', &n))
        return -1;

For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as

   _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)

and *l++ - '0' is evaluated twice.  Fix BZ #31798 by moving "l++" out of
the if statement.  Tested with GCC 6.4 and GCC 14.1.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoelf/Makefile: Split and sort PIE tests
H.J. Lu [Sat, 25 May 2024 21:53:30 +0000 (14:53 -0700)]
elf/Makefile: Split and sort PIE tests

Put each item on a separate line and sort PIE tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoRevert "Test fscanf of long double without <stdio.h>"
H.J. Lu [Fri, 24 May 2024 23:24:49 +0000 (16:24 -0700)]
Revert "Test fscanf of long double without <stdio.h>"

This reverts commit 30a745450e01e4c6f484dc691c16a54a6ea72288.

On ppc64le, without <stdio.h>, vfscanf is used and with <stdio.h>
__isoc23_vfscanfieee128 is used.  I am reverting this since it doesn't
work on all targets.

3 months agosysdeps/ieee754/ldbl-opt/Makefile: Split and sort libnldbl-calls
H.J. Lu [Fri, 24 May 2024 17:25:40 +0000 (10:25 -0700)]
sysdeps/ieee754/ldbl-opt/Makefile: Split and sort libnldbl-calls

Put each item on a separate line and sort libnldbl-calls.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoTest fscanf of long double without <stdio.h>
H.J. Lu [Fri, 24 May 2024 15:00:34 +0000 (08:00 -0700)]
Test fscanf of long double without <stdio.h>

Add a test for fscanf of long double without including <stdio.h>.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
3 months agosysdeps/ieee754/ldbl-opt/Makefile: Remove test-nldbl-redirect-static
H.J. Lu [Fri, 24 May 2024 13:36:18 +0000 (06:36 -0700)]
sysdeps/ieee754/ldbl-opt/Makefile: Remove test-nldbl-redirect-static

Remove $(objpfx)test-nldbl-redirect-static checked in by accident.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 months agosysdeps/ieee754/ldbl-opt/Makefile: Split and sort tests
H.J. Lu [Fri, 24 May 2024 13:30:57 +0000 (06:30 -0700)]
sysdeps/ieee754/ldbl-opt/Makefile: Split and sort tests

Put each test on a separate line and sort tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
3 months agos390x: Regenerate ULPs.
Stefan Liebler [Fri, 24 May 2024 07:53:49 +0000 (09:53 +0200)]
s390x: Regenerate ULPs.

Needed due to:
"Implement C23 log2p1"
commit ID 79c52daf4740b00bef43e4f5a4281b3480459b38

3 months agopowerpc: Remove duplicated versionsort from libm.a (BZ 31789)
Adhemerval Zanella [Thu, 23 May 2024 16:04:43 +0000 (13:04 -0300)]
powerpc: Remove duplicated versionsort from libm.a (BZ 31789)

The powerpc32 have an extra versionsort provided by LFS
versionsort64.o.  It seems that 5226a81f5517bcbc892679cca792006a6bafc53f
used the wrong check to create the alias for the LFS to non-LFS version.
It should not matter for _DIRENT_MATCHES_DIRENT64 since both symbols
have the same implementation.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoUpdate kernel version to 6.9 in header constant tests
Joseph Myers [Thu, 23 May 2024 14:04:48 +0000 (14:04 +0000)]
Update kernel version to 6.9 in header constant tests

This patch updates the kernel version in the tests tst-mman-consts.py
and tst-mount-consts.py to 6.9.  (There are no new constants covered
by these tests in 6.9 that need any other header changes;
tst-pidfd-consts.py was updated separately along with adding new
constants relevant to that test.)

Tested with build-many-glibcs.py.

3 months agolocaledata: cv_RU: update translation
Mike FABIAN [Wed, 22 May 2024 15:42:18 +0000 (17:42 +0200)]
localedata: cv_RU: update translation

Resolves: BZ # 21271

3 months agomath: Provide missing math symbols on libc.a (BZ 31781)
Adhemerval Zanella [Wed, 22 May 2024 18:07:12 +0000 (15:07 -0300)]
math: Provide missing math symbols on libc.a (BZ 31781)

The libc.a for alpha, s390, and sparcv9 does not provide
copysignf64x, copysignf128, frexpf64x, frexpf128, modff64x, and
modff128.

Checked with a static build for the affected ABIs.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agos390: Make utmp32, utmpx32, and login32 shared only (BZ 31790)
Adhemerval Zanella [Wed, 22 May 2024 17:29:49 +0000 (14:29 -0300)]
s390: Make utmp32, utmpx32, and login32 shared only (BZ 31790)

The function that work with 'struct utmp32' and 'struct utmpx32'
are only for compat symbols.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agomicroblaze: Remove cacheflush from libc.a (BZ 31788)
Adhemerval Zanella [Wed, 22 May 2024 16:09:36 +0000 (13:09 -0300)]
microblaze: Remove cacheflush from libc.a (BZ 31788)

microblaze does not export it in libc.so nor the kernel provides the
cacheflush syscall.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agopowerpc: Remove duplicated llrintf and llrintf32 from libm.a (BZ 31787)
Adhemerval Zanella [Wed, 22 May 2024 14:49:10 +0000 (11:49 -0300)]
powerpc: Remove duplicated llrintf and llrintf32 from libm.a (BZ 31787)

Both the generic and POWER6 versions provide definitions of the
symbol, which are already provided by the ifunc resolver.

Checked on powerpc-linux-gnu-power4.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agopowerpc: Remove duplicate strchrnul and strncasecmp_l libc.a (BZ 31786)
Adhemerval Zanella [Wed, 22 May 2024 14:32:04 +0000 (11:32 -0300)]
powerpc: Remove duplicate strchrnul and strncasecmp_l libc.a (BZ 31786)

For powerpc64 the generic version provides a weak definition of
strchrnul, which are already provided by the ifunc resolver.  The
powerpc32 version is slight different, where for static case there
is no iFUNC support.

The strncasecmp_l is provided ifunc resolver.

Checked on powerpc-linux-gnu-power4 and powerpc64-linux-gnu.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoloongarch: Remove duplicate strnlen in libc.a (BZ 31785)
Adhemerval Zanella [Wed, 22 May 2024 13:21:10 +0000 (10:21 -0300)]
loongarch: Remove duplicate strnlen in libc.a (BZ 31785)

The generic version provides weak definitions of strnlen,
which are already provided by the ifunc resolver.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoaarch64: Remove duplicate memchr/strlen in libc.a (BZ 31777)
Adhemerval Zanella [Wed, 22 May 2024 13:13:21 +0000 (10:13 -0300)]
aarch64: Remove duplicate memchr/strlen in libc.a (BZ 31777)

The generic version provides weak definitions of memchr/strlen,
which are already provided by the ifunc resolvers.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoUpdate PIDFD_* constants for Linux 6.9
Joseph Myers [Thu, 23 May 2024 12:22:40 +0000 (12:22 +0000)]
Update PIDFD_* constants for Linux 6.9

Linux 6.9 adds some more PIDFD_* constants.  Add them to glibc's
sys/pidfd.h, including updating comments that said FLAGS was reserved
and must be 0, along with updating tst-pidfd-consts.py.

Tested with build-many-glibcs.py.

3 months agoDefine write_profiling functions only in profile library [BZ #31756]
H.J. Lu [Mon, 20 May 2024 01:46:53 +0000 (18:46 -0700)]
Define write_profiling functions only in profile library [BZ #31756]

libc.so doesn't use nor export write_profiling functions.  There is no
point to define them in libc.so nor in libc.a.  Fix BZ #31756 by defining
them only in profile library.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoDon't provide XXXf128_do_not_use aliases [BZ #31757]
H.J. Lu [Mon, 20 May 2024 12:25:34 +0000 (05:25 -0700)]
Don't provide XXXf128_do_not_use aliases [BZ #31757]

Don't provide __nexttowardf128_do_not_use, nexttowardf128_do_not_use,
finitef128_do_not_use, isinff128_do_not_use and isnanf128_do_not_use.
This fixes BZ #31757.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoDon't provide scalb/significand _FloatN aliases [BZ #31760]
H.J. Lu [Mon, 20 May 2024 16:56:36 +0000 (09:56 -0700)]
Don't provide scalb/significand _FloatN aliases [BZ #31760]

scalb is a deprecated interface which was obsolescent in POSIX.1-2001,
removed in POSIX.1-2008, never made to C standard.  significant was
originally from BSD and never made in any standard.  Fix BZ #31760 by
not providing _FloatN aliases for them.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agomath: Fix isnanf128 static build (BZ 31774)
Adhemerval Zanella [Tue, 21 May 2024 16:52:54 +0000 (13:52 -0300)]
math: Fix isnanf128 static build (BZ 31774)

Some static implementation of float128 routines might call __isnanf128,
which is not provided by the static object.

Checked on x86_64-linux-gnu.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agomath: Add support for auto static math tests
Adhemerval Zanella [Tue, 21 May 2024 16:52:53 +0000 (13:52 -0300)]
math: Add support for auto static math tests

It basically copy the already in place rules for dynamic tests for
auto-generated math functions for all support types.  To avoid the
need to duplicate .inc files, a .SECONDEXPANSION rules is adeed for
the gen-libm-test.py generation.

New tests are added on the new rules 'libm-test-funcs-auto-static',
'libm-test-funcs-noauto-static', and 'libm-test-funcs-narrow-static';
similar to the non-static counterparts.

To avoid add extra build and disk requirement, the new math static
tests are only enable with a new define 'build-math-static-tests'.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 months agoChange _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766]
H.J. Lu [Tue, 21 May 2024 02:30:58 +0000 (19:30 -0700)]
Change _IO_stderr_/_IO_stdin_/_IO_stdout to compat symbols [BZ #31766]

Since Glibc never provides symbol binary compatibility for relocatable
files, fix BZ #31766 by changing _IO_stderr_/_IO_stdin_/_IO_stdout to
compat symbols.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
3 months agoObsolete _dl_mcount_wrapper in glibc 2.40 [BZ #31765]
H.J. Lu [Tue, 21 May 2024 02:37:20 +0000 (19:37 -0700)]
Obsolete _dl_mcount_wrapper in glibc 2.40 [BZ #31765]

There is no _dl_mcount_wrapper prototype in any installed header files.
Fix BZ #31765 by changing _dl_mcount_wrapper to a compat symbol and
obsolete it in glibc 2.40.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
3 months agomath: Fix i386 and m68k exp10 on static build (BZ 31775)
Adhemerval Zanella [Wed, 20 Mar 2024 14:31:54 +0000 (11:31 -0300)]
math: Fix i386 and m68k exp10 on static build (BZ 31775)

The commit 08ddd26814 removed the static exp10 on i386 and m68k with an
empty w_exp10.c (required for the ABIs that uses the newly
implementation).  This patch fixes by adding the required symbols on the
arch-specific w_exp{f}_compat.c implementation.

Checked on i686-linux-gnu and with a build for m68k-linux-gnu.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
3 months agomath: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)
Adhemerval Zanella [Thu, 14 Mar 2024 17:59:35 +0000 (14:59 -0300)]
math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)

The commit 16439f419b removed the static fmod/fmodf on i386 and m68k
with and empty w_fmod.c (required for the ABIs that uses the newly
implementation).  This patch fixes by adding the required symbols on
the arch-specific w_fmod{f}_compat.c implementation.

To statically build fmod fails on some ABI (alpha, s390, sparc) because
it does not export the ldexpf128, this is also fixed by this patch.

Checked on i686-linux-gnu and with a build for m68k-linux-gnu.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
3 months agoRemove the clone3 symbol from libc.a [BZ #31770]
H.J. Lu [Tue, 21 May 2024 12:28:29 +0000 (05:28 -0700)]
Remove the clone3 symbol from libc.a [BZ #31770]

clone3 isn't exported from glibc and is hidden in libc.so.  Fix BZ #31770
by removing clone3 alias.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 months agoaarch64/fpu: Add vector variants of pow
Joe Ramsay [Thu, 16 May 2024 08:21:24 +0000 (09:21 +0100)]
aarch64/fpu: Add vector variants of pow

Plus a small amount of moving includes around in order to be able to
remove duplicate definition of asuint64.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
3 months agoCompile libmvec with -fno-math-errno
Joe Ramsay [Thu, 16 May 2024 08:16:36 +0000 (09:16 +0100)]
Compile libmvec with -fno-math-errno

Rounding intrinsics may not be inlined without
-fno-math-errno. libmvec is free to do what it
likes with errno, so disable it for better
performance.

Tested with no regression on aarch64 and x86_64.

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
This page took 0.096936 seconds and 5 git commands to generate.