glibc/glibc-upstream-2.39-86.patch
Arjun Shankar b30ff9539f Sync with upstream branch release/2.39/master
Upstream commit: 4bdcc1963bc2b5ba5f8e319e402d9eb2cb6096c1

- manual: make setrlimit() description less ambiguous
- manual/stdio: Clarify putc and putwc
- malloc: add multi-threaded tests for aligned_alloc/calloc/malloc
- malloc: avoid global locks in tst-aligned_alloc-lib.c
- resolv: Track single-request fallback via _res._flags (bug 31476)
- resolv: Do not wait for non-existing second DNS response after error (bug 30081)
- resolv: Allow short error responses to match any query (bug 31890)
- elf: Fix localplt.awk for DT_RELR-enabled builds (BZ 31978)
- Fix usage of _STACK_GROWS_DOWN and _STACK_GROWS_UP defines [BZ 31989]
- Linux: Make __rseq_size useful for feature detection (bug 31965)
- elf: Make dl-rseq-symbols Linux only
- nptl: fix potential merge of __rseq_* relro symbols
- s390x: Fix segfault in wcsncmp [BZ #31934]
- stdlib: fix arc4random fallback to /dev/urandom (BZ 31612)
- math: Provide missing math symbols on libc.a (BZ 31781)
- math: Fix isnanf128 static build (BZ 31774)
- math: Fix i386 and m68k exp10 on static build (BZ 31775)
- math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488)
- posix: Fix pidfd_spawn/pidfd_spawnp leak if execve fails (BZ 31695)
2024-07-31 13:39:31 +02:00

59 lines
2.1 KiB
Diff

commit f6a75fddf4e71545c63dfcad99cc2df9bac38093
Author: John David Anglin <danglin@gcc.gnu.org>
Date: Fri Jul 19 10:10:17 2024 -0400
Fix usage of _STACK_GROWS_DOWN and _STACK_GROWS_UP defines [BZ 31989]
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Reviewed-By: Andreas K. Hüttel <dilfridge@gentoo.org>
(cherry picked from commit 8cfa4ecff21adf226984f135aa576dd8063bbba3)
diff --git a/malloc/memusage.c b/malloc/memusage.c
index e8ae80dc74af4585..f80225b95a36707b 100644
--- a/malloc/memusage.c
+++ b/malloc/memusage.c
@@ -172,7 +172,7 @@ update_data (struct header *result, size_t len, size_t old_len)
start_sp = __thread_stack_pointer ();
uintptr_t sp = __thread_stack_pointer ();
-#ifdef _STACK_GROWS_UP
+#if _STACK_GROWS_UP
/* This can happen in threads where we didn't catch the thread's
stack early enough. */
if (__glibc_unlikely (sp < start_sp))
diff --git a/stdlib/tst-swapcontext2.c b/stdlib/tst-swapcontext2.c
index f679755649809653..a9c1dc827cb897f3 100644
--- a/stdlib/tst-swapcontext2.c
+++ b/stdlib/tst-swapcontext2.c
@@ -85,7 +85,7 @@ do_test (void)
{
/* ____longjmp_chk has */
#if 0
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
#define called_from(this, saved) ((this) < (saved))
#else
#define called_from(this, saved) ((this) > (saved))
@@ -98,7 +98,7 @@ do_test (void)
/* Arrange stacks for uctx_func1 and uctx_func2 so that called_from
is true when setjmp is called from uctx_func1 and longjmp is called
from uctx_func2. */
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
# define UCTX_FUNC1_STACK 1
# define UCTX_FUNC2_STACK 0
#else
diff --git a/sysdeps/unix/sysv/linux/____longjmp_chk.c b/sysdeps/unix/sysv/linux/____longjmp_chk.c
index 0896dc5755dfa1db..3c66a4638eedbbea 100644
--- a/sysdeps/unix/sysv/linux/____longjmp_chk.c
+++ b/sysdeps/unix/sysv/linux/____longjmp_chk.c
@@ -23,7 +23,7 @@
#include <stdio.h>
#include <stackinfo.h>
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
#define called_from(this, saved) ((this) < (saved))
#else
#define called_from(this, saved) ((this) > (saved))