public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/clang] Handle abort call for -fexceptions call
Date: Fri, 29 Apr 2022 14:09:40 +0000 (GMT)	[thread overview]
Message-ID: <20220429140940.73B84385803E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=733282b0b44caf47cc05badd12f80e8fc64cdba8

commit 733282b0b44caf47cc05badd12f80e8fc64cdba8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Apr 1 14:17:07 2022 -0300

    Handle abort call for -fexceptions call
    
    clang might generate an abort call when cleanup functions (set by
    __attribute__ ((cleanup)) calls functions not marked as nothrow.
    We can mitigate by marking some internal functions as __THROW,
    but it is not possible for functions that issue used-provided
    callbacks (for instance pthread_once).

Diff:
---
 sysdeps/generic/symbol-hacks.h | 7 +++++++
 sysdeps/nptl/lowlevellock.h    | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 1115e4c0a7..560116d575 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -6,6 +6,13 @@ asm ("memmove = __GI_memmove");
 asm ("memset = __GI_memset");
 asm ("memcpy = __GI_memcpy");
 
+/* clang might generate an abort call when cleanup functions (set by
+   __attribute__ ((cleanup)) calls functions not marked as nothrow.
+   We can mitigate by marking some internal functions as __THROW,
+   but it is not possible for functions that issue used-provided
+   callbacks (for instance pthread_once).  */
+asm ("abort = __GI_abort");
+
 /* Some targets do not use __stack_chk_fail_local.  In libc.so,
    redirect __stack_chk_fail to a hidden reference
    __stack_chk_fail_local, to avoid the PLT reference.
diff --git a/sysdeps/nptl/lowlevellock.h b/sysdeps/nptl/lowlevellock.h
index b429d9aa78..0ef4367f33 100644
--- a/sysdeps/nptl/lowlevellock.h
+++ b/sysdeps/nptl/lowlevellock.h
@@ -125,9 +125,9 @@ libc_hidden_proto (__lll_lock_wait)
 #define lll_cond_lock(futex, private) __lll_cond_lock (&(futex), private)
 
 
-extern void __lll_lock_wake_private (int *futex);
+extern void __lll_lock_wake_private (int *futex) __THROW;
 libc_hidden_proto (__lll_lock_wake_private)
-extern void __lll_lock_wake (int *futex, int private);
+extern void __lll_lock_wake (int *futex, int private) __THROW;
 libc_hidden_proto (__lll_lock_wake)
 
 /* This is an expression rather than a statement even though its value is


             reply	other threads:[~2022-04-29 14:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 14:09 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:12 Adhemerval Zanella
2024-04-02 15:58 Adhemerval Zanella
2024-02-09 17:36 Adhemerval Zanella
2024-02-07 14:12 Adhemerval Zanella
2024-01-29 18:02 Adhemerval Zanella
2023-12-21 18:58 Adhemerval Zanella
2023-09-28 17:57 Adhemerval Zanella
2023-08-30 12:41 Adhemerval Zanella
2023-02-09 19:53 Adhemerval Zanella
2022-10-28 17:46 Adhemerval Zanella
2022-10-04 13:04 Adhemerval Zanella
2022-06-09 21:25 Adhemerval Zanella
2022-06-09 13:22 Adhemerval Zanella
2022-06-03 14:11 Adhemerval Zanella
2022-05-13 14:25 Adhemerval Zanella
2022-05-12 19:39 Adhemerval Zanella
2022-05-10 18:29 Adhemerval Zanella
2022-04-04 13:00 Adhemerval Zanella

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=20220429140940.73B84385803E@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.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).