]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
3 years agointl: Handle translation output codesets with suffixes [BZ #26383]
Arjun Shankar [Fri, 25 Sep 2020 12:47:06 +0000 (14:47 +0200)] 
intl: Handle translation output codesets with suffixes [BZ #26383]

Commit 91927b7c7643 (Rewrite iconv option parsing [BZ #19519]) did not
handle cases where the output codeset for translations (via the `gettext'
family of functions) might have a caller specified encoding suffix such as
TRANSLIT or IGNORE.  This led to a regression where translations did not
work when the codeset had a suffix.

This commit fixes the above issue by parsing any suffixes passed to
__dcigettext and adds two new test-cases to intl/tst-codeset.c to
verify correct behaviour.  The iconv-internal function __gconv_create_spec
and the static iconv-internal function gconv_destroy_spec are now visible
internally within glibc and used in intl/dcigettext.c.

3 years agoRewrite iconv option parsing [BZ #19519]
Arjun Shankar [Tue, 7 Jul 2020 18:31:48 +0000 (20:31 +0200)] 
Rewrite iconv option parsing [BZ #19519]

This commit replaces string manipulation during `iconv_open' and iconv_prog
option parsing with a structured, flag based conversion specification.  In
doing so, it alters the internal `__gconv_open' interface and accordingly
adjusts its uses.

This change fixes several hangs in the iconv program and therefore includes
a new test to exercise iconv_prog options that originally led to these hangs.
It also includes a new regression test for option handling in the iconv
function.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 years agoiconv: Accept redundant shift sequences in IBM1364 [BZ #26224]
Arjun Shankar [Wed, 4 Nov 2020 11:19:38 +0000 (12:19 +0100)] 
iconv: Accept redundant shift sequences in IBM1364 [BZ #26224]

The IBM1364, IBM1371, IBM1388, IBM1390 and IBM1399 character sets
share converter logic (iconvdata/ibm1364.c) which would reject
redundant shift sequences when processing input in these character
sets.  This led to a hang in the iconv program (CVE-2020-27618).

This commit adjusts the converter to ignore redundant shift sequences
and adds test cases for iconv_prog hangs that would be triggered upon
their rejection.  This brings the implementation in line with other
converters that also ignore redundant shift sequences (e.g. IBM930
etc., fixed in commit 692de4b3960d).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
3 years agoiconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)
Michael Colavita [Thu, 19 Nov 2020 16:44:40 +0000 (11:44 -0500)] 
iconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)

Previously, in UCS4 conversion routines we limit the number of
characters we examine to the minimum of the number of characters in the
input and the number of characters in the output. This is not the
correct behavior when __GCONV_IGNORE_ERRORS is set, as we do not consume
an output character when we skip a code unit. Instead, track the input
and output pointers and terminate the loop when either reaches its
limit.

This resolves assertion failures when resetting the input buffer in a step of
iconv, which assumes that the input will be fully consumed given sufficient
output space.

3 years agomath/test-sinl-pseudo: Use stack protector only if available
Florian Weimer [Thu, 13 Feb 2020 16:01:15 +0000 (17:01 +0100)] 
math/test-sinl-pseudo: Use stack protector only if available

This fixes commit 9333498794cde1d5cca518bad ("Avoid ldbl-96 stack
corruption from range reduction of pseudo-zero (bug 25487).").

3 years agoAvoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487).
Joseph Myers [Wed, 12 Feb 2020 23:31:56 +0000 (23:31 +0000)] 
Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (bug 25487).

Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero
argument (an representation where all the significand bits, including
the explicit high bit, are zero, but the exponent is not zero, which
is not a valid representation for the long double type).

Although this is not a valid long double representation, existing
practice in this area (see bug 4586, originally marked invalid but
subsequently fixed) is that we still seek to avoid invalid memory
accesses as a result, in case of programs that treat arbitrary binary
data as long double representations, although the invalid
representations of the ldbl-96 format do not need to be consistently
handled the same as any particular valid representation.

This patch makes the range reduction detect pseudo-zero and unnormal
representations that would otherwise go to __kernel_rem_pio2, and
returns a NaN for them instead of continuing with the range reduction
process.  (Pseudo-zero and unnormal representations whose unbiased
exponent is less than -1 have already been safely returned from the
function before this point without going through the rest of range
reduction.)  Pseudo-zero representations would previously result in
the value passed to __kernel_rem_pio2 being all-zero, which is
definitely unsafe; unnormal representations would previously result in
a value passed whose high bit is zero, which might well be unsafe
since that is not a form of input expected by __kernel_rem_pio2.

Tested for x86_64.

3 years agoposix: Sync gnulib regex implementation
Adhemerval Zanella [Wed, 20 Dec 2017 11:47:44 +0000 (09:47 -0200)] 
posix: Sync gnulib regex implementation

This patch syncs the regex implementation with gnulib (commit 0ee5212).
Only two changes in GLIBC regex testing are required:

  1. posix/bug-regex28.c: as previously discussed [1] the change of
     expected results on the pattern should be safe.

  2. posix/PCRE.tests: the ERE (a)|\1 is malformed (in the sense that
     the \1 doesn't mean anything) and although current GLIBC accepts
     it has undefined behavior.  This patch removes the specific test.

This sync contains some patches from thread 'Regex: Make libc regex
more usable outside GLIBC.' [2] which have been pushed upstream in
gnulib.  This patches also fixes some regex issues (BZ #23233,
BZ #21163, BZ #18986, BZ #13762) and I did not add testcases for
both #23233 and #13762 because I couldn't think a simple way to
trigger the expected failure path to trigger them.

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

[BZ #23233]
[BZ #21163]
[BZ #18986]
[BZ #13762]
* posix/Makefile (tests): Add bug-regex37 and bug-regex38.
* posix/PCRE.tests: Remove invalid test.
* posix/bug-regex28.c: Fix expected values for used syntax.
* posix/bug-regex37.c: New file.
* posix/bug-regex38.c: Likewise.
* posix/regcomp.c: Sync with gnulib.
* posix/regex.c: Likewise.
* posix/regex.h: Likewise.
* posix/regex_internal.c: Likewise.
* posix/regex_internal.h: Likewise.
* posix/regexec.c: Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-12/msg00807.html
[2] https://sourceware.org/ml/libc-alpha/2017-12/msg00237.html

3 years agoFix use-after-free in glob when expanding ~user (bug 25414)
Andreas Schwab [Wed, 19 Feb 2020 16:21:46 +0000 (17:21 +0100)] 
Fix use-after-free in glob when expanding ~user (bug 25414)

The value of `end_name' points into the value of `dirname', thus don't
deallocate the latter before the last use of the former.

3 years agoFix a return type in elf unload test
Stan Shebs [Thu, 22 Jul 2021 20:00:52 +0000 (13:00 -0700)] 
Fix a return type in elf unload test

3 years agoFix buffer overrun in EUC-KR conversion module (bz #24973)
Andreas Schwab [Mon, 21 Dec 2020 03:26:43 +0000 (08:56 +0530)] 
Fix buffer overrun in EUC-KR conversion module (bz #24973)

The byte 0xfe as input to the EUC-KR conversion denotes a user-defined
area and is not allowed.  The from_euc_kr function used to skip two bytes
when told to skip over the unknown designation, potentially running over
the buffer end.

3 years agogconv: Fix assertion failure in ISO-2022-JP-3 module (bug 27256)
Florian Weimer [Wed, 27 Jan 2021 12:36:12 +0000 (13:36 +0100)] 
gconv: Fix assertion failure in ISO-2022-JP-3 module (bug 27256)

The conversion loop to the internal encoding does not follow
the interface contract that __GCONV_FULL_OUTPUT is only returned
after the internal wchar_t buffer has been filled completely.  This
is enforced by the first of the two asserts in iconv/skeleton.c:

      /* We must run out of output buffer space in this
 rerun.  */
      assert (outbuf == outerr);
      assert (nstatus == __GCONV_FULL_OUTPUT);

This commit solves this issue by queuing a second wide character
which cannot be written immediately in the state variable, like
other converters already do (e.g., BIG5-HKSCS or TSCII).

Reported-by: Tavis Ormandy <taviso@gmail.com>
3 years agoRead f->func.cxa under the lock.
Vitaly Buka [Thu, 15 Jul 2021 21:39:33 +0000 (14:39 -0700)] 
Read f->func.cxa under the lock.

3 years agoFix bug where ld.so hashtable would retain strings passed to dlopen().
Ambrose Feinstein [Thu, 15 Jul 2021 20:53:47 +0000 (13:53 -0700)] 
Fix bug where ld.so hashtable would retain strings passed to dlopen().

3 years agoExtend elf/unload8 to test an additional load/unload pattern
Stan Shebs [Thu, 15 Jul 2021 19:57:50 +0000 (12:57 -0700)] 
Extend elf/unload8 to test an additional load/unload pattern

3 years agoDon't crash if /var/tmp doesn't exist
Shu-Chun Weng [Mon, 3 May 2021 23:47:10 +0000 (16:47 -0700)] 
Don't crash if /var/tmp doesn't exist

`xstat` is checked `stat64` crashing the program if the latter returns
failure. In this loop, we are trying to find one folder that satisfies
the condition, no reason to crash the program if one folder doesn't.

3 years agoMore aggressively prevent a buffer from being optimized out
Shu-Chun Weng [Mon, 3 May 2021 23:12:44 +0000 (16:12 -0700)] 
More aggressively prevent a buffer from being optimized out

The volatile global variable was first introduced in e86f9654c. I have
noticed the compiler still optimizing the buffer out on AArch64
presumably because the assignment is after all other observable
behaviors so it's still valid to eliminate it.

3 years agox86_64: Remove unneeded static PIE check for undefined weak diagnostic
Fangrui Song [Thu, 8 Jul 2021 21:26:22 +0000 (14:26 -0700)] 
x86_64: Remove unneeded static PIE check for undefined weak diagnostic

https://sourceware.org/bugzilla/show_bug.cgi?id=21782 dropped an ld
diagnostic for R_X86_64_PC32 referencing an undefined weak symbol in
-pie links.  Arguably keeping the diagnostic like other ports is more
correct, since statically resolving movl foo(%rip), %eax to the
link-time zero address produces a corrupted output.

It turns out that --enable-static-pie builds do not depend on the ld
behavior. GCC generates GOT indirection for weak declarations for
-fPIE/-fPIC, so what ld does with the PC-relative relocation doesn't
really matter.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 years ago[PATCH 7/7] sin/cos slow paths: refactor sincos implementation
Wilco Dijkstra [Tue, 3 Apr 2018 15:49:33 +0000 (16:49 +0100)] 
[PATCH 7/7] sin/cos slow paths: refactor sincos implementation

Refactor the sincos implementation - rather than rely on odd partial inlining
of preprocessed portions from sin and cos, explicitly write out the cases.
This makes sincos much easier to maintain and provides an additional 16-20%
speedup between 0 and 2^27.  The overall speedup of sincos is 48% over this range.
Between 0 and PI it is 66% faster.

* sysdeps/ieee754/dbl-64/s_sin.c (__sin): Cleanup ifdefs.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sin.c (__sincos): Refactor using the same
logic as sin and cos.

3 years ago[PATCH 6/7] sin/cos slow paths: refactor duplicated code into dosin
Wilco Dijkstra [Tue, 3 Apr 2018 15:46:10 +0000 (16:46 +0100)] 
[PATCH 6/7] sin/cos slow paths: refactor duplicated code into dosin

Refactor duplicated code into do_sin.  Since all calls to do_sin use copysign to
set the sign of the result, move it inside do_sin.  Small inputs use a separate
polynomial, so move this into do_sin as well (the check is based on the more
conservative case when doing large range reduction, but could be relaxed).

* sysdeps/ieee754/dbl-64/s_sin.c (do_sin): Use TAYLOR_SIN for small
inputs.  Return correct sign.
(do_sincos): Remove small input check before do_sin, let do_sin set
the sign.
(__sin): Likewise.
(__cos): Likewise.

3 years ago[PATCH 5/7] sin/cos slow paths: remove unused slowpath functions
Wilco Dijkstra [Tue, 3 Apr 2018 15:43:34 +0000 (16:43 +0100)] 
[PATCH 5/7] sin/cos slow paths: remove unused slowpath functions

Remove all unused slowpath functions.

* sysdeps/ieee754/dbl-64/s_sin.c (TAYLOR_SLOW): Remove.
(do_cos_slow): Likewise.
(do_sin_slow): Likewise.
(reduce_and_compute): Likewise.
(slow): Likewise.
(slow1): Likewise.
(slow2): Likewise.
(sloww): Likewise.
(sloww1): Likewise.
(sloww2): Likewise.
(bslow): Likewise.
(bslow1): Likewise.
(bslow2): Likewise.
(cslow2): Likewise.

3 years ago[PATCH 4/7] sin/cos slow paths: remove slow paths from huge range reduction
Wilco Dijkstra [Tue, 3 Apr 2018 15:41:36 +0000 (16:41 +0100)] 
[PATCH 4/7] sin/cos slow paths: remove slow paths from huge range reduction

For huge inputs use the improved do_sincos function as well.  Now no cases use
the correction factor returned by do_sin, do_cos and TAYLOR_SIN, so remove it.

* sysdeps/ieee754/dbl-64/s_sin.c (TAYLOR_SIN): Remove cor parameter.
(do_cos): Remove corp parameter and calculations.
(do_sin): Likewise.
(do_sincos): Remove cor variable.
(__sin): Use do_sincos for huge inputs.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Likewise.
(reduce_and_compute_sincos): Remove unused function.

3 years ago[PATCH 3/7] sin/cos slow paths: remove slow paths from small range reduction
Wilco Dijkstra [Tue, 3 Apr 2018 15:33:13 +0000 (16:33 +0100)] 
[PATCH 3/7] sin/cos slow paths: remove slow paths from small range reduction

This patch improves the accuracy of the range reduction.  When the input is
large (2^27) and very close to a multiple of PI/2, using 110 bits of PI is not
enough.  Improve range reduction accuracy to 136 bits.  As a result the special
checks for results close to zero can be removed.  The ULP of the polynomials is
at worst 0.55ULP, so there is no reason for the slow functions, and they can be
removed.

* sysdeps/ieee754/dbl-64/s_sin.c (reduce_sincos_1): Rename to
reduce_sincos, improve accuracy to 136 bits.
(do_sincos_1): Rename to do_sincos, remove fallbacks to slow functions.
(__sin): Use improved reduction and simplified do_sincos calculation.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Likewise.

3 years ago[PATCH 2/7] sin/cos slow paths: remove large range reduction
Wilco Dijkstra [Tue, 3 Apr 2018 15:28:03 +0000 (16:28 +0100)] 
[PATCH 2/7] sin/cos slow paths: remove large range reduction

This patch removes the large range reduction code and defers to the huge range
reduction code.  The first level range reducer supports inputs up to 2^27,
which is way too large given that inputs for sin/cos are typically small
(< 10), and optimizing for a smaller range would give a significant speedup.

Input values above 2^27 are practically never used, so there is no reason for
supporting range reduction between 2^27 and 2^48.  Removing it significantly
simplifies code and enables further speedups.  There is about a 2.3x slowdown
in this range due to __branred being extremely slow  (a better algorithm could
easily more than double performance).

* sysdeps/ieee754/dbl-64/s_sin.c (reduce_sincos_2): Remove function.
(do_sincos_2): Likewise.
(__sin): Remove middle range reduction case.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Remove middle range
reduction case.

3 years ago[PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs
Wilco Dijkstra [Tue, 3 Apr 2018 15:24:29 +0000 (16:24 +0100)] 
[PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs

This series of patches removes the slow patchs from sin, cos and sincos.
Besides greatly simplifying the implementation, the new version is also much
faster for inputs up to PI (41% faster) and for large inputs needing range
reduction (27% faster).

ULP is ~0.55 with no errors found after testing 1.6 billion inputs across most
of the range with mpsin and mpcos.  The number of incorrectly rounded results
(ie. ULP >0.5) is at most ~2750 per million inputs between 0.125 and 0.5,
the average is ~850 per million between 0 and PI.

Tested on AArch64 and x86_64 with no regressions.

The first patch removes the slow paths for the cases where the input is small
and doesn't require range reduction.  Update ULP tables for sin, cos and sincos
on AArch64 and x86_64.

* sysdeps/aarch64/libm-test-ulps: Update ULP for sin, cos, sincos.
* sysdeps/ieee754/dbl-64/s_sin.c (__sin): Remove slow paths for small
inputs.
(__cos): Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps: Update ULP for sin, cos, sincos.

3 years agolocale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32
Lirong Yuan [Thu, 1 Apr 2021 19:37:23 +0000 (12:37 -0700)] 
locale: Align _nl_C_LC_CTYPE_class and _nl_C_LC_CTYPE_class32

Otherwise, programs that use character classification macros such as
isspace may observe unaligned pointers.

3 years agoChange this offsetof computation to use c89 offsetof. Tested:
Nick Lewycky [Thu, 16 Apr 2015 18:15:58 +0000 (11:15 -0700)] 
Change this offsetof computation to use c89 offsetof. Tested:

3 years agoUpdate build process to create libnsl stub
Stan Shebs [Tue, 3 Nov 2020 21:30:16 +0000 (13:30 -0800)] 
Update build process to create libnsl stub

3 years agoForward-port google-nsl-stub
Paul Pluzhnikov [Fri, 28 Feb 2014 14:44:46 +0000 (06:44 -0800)] 
Forward-port google-nsl-stub

3 years agoFix memory leak in TLS allocation
James Y Knight [Wed, 21 Oct 2020 20:38:14 +0000 (13:38 -0700)] 
Fix memory leak in TLS allocation

3 years agoAdd a test of TLS support that will fail if leaky
Stan Shebs [Wed, 21 Oct 2020 20:19:47 +0000 (13:19 -0700)] 
Add a test of TLS support that will fail if leaky

3 years agoLet time and gettimeofday use vdso by removing old clang workaround
Stan Shebs [Tue, 6 Oct 2020 20:08:18 +0000 (13:08 -0700)] 
Let time and gettimeofday use vdso by removing old clang workaround

3 years agoUse crt*.o files from llvm compiler-rt when building with clang
Stan Shebs [Tue, 9 Jun 2020 17:09:34 +0000 (10:09 -0700)] 
Use crt*.o files from llvm compiler-rt when building with clang

3 years agoDo not use ppc-specific long double pack/unpack when compiling with clang
Stan Shebs [Tue, 9 Jun 2020 17:05:56 +0000 (10:05 -0700)] 
Do not use ppc-specific long double pack/unpack when compiling with clang

3 years agoRemove old workaround in power7 logb functions, clang no longer crashes on the inline...
Stan Shebs [Thu, 6 Feb 2020 19:58:01 +0000 (11:58 -0800)] 
Remove old workaround in power7 logb functions, clang no longer crashes on the inline assembly

3 years agoAdditional fixes for llvm-as
Josh Kunz [Fri, 24 Jan 2020 01:37:14 +0000 (17:37 -0800)] 
Additional fixes for llvm-as

Unlike GCC, llvm always uses an integrated assembler, which attempts to
recognized all `asm` statements written in the C code. glibc uses some
syntactically invalid asm statements to emit constants into assembly that
are later extracted with a sed or AWK script.

This change fixes two such invalid `asm` statements by wrapping the
output in a `.ascii` directive.. This does not break the sed/AWK (the same
special sequence is output) but it makes the statement syntactically valid.

See cf8e3f8757 for a previous fix for the same issue.

3 years agoAdd workaround for infinite looping in ppc vsyscall for sched_getcpu.
Stan Shebs [Fri, 24 Jan 2020 16:17:38 +0000 (08:17 -0800)] 
Add workaround for infinite looping in ppc vsyscall for sched_getcpu.

3 years agoAdd -Wno-incomplete-setjmp-declaration to prevent clang from unhelpfully complaining...
Stan Shebs [Fri, 24 Jan 2020 16:16:04 +0000 (08:16 -0800)] 
Add -Wno-incomplete-setjmp-declaration to prevent clang from unhelpfully complaining about __sigsetjmp, both in library build and testsuite runs.

3 years agoUpdate passwd.borg handling to use passwd.borg.real
Stan Shebs [Fri, 20 Dec 2019 21:58:35 +0000 (13:58 -0800)] 
Update passwd.borg handling to use passwd.borg.real

3 years agoAdd a case to async-signal-safe TLS to set static TLS instead of waiting for a dlopen...
Stan Shebs [Fri, 8 Nov 2019 21:41:17 +0000 (13:41 -0800)] 
Add a case to async-signal-safe TLS to set static TLS instead of waiting for a dlopen that may not actually be happening.

3 years agoAdd an LD_DEBUG=tls option to help debug thread-local storage handling in ld.so
Stan Shebs [Fri, 8 Nov 2019 20:40:53 +0000 (12:40 -0800)] 
Add an LD_DEBUG=tls option to help debug thread-local storage handling in ld.so

3 years agoRemove an unneeded local refactor in _dl_update_slotinfo
Stan Shebs [Wed, 30 Oct 2019 20:32:13 +0000 (13:32 -0700)] 
Remove an unneeded local refactor in _dl_update_slotinfo

3 years agoFix year 2039 bug for localtime with 64-bit time_t (bug 22639).
Joseph Myers [Fri, 18 May 2018 11:57:15 +0000 (11:57 +0000)] 
Fix year 2039 bug for localtime with 64-bit time_t (bug 22639).

Bug 22639 reports localtime failing to handle time offset transitions
correctly in 2039 and later on platforms with 64-bit time_t.

The problem is the use of SECSPERDAY (constant 86400) in calculations
such as

    t = ((year - 1970) * 365
 + /* Compute the number of leapdays between 1970 and YEAR
      (exclusive).  There is a leapday every 4th year ...  */
 + ((year - 1) / 4 - 1970 / 4)
 /* ... except every 100th year ... */
 - ((year - 1) / 100 - 1970 / 100)
 /* ... but still every 400th year.  */
 + ((year - 1) / 400 - 1970 / 400)) * SECSPERDAY;

where t is of type time_t and year is of type int.  Before my commit
92bd70fb85bce57ac47ba5d8af008736832c955a (an update from tzcode,
included in 2.26 and later releases), SECSPERDAY was obtained from a
file imported from tzcode, where the value included a cast to
int_fast32_t.  On 64-bit platforms, glibc defines int_fast32_t to be
long int, so 64-bit, but my patch resulted in it changing to int.
(The bug would probably have existed even before my patch for x32,
which has 64-bit time_t but 32-bit int_fast32_t, but I haven't
verified that.)

This patch fixes the problem by including a cast to time_t in the
definition of SECSPERDAY.  (64-bit time support for 32-bit systems
should move such code that isn't a public interface to using the
internal 64-bit version of time_t throughout.)

Tested for x86_64 and x86.

[BZ #22639]
* time/tzset.c (SECSPERDAY): Cast to time_t.
* time/tst-y2039.c: New file.
* time/Makefile (tests): Add tst-y2039.

3 years agoReduce __MAX_ALLOCA_CUTOFF to 8192
Stan Shebs [Tue, 8 Oct 2019 21:30:43 +0000 (14:30 -0700)] 
Reduce __MAX_ALLOCA_CUTOFF to 8192

3 years agoMake multi-arch ifunc support work with clang
Stan Shebs [Tue, 8 Oct 2019 20:00:12 +0000 (13:00 -0700)] 
Make multi-arch ifunc support work with clang

3 years agoRevert clang workaround for _begin that is no longer needed
Stan Shebs [Tue, 8 Oct 2019 14:07:18 +0000 (07:07 -0700)] 
Revert clang workaround for _begin that is no longer needed

3 years agoRedesign the fastload support for additional performance
Ambrose Feinstein [Wed, 11 Sep 2019 21:53:28 +0000 (14:53 -0700)] 
Redesign the fastload support for additional performance

3 years agoAdd comments explaining the diff from cf8e3f8757
Josh Kunz [Mon, 12 Aug 2019 20:28:09 +0000 (13:28 -0700)] 
Add comments explaining the diff from cf8e3f8757

These comments should make it easier to see the (small) diff introduced
in cf8e3f8757. Without these comments, the diff may get list on a future
upstream merge.

3 years agoMake gen-XX-const scripts work with llvm-as
Josh Kunz [Wed, 7 Aug 2019 18:40:50 +0000 (11:40 -0700)] 
Make gen-XX-const scripts work with llvm-as

The gen-as-const and gen-py-const scripts are used to generate integer constant
definitions from a list of constant C-expressions. This is achieved by
generating a C program with inline `asm` statements, that depend on
these constant expressions. During compilation, the constant expressions
are evaluated, and included in the inline asm. The build process
generates only the assembly, and then used `sed` to extract the values
from the assembly text.

This is clever. It allows the build process to extract the value of C
statements built under the target architecture. The implementation is a
bit fragile, but it is not immediately obvious to me how it could be
improved.

This change slightly modifies `gen-as-const` and `gen-py-const` to emit
valid assembly directives instead of invalid directives that were
previously emitted. Since the values are extracted via string parsing,
this has no effect on the values extracted. This is needed because the
LLVM assembler validates all statements before emitting them, whereas it
appears GCC will literally emit any `asm` directives without validation
or recognition.

3 years agoFix sense of a test in the static-linking version of ppc get_clockfreq
Stan Shebs [Fri, 17 May 2019 19:25:19 +0000 (12:25 -0700)] 
Fix sense of a test in the static-linking version of ppc get_clockfreq

3 years agoMakes it compile for AArch64
Shu-Chun Weng [Fri, 19 Apr 2019 21:50:50 +0000 (14:50 -0700)] 
Makes it compile for AArch64

De-nesting fix in 83c02e85 changed function signature but AArch64 was untested.

3 years agoMakes AArch64 assembly acceptable to clang
Shu-Chun Weng [Fri, 19 Apr 2019 21:47:59 +0000 (14:47 -0700)] 
Makes AArch64 assembly acceptable to clang

According to ARMv8 architecture reference manual section C7.2.188, SIMD MOV (to
general) instruction format is

  MOV <Xd>, <Vn>.D[<index>]

gas appears to accept "<Vn>.2D[<index>]" as well, but clang's assembler does
not. C.f. https://community.arm.com/developer/ip-products/processors/f/cortex-a-forum/5214/aarch64-assembly-syntax-for-armclang

3 years agoInclude STATIC_PIE_BOOTSTRAP with !NESTING in powerpc64/dl-machine.h
Siva Chandra Reddy [Tue, 9 Apr 2019 18:57:19 +0000 (11:57 -0700)] 
Include STATIC_PIE_BOOTSTRAP with !NESTING in powerpc64/dl-machine.h

3 years agoActuall use LLVM_OBJCOPY if available.
Siva Chandra Reddy [Mon, 8 Apr 2019 20:54:25 +0000 (13:54 -0700)] 
Actuall use LLVM_OBJCOPY if available.

3 years agoUse llvm-objcopy, if available, to remove the .llvm_addrsig sections.
Siva Chandra Reddy [Fri, 5 Apr 2019 14:46:36 +0000 (07:46 -0700)] 
Use llvm-objcopy, if available, to remove the .llvm_addrsig sections.

3 years agoEnable relaxed relocations when building certain object files for x86_64.
Siva Chandra Reddy [Tue, 2 Apr 2019 17:18:01 +0000 (10:18 -0700)] 
Enable relaxed relocations when building certain object files for x86_64.

3 years agoUn-nest an include in dl-reloc-static-pie.c.
Siva Chandra Reddy [Mon, 1 Apr 2019 18:26:29 +0000 (11:26 -0700)] 
Un-nest an include in dl-reloc-static-pie.c.

A corresponding adjustment in sysdeps/x86_64/dl-machine.h has also been
made.

3 years agoDisable -mfloat128 for clang, lets power9 insns into power8 executables
Stan Shebs [Mon, 25 Mar 2019 22:21:27 +0000 (15:21 -0700)] 
Disable -mfloat128 for clang, lets power9 insns into power8 executables

3 years agoAlso work around clang bctrl issue in get_clockfreq.c
Stan Shebs [Mon, 25 Mar 2019 21:03:24 +0000 (14:03 -0700)] 
Also work around clang bctrl issue in get_clockfreq.c

3 years ago[BZ #19239] Don't include sys/sysmacros.h from sys/types.h.
Zack Weinberg [Wed, 7 Feb 2018 20:45:58 +0000 (15:45 -0500)] 
[BZ #19239] Don't include sys/sysmacros.h from sys/types.h.

This completes the deprecation and removal of this inclusion, which
was begun in the 2.25 release.

* posix/sys/types.h: Don't include sys/sysmacros.h.
* misc/sys/sysmacros.h: Remove the conditional deprecation
warnings for the macros defined by this header.

3 years agoRemove .llvm_addrsig sections from crt.o files
Stan Shebs [Wed, 27 Feb 2019 22:03:33 +0000 (14:03 -0800)] 
Remove .llvm_addrsig sections from crt.o files

3 years agoForward-port cl/42676407 to disable link-time warning about mktemp, tempnam and tmpnam.
Brooks Moses [Fri, 13 Jun 2014 04:59:51 +0000 (21:59 -0700)] 
Forward-port cl/42676407 to disable link-time warning about mktemp, tempnam and tmpnam.

3 years agoChanges to compile glibc-2.27 on PPC (Power8) with clang.
Raman Tenneti [Fri, 27 Aug 2021 23:36:05 +0000 (16:36 -0700)] 
Changes to compile glibc-2.27 on PPC (Power8) with clang.

+ Use DOT_MACHINE macro instead of ".machine" instruction.
+ Use __isinf and __isinff instead of builtin versions.
+ In s_logb, s_logbf and s_logbl functions, used float versions to
  calculate "ret = x & 0x7f800000;" expression.

3 years agoAdd a note about passwd.borg.base organization
Stan Shebs [Wed, 5 Dec 2018 19:10:03 +0000 (11:10 -0800)] 
Add a note about passwd.borg.base organization

3 years agoFix mistaken order of arguments to open_path
Stan Shebs [Wed, 5 Dec 2018 17:47:39 +0000 (09:47 -0800)] 
Fix mistaken order of arguments to open_path

3 years agoUpdate build notes
Stan Shebs [Thu, 15 Nov 2018 19:59:49 +0000 (11:59 -0800)] 
Update build notes

3 years agoUndid the dl_enable_fastload environment variable changes.
Raman Tenneti [Fri, 17 Aug 2018 18:31:35 +0000 (11:31 -0700)] 
Undid the dl_enable_fastload environment variable changes.

3 years agoAdd "fastload" support.
Paul Pluzhnikov [Wed, 5 Mar 2014 03:07:05 +0000 (19:07 -0800)] 
Add "fastload" support.

3 years agoWork around lack of mfppr in clang
Stan Shebs [Thu, 27 Sep 2018 18:14:32 +0000 (11:14 -0700)] 
Work around lack of mfppr in clang

3 years agoWork around mtfsb0 syntax limitation with clang
Stan Shebs [Wed, 26 Sep 2018 21:44:39 +0000 (14:44 -0700)] 
Work around mtfsb0 syntax limitation with clang

3 years agoAvoid passing gcc-specific options to clang
Stan Shebs [Wed, 26 Sep 2018 21:31:55 +0000 (14:31 -0700)] 
Avoid passing gcc-specific options to clang

3 years agoMake asm-based constraints be gcc-only
Stan Shebs [Wed, 26 Sep 2018 21:16:30 +0000 (14:16 -0700)] 
Make asm-based constraints be gcc-only

3 years agoMake xxland syntax gcc-only
Stan Shebs [Wed, 26 Sep 2018 21:14:49 +0000 (14:14 -0700)] 
Make xxland syntax gcc-only

3 years agoAdd a first approximation of float definitions for ppc clang
Stan Shebs [Wed, 26 Sep 2018 21:04:13 +0000 (14:04 -0700)] 
Add a first approximation of float definitions for ppc clang

3 years agoMake powerpc .machine directives be gcc-only
Stan Shebs [Fri, 27 Aug 2021 23:42:33 +0000 (16:42 -0700)] 
Make powerpc .machine directives be gcc-only

3 years agoMake mutex hints gcc-only, improve a type in __arch_compare_and_exchange_bool_32_acq
Stan Shebs [Wed, 26 Sep 2018 20:50:57 +0000 (13:50 -0700)] 
Make mutex hints gcc-only, improve a type in __arch_compare_and_exchange_bool_32_acq

3 years agoMake power6 directives be gcc-only
Stan Shebs [Wed, 26 Sep 2018 20:47:46 +0000 (13:47 -0700)] 
Make power6 directives be gcc-only

3 years agoAdd power9 flag to go with -mfloat128
Stan Shebs [Wed, 26 Sep 2018 20:43:57 +0000 (13:43 -0700)] 
Add power9 flag to go with -mfloat128

3 years agoDisable more attempts to pass -mlong-double-128 to clang
Stan Shebs [Wed, 26 Sep 2018 20:36:42 +0000 (13:36 -0700)] 
Disable more attempts to pass -mlong-double-128 to clang

3 years agoDisable attempts to pass -mlong-double-128 to clang
Stan Shebs [Wed, 26 Sep 2018 20:13:31 +0000 (13:13 -0700)] 
Disable attempts to pass -mlong-double-128 to clang

3 years agoAdd workaround for clang link failure in elf/tst-unique4
Stan Shebs [Wed, 26 Sep 2018 15:06:14 +0000 (08:06 -0700)] 
Add workaround for clang link failure in elf/tst-unique4

3 years agoAdd workaround for infinite looping in ppc vsyscalls
Stan Shebs [Tue, 25 Sep 2018 17:52:37 +0000 (10:52 -0700)] 
Add workaround for infinite looping in ppc vsyscalls

3 years agoWork around clang crash by skipping apparently-unneeded asm
Stan Shebs [Tue, 25 Sep 2018 15:04:10 +0000 (08:04 -0700)] 
Work around clang crash by skipping apparently-unneeded asm

3 years agoWork around clang problem with ifuncs and vdso
Stan Shebs [Tue, 25 Sep 2018 14:58:13 +0000 (07:58 -0700)] 
Work around clang problem with ifuncs and vdso

3 years agoWork around a ppc clang inlining bug
Stan Shebs [Tue, 25 Sep 2018 14:48:20 +0000 (07:48 -0700)] 
Work around a ppc clang inlining bug

3 years agoAdd workaround for segfaults in __longjmp when compiled with ppc clang
Stan Shebs [Tue, 25 Sep 2018 14:20:18 +0000 (07:20 -0700)] 
Add workaround for segfaults in __longjmp when compiled with ppc clang

3 years agoAdd clang version of find_cxx_header
Stan Shebs [Mon, 24 Sep 2018 22:31:31 +0000 (15:31 -0700)] 
Add clang version of find_cxx_header

3 years agoChange de-nesting fix to use added argument instead of globals
Stan Shebs [Fri, 14 Sep 2018 17:21:15 +0000 (10:21 -0700)] 
Change de-nesting fix to use added argument instead of globals

3 years agoFix regressions in async-safe TLS, add run-time control for debugging, add more comments
Stan Shebs [Fri, 3 Aug 2018 18:24:51 +0000 (11:24 -0700)] 
Fix regressions in async-safe TLS, add run-time control for debugging, add more comments

3 years agoFix TLS problems not handled by cherrypick
Stan Shebs [Tue, 10 Jul 2018 19:05:15 +0000 (12:05 -0700)] 
Fix TLS problems not handled by cherrypick

3 years agoRevert upstream removal of async-safe TLS patches.
Brooks Moses [Mon, 24 Feb 2014 19:04:49 +0000 (11:04 -0800)] 
Revert upstream removal of async-safe TLS patches.

3 years agoMake pointer in tst-realloc volatile also
Stan Shebs [Fri, 8 Jun 2018 20:47:29 +0000 (13:47 -0700)] 
Make pointer in tst-realloc volatile also

3 years agoAdd a GRTE-specific readme.
Stan Shebs [Wed, 6 Jun 2018 18:42:14 +0000 (11:42 -0700)] 
Add a GRTE-specific readme.

3 years agoWork around a make 3.81 segfault with clang
Stan Shebs [Fri, 1 Jun 2018 21:57:50 +0000 (14:57 -0700)] 
Work around a make 3.81 segfault with clang

3 years agoNEWS: Move security-lated changes before bug list
Florian Weimer [Thu, 24 May 2018 13:50:29 +0000 (15:50 +0200)] 
NEWS: Move security-lated changes before bug list

This matches the practice for previous releases.

3 years agoAdd references to CVE-2018-11236, CVE-2017-18269
Florian Weimer [Thu, 24 May 2018 12:41:57 +0000 (14:41 +0200)] 
Add references to CVE-2018-11236, CVE-2017-18269

3 years agoAdd a test case for [BZ #23196]
H.J. Lu [Wed, 23 May 2018 10:59:56 +0000 (03:59 -0700)] 
Add a test case for [BZ #23196]

[BZ #23196]
* string/test-memcpy.c (do_test1): New function.
(test_main): Call it.

(cherry picked from commit ed983107bbc62245b06b99f02e69acf36a0baa3e)

3 years agoDon't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196)
Andreas Schwab [Thu, 24 May 2018 12:39:18 +0000 (14:39 +0200)] 
Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196)

When compiled as mempcpy, the return value is the end of the destination
buffer, thus it cannot be used to refer to the start of it.

(cherry picked from commit 9aaaab7c6e4176e61c59b0a63c6ba906d875dc0e)

3 years agosunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]
Florian Weimer [Tue, 15 May 2018 06:21:11 +0000 (08:21 +0200)] 
sunrpc: Remove stray exports without --enable-obsolete-rpc [BZ #23166]

This is needed to avoid a warning when linking against libtirpc:

/lib64/libc.so.6: warning: common of `rpc_createerr@@TIRPC_0.3.0' overridden by definition
/usr/lib64/libtirpc.so: warning: defined here

This ld warning is not enabled by default; -Wl,--warn-common enables it.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 89aacb513eb77549a29df2638913a0f8178cf3f5)

3 years agogd_GB: Fix typo in abbreviated "May" (bug 23152).
Rafal Luzynski [Wed, 9 May 2018 01:06:32 +0000 (03:06 +0200)] 
gd_GB: Fix typo in abbreviated "May" (bug 23152).

[BZ #23152]
* localedata/locales/gd_GB (abmon): Fix typo in May:
"Mhàrt" -> "Cèit".  Adjust the comment according to the change.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit bb066cb806dfe55511cf2fb59bf013751152608f)

3 years agoNEWS: add entries for bugs 17343, 20419, 22644, 22786, 22884, 22947, 23005, 23037...
Dmitry V. Levin [Thu, 10 May 2018 10:56:25 +0000 (10:56 +0000)] 
NEWS: add entries for bugs 17343, 20419, 22644, 22786, 22884, 22947, 23005, 23037, 23069, 23137