From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Richard Sandiford <Richard.Sandiford@arm.com>
Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] AArch64: Prioritise init_have_lse_atomics constructor [PR 105708]
Date: Wed, 25 May 2022 10:42:02 +0000 [thread overview]
Message-ID: <DB6PR0801MB1879C61C2D2A143AA3A4C93883D69@DB6PR0801MB1879.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <mptee0iqds6.fsf@arm.com>
Hi Richard,
I've added a comment - as usual it's just a number. A quick grep in gcc and
glibc showed that priorities 98-101 are used, so I just went a bit below so it
has a higher priority than typical initializations.
Cheers,
Wilco
Here is v2:
Increase the priority of the init_have_lse_atomics constructor so it runs
before other constructors. This improves chances that rr works when LSE
atomics are supported.
Regress and bootstrap pass, OK for commit?
2022-05-24 Wilco Dijkstra <wdijkstr@arm.com>
libgcc/
PR libgcc/105708
* config/aarch64/lse-init.c: Increase constructor priority.
---
diff --git a/libgcc/config/aarch64/lse-init.c b/libgcc/config/aarch64/lse-init.c
index fc875b7fe80e947623e570eac130e7a14b516551..33b97c8d766895cf0101a851e1dc4ed6a1a053d9 100644
--- a/libgcc/config/aarch64/lse-init.c
+++ b/libgcc/config/aarch64/lse-init.c
@@ -38,7 +38,9 @@ _Bool __aarch64_have_lse_atomics
unsigned long int __getauxval (unsigned long int);
-static void __attribute__((constructor))
+/* Use a higher priority to ensure it runs before user constructors
+ and library constructors with priority 100. */
+static void __attribute__((constructor (90)))
init_have_lse_atomics (void)
{
unsigned long hwcap = __getauxval (AT_HWCAP);
next prev parent reply other threads:[~2022-05-25 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 16:45 Wilco Dijkstra
2022-05-25 7:20 ` Richard Sandiford
2022-05-25 10:42 ` Wilco Dijkstra [this message]
2022-05-25 11:57 ` Richard Sandiford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB6PR0801MB1879C61C2D2A143AA3A4C93883D69@DB6PR0801MB1879.eurprd08.prod.outlook.com \
--to=wilco.dijkstra@arm.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Richard.Sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).