public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Matheus Castanho <msc@linux.ibm.com>
To: tuliom@linux.ibm.com, fweimer@redhat.com,
	Libc-stable Mailing List <libc-stable@sourceware.org>
Subject: Re: [2.32] struct _Unwind_Exception alignment should not depend on compiler flags
Date: Mon, 16 Nov 2020 17:49:36 -0300	[thread overview]
Message-ID: <77a05ee0-9d5e-98fe-7586-21361e1a1aa8@linux.ibm.com> (raw)
In-Reply-To: <20201116204659.40340-1-msc@linux.ibm.com>

Sorry, sent to the wrong list.

- libc-alpha
+ libc-stable

On 11/16/20 5:46 PM, Matheus Castanho via Libc-alpha wrote:
> From: Florian Weimer <fweimer@redhat.com>
> 
> Hi Florian and Tulio,
> 
> Could we backport this patch to the 2.32 branch? It would be helpful to fix the
> issue downstream.
> 
> Thanks,
> Matheus Castanho
> 
> ---8<---
> 
> __attribute__((__aligned__)) selects an alignment that depends on
> the micro-architecture selected by GCC flags.  Enabling vector
> extensions may increase the allignment.  This is a problem when
> building glibc as a collection of ELF multilibs with different
> GCC flags because ld.so and libc.so/libpthread.so/&c may end up
> with a different layout of struct pthread because of the
> changing offset of its struct _Unwind_Exception field.
> 
> Tested-By: Matheus Castanho <msc@linux.ibm.com>
> 
> (cherry picked from commit 30af7c7fa13e17d82c3f1f91536384715844f432)
> ---
>  sysdeps/generic/unwind.h | 24 +++++++++++++++---------
>  1 file changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/sysdeps/generic/unwind.h b/sysdeps/generic/unwind.h
> index b667a5b652..c229603af3 100644
> --- a/sysdeps/generic/unwind.h
> +++ b/sysdeps/generic/unwind.h
> @@ -75,15 +75,21 @@ typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
> 
>  struct _Unwind_Exception
>  {
> -  _Unwind_Exception_Class exception_class;
> -  _Unwind_Exception_Cleanup_Fn exception_cleanup;
> -  _Unwind_Word private_1;
> -  _Unwind_Word private_2;
> -
> -  /* @@@ The IA-64 ABI says that this structure must be double-word aligned.
> -     Taking that literally does not make much sense generically.  Instead we
> -     provide the maximum alignment required by any type for the machine.  */
> -} __attribute__((__aligned__));
> +  union
> +  {
> +    struct
> +    {
> +      _Unwind_Exception_Class exception_class;
> +      _Unwind_Exception_Cleanup_Fn exception_cleanup;
> +      _Unwind_Word private_1;
> +      _Unwind_Word private_2;
> +    };
> +
> +    /* The IA-64 ABI says that this structure must be double-word aligned.  */
> +    _Unwind_Word unwind_exception_align[2]
> +      __attribute__ ((__aligned__ (2 * sizeof (_Unwind_Word))));
> +  };
> +};
> 
> 
>  /* The ACTIONS argument to the personality routine is a bitwise OR of one
> --
> 2.26.2
> 

           reply	other threads:[~2020-11-16 20:49 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20201116204659.40340-1-msc@linux.ibm.com>]

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=77a05ee0-9d5e-98fe-7586-21361e1a1aa8@linux.ibm.com \
    --to=msc@linux.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-stable@sourceware.org \
    --cc=tuliom@linux.ibm.com \
    /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).