Skip to content

Commit

Permalink
Fix build for glibc with latest master-epic patch set...
Browse files Browse the repository at this point in the history
...due to:
* glibc: [nptl: Add support for setup guard pages with MADV_GUARD_INSTALL](https://sourceware.org/git/?p=glibc.git;a=commit;h=a6fbe36b7f31292981422692236465ab56670ea9)
  • Loading branch information
johnny-mnemonic committed Jan 31, 2025
1 parent 9fe712d commit cfcb1c6
Show file tree
Hide file tree
Showing 25 changed files with 60 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0ab8e8ee182affb0f3ce7c9bfb50d04ff5636e3e Mon Sep 17 00:00:00 2001
From 28e10e304dac50ed65e60f7dd94888c90f69f1dc Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 10 Jan 2024 21:08:26 +0100
Subject: [PATCH 01/25] Revert "Remove ia64-linux-gnu"
Expand All @@ -15,7 +15,7 @@ This reverts commit 460860f457e2a889785c506e8c77d4a7dff24d3e.
manual/install.texi | 2 +
manual/math.texi | 2 +-
math/libm-test-support.h | 2 +-
nptl/allocatestack.c | 24 +-
nptl/allocatestack.c | 14 +-
nptl/perf.c | 2 +
scripts/build-many-glibcs.py | 5 +
support/xclone.c | 11 +-
Expand Down Expand Up @@ -570,7 +570,7 @@ This reverts commit 460860f457e2a889785c506e8c77d4a7dff24d3e.
sysdeps/unix/sysv/linux/tst-misalign-clone.c | 19 +-
sysdeps/unix/sysv/linux/xstat64.c | 2 +-
sysdeps/x86/readelflib.c | 13 +
565 files changed, 155609 insertions(+), 45 deletions(-)
565 files changed, 155598 insertions(+), 46 deletions(-)
create mode 100644 sysdeps/ia64/Implies
create mode 100644 sysdeps/ia64/Makeconfig
create mode 100644 sysdeps/ia64/Makefile
Expand Down Expand Up @@ -1262,11 +1262,11 @@ index c1c25786ce..7c90444ff5 100644
# define XFAIL_FLOAT128_PAYLOAD (TEST_COND_binary128 ? XFAIL_TEST : 0)
#else
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 9c1a72bcf0..47ef1779f1 100644
index 800ca89720..384943c73c 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -152,7 +152,9 @@ __attribute ((always_inline))
guard_position (void *mem, size_t size, size_t guardsize, struct pthread *pd,
@@ -179,7 +179,9 @@ __attribute ((always_inline))
guard_position (void *mem, size_t size, size_t guardsize, const struct pthread *pd,
size_t pagesize_m1)
{
-#if _STACK_GROWS_DOWN
Expand All @@ -1276,16 +1276,34 @@ index 9c1a72bcf0..47ef1779f1 100644
return mem;
#elif _STACK_GROWS_UP
return (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
@@ -166,7 +168,7 @@ setup_stack_prot (char *mem, size_t size, char *guard, size_t guardsize,
const int prot)
{
char *guardend = guard + guardsize;
@@ -218,7 +220,7 @@ setup_stack_prot (char *mem, size_t size, struct pthread *pd,
{
const int prot = stack_prot ();
char *guardend = guard + guardsize;
-#if _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN && !defined(NEED_SEPARATE_REGISTER_STACK)
/* As defined at guard_position, for architectures with downward stack
the guard page is always at start of the allocated area. */
if (__mprotect (guardend, size - guardsize, prot) != 0)
@@ -285,7 +287,7 @@ adjust_stack_prot (char *mem, size_t size, const struct pthread *pd,
if (pd->stack_mode == ALLOCATE_GUARD_MADV_GUARD)
{
void *slack =
-#if _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN && !defined(NEED_SEPARATE_REGISTER_STACK)
mem + guardsize;
#else
guard_position (mem, size, pd->guardsize, pd, pagesize_m1);
@@ -295,7 +297,7 @@ adjust_stack_prot (char *mem, size_t size, const struct pthread *pd,
else if (pd->stack_mode == ALLOCATE_GUARD_PROT_NONE)
{
const int prot = stack_prot ();
-#if _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN && !defined(NEED_SEPARATE_REGISTER_STACK)
/* As defined at guard_position, for architectures with downward stack
the guard page is always at start of the allocated area. */
if (__mprotect (guardend, size - guardsize, prot) != 0)
@@ -189,7 +191,7 @@ advise_stack_range (void *mem, size_t size, uintptr_t pd, size_t guardsize)
return __mprotect (mem + guardsize, slacksize, prot) == 0;
#else
char *new_guard = (char *)(((uintptr_t) pd - guardsize)
@@ -320,7 +322,7 @@ advise_stack_range (void *mem, size_t size, uintptr_t pd, size_t guardsize)
{
uintptr_t sp = (uintptr_t) CURRENT_STACK_FRAME;
size_t pagesize_m1 = __getpagesize () - 1;
Expand All @@ -1294,34 +1312,13 @@ index 9c1a72bcf0..47ef1779f1 100644
size_t freesize = (sp - (uintptr_t) mem) & ~pagesize_m1;
assert (freesize < size);
if (freesize > PTHREAD_STACK_MIN)
@@ -491,7 +493,19 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
{
/* The old guard area is too large. */

-#if _STACK_GROWS_DOWN
+#ifdef NEED_SEPARATE_REGISTER_STACK
+ char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
+ char *oldguard = mem + (((size - pd->guardsize) / 2) & ~pagesize_m1);
+
+ if (oldguard < guard
+ && __mprotect (oldguard, guard - oldguard, prot) != 0)
+ goto mprot_error;
+
+ if (__mprotect (guard + guardsize,
+ oldguard + pd->guardsize - guard - guardsize,
+ prot) != 0)
+ goto mprot_error;
+#elif _STACK_GROWS_DOWN
if (__mprotect ((char *) mem + guardsize, pd->guardsize - guardsize,
prot) != 0)
goto mprot_error;
@@ -568,7 +582,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
static void
name_stack_maps (struct pthread *pd, bool set)
@@ -655,7 +657,7 @@ name_stack_maps (struct pthread *pd, bool set)
{
size_t adjust = pd->stack_mode == ALLOCATE_GUARD_PROT_NONE ?
pd->guardsize : 0;
-#if _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN && !defined(NEED_SEPARATE_REGISTER_STACK)
void *stack = pd->stackblock + pd->guardsize;
void *stack = pd->stackblock + adjust;
#else
void *stack = pd->stackblock;
diff --git a/nptl/perf.c b/nptl/perf.c
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From bd4587bf853343239587f93185be11bc3f4007df Mon Sep 17 00:00:00 2001
From 9999f6e0db85ca88dd4cec3d51488eb3db906daf Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 23 May 2024 16:35:52 +0200
Subject: [PATCH 02/25] Replay "Refer to C23 in place of C2X in glibc" also for
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b3839a71230a9ad998ce0b06e8dad4c879a3aab5 Mon Sep 17 00:00:00 2001
From 16b3c3e615106df2d95cfac8c95f3fe83dce4909 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 23 Jun 2024 21:31:55 +0200
Subject: [PATCH 03/25] Replay "Implement C23 log2p1" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 904411cbce4cf4f0017f99ea3c8bb85bf59d0a0d Mon Sep 17 00:00:00 2001
From 4407df00068c7d3accfd7b5375c12e4df26c995f Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 27 Jun 2024 10:22:11 +0200
Subject: [PATCH 04/25] Replay "Implement C23 logp1" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 82ba6ccb59b35fad7626aadc75cf277b91c794a8 Mon Sep 17 00:00:00 2001
From 53835e95768b8ebe0b9858d8362704cda09aef4b Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 23 Jun 2024 21:34:06 +0200
Subject: [PATCH 05/25] Replay "Implement C23 log10p1" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 1d7fd95c40d8f836fa7be55977e077c66a4c3aa2 Mon Sep 17 00:00:00 2001
From dcea6e665d5872d3b38519487b55891776cff2c9 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 23 Jun 2024 21:36:17 +0200
Subject: [PATCH 06/25] Replay "Implement C23 exp2m1, exp10m1" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ccff5826f975e8184bce8d1ed4c54e4e7a472339 Mon Sep 17 00:00:00 2001
From 828cf63bb2bfea502044c1473b45c9ce4e98bb9d Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Tue, 9 Jul 2024 22:42:12 +0200
Subject: [PATCH 07/25] Fix ia64 build after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 4494ee801d6d4dd533bf9d7c319373ad1ad670d7 Mon Sep 17 00:00:00 2001
From 13f6016b2b5ce28c147faf9bb0f22375c77d25a2 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Mon, 2 Sep 2024 22:50:09 +0200
Subject: [PATCH 08/25] Revert "elf: Make dl-fptr and dl-symaddr hppa specific"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b883248682c16bb25e8ad6b0590773ed79ab0bb6 Mon Sep 17 00:00:00 2001
From 6993883361f8de0ea2edc61af188904e815886a6 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 3 Oct 2024 19:34:09 +0200
Subject: [PATCH 09/25] ia64: Qualify 'u' and 'bits' with '__' prefix
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f305857627efe81702d7ca9b27436eaa79060862 Mon Sep 17 00:00:00 2001
From f45e071eddb7359a22b98cc50992a66d1e1a6530 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 5 Dec 2024 21:32:16 +0100
Subject: [PATCH 10/25] Replay "Implement C23 cospi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 3e9749fd58a26e8bf827b5c3f87afc1ee744344b Mon Sep 17 00:00:00 2001
From 50870a732ab8a9abc376b2356a138873c7cb7982 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 5 Dec 2024 21:34:16 +0100
Subject: [PATCH 11/25] Replay "Implement C23 sinpi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0295eb68573c3d02bd2904f938a418e63c94702d Mon Sep 17 00:00:00 2001
From 903433e7f99de4eb95db7db0f68d5f8ff0c1ad5e Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 5 Dec 2024 23:38:20 +0100
Subject: [PATCH 12/25] Fix build after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 69f8d777d93d6e2e156d1a77dc40a257e1a5f9bf Mon Sep 17 00:00:00 2001
From e53d55dbb3234c76ab2b47dad1916efbce12627b Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 11 Dec 2024 22:57:18 +0100
Subject: [PATCH 13/25] Replay "Implement C23 tanpi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 066f8aeb124ee82cbb19582b44370151015bf00c Mon Sep 17 00:00:00 2001
From 3a935d5f4438e5429accb29c4800d76a3e11a563 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 11 Dec 2024 22:59:10 +0100
Subject: [PATCH 14/25] Replay "Implement C23 acospi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0a4dc4ec79d4034b6a3568dd4cb102f8d5d4fd69 Mon Sep 17 00:00:00 2001
From 75b32aa7de59805e2a4d23f19613b2057b906091 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 11 Dec 2024 23:23:30 +0100
Subject: [PATCH 15/25] Fix build after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 50b58277f371f51b3b407b8e9de588bf02dec45f Mon Sep 17 00:00:00 2001
From d804618396becbc8478a2b898c4cad95235ea4f7 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 11 Dec 2024 23:00:42 +0100
Subject: [PATCH 16/25] Replay "Implement C23 asinpi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 60a2e147f37c0678bae80b6b85d8abb9275d1d25 Mon Sep 17 00:00:00 2001
From c687e2857468524abbcec1c61c63128c2ffcb49f Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Wed, 11 Dec 2024 23:24:26 +0100
Subject: [PATCH 17/25] Fix build after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ddc9a7de77d6d6522dadd7f0c16853ab253776bc Mon Sep 17 00:00:00 2001
From 99d1475eae0ddaef92365cbddc33f8f393f75bed Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 12 Dec 2024 00:52:00 +0100
Subject: [PATCH 18/25] Replay "Implement C23 atanpi" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 8324d7a307be57a7e28336a37bf8a6a1866f00c9 Mon Sep 17 00:00:00 2001
From c6c606ae814a642f5f9fa43033e11c67e8139b8d Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Thu, 12 Dec 2024 01:21:35 +0100
Subject: [PATCH 19/25] Fix build after
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 5de8e52810fbe9bca85f72d94de72b1fc4fb34e3 Mon Sep 17 00:00:00 2001
From 10f64bbfe9a836ffdd2098cd5e2a1a4a61f7f63c Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sat, 28 Dec 2024 00:21:46 +0100
Subject: [PATCH 20/25] Partially revert "elf: Remove the GET_ADDR_ARGS and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 714d1c521a01a01ed8db9bb71cf3535971ea626c Mon Sep 17 00:00:00 2001
From 00adb4c138687b13c362bad0267039051faa451f Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 12 Jan 2025 21:01:26 +0100
Subject: [PATCH 21/25] Replay "elf: Introduce generic <dl-tls.h>" in part also
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b66d3088f27a3a758ec855ec5be2dfad692b4aa4 Mon Sep 17 00:00:00 2001
From da4388c281a1cdde192e80a39b4bc4727a2c82b8 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 12 Jan 2025 21:02:55 +0100
Subject: [PATCH 22/25] Replay "elf: Always define TLS_TP_OFFSET" also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 15340d9af78832acb7a883b164394a4caa7f407e Mon Sep 17 00:00:00 2001
From f2fd6b2a17d7fc29cb40bb964fd8a9b09f8865cb Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 12 Jan 2025 21:04:24 +0100
Subject: [PATCH 23/25] Replay "Add missing include guards to <dl-tls.h>" also
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 3baef99ce6a5ed95618a3507cf392318a8a44754 Mon Sep 17 00:00:00 2001
From c65063e362b0a04723d6a9f86ae02070e00d8844 Mon Sep 17 00:00:00 2001
From: Johnny Mnemonic <[email protected]>
Date: Sun, 12 Jan 2025 21:30:13 +0100
Subject: [PATCH 24/25] Introduce __thread_pointer() also for ia64
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From f3ecc478ed8a110699c5d7ebf44e290e2abe94c8 Mon Sep 17 00:00:00 2001
From 2d65df1bfd8d41e00b1977214f8bb55bd542fdbf Mon Sep 17 00:00:00 2001
From: Tomas Glozar <[email protected]>
Date: Tue, 17 Oct 2023 20:27:53 +0200
Subject: [PATCH 25/25] Partial math FPU error fix for ia64
Expand Down

0 comments on commit cfcb1c6

Please sign in to comment.