This is the mail archive of the
mailing list for the glibc project.
Re: [COMMITTED PATCH] Use pragmas rather than makefiles for necessary options for unwind code.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 16 Dec 2014 23:37:59 +0000
- Subject: Re: [COMMITTED PATCH] Use pragmas rather than makefiles for necessary options for unwind code.
- Authentication-results: sourceware.org; auth=none
- References: <20141216223558 dot 6CADB2C2446 at topped-with-meat dot com>
On Tue, 16 Dec 2014, Roland McGrath wrote:
> Verified on x86_64-linux-gnu that no generated code (including unwind info)
> changes. Also tested arm-linux-gnueabihf that no generated code changes;
> there was one difference in the EABI unwind info for __unwind_freeres,
> which I don't understand but also deem wholly unimportant.
I don't think this is safe. The optimize pragma is documented as being
for optimization options only; using it with other options such as
-fexceptions is not a documented or supported GCC feature (actually, even
using it for some optimization options can be very fragile; it's best to
use it only for purely non-semantic options rather than those such as
-ffast-math that affect semantics). -fexceptions affects global state in
GCC, including global choices made when the parser is initialized [*];
enabling it at any later point risks subtle problems from inconsistencies
in GCC's internal datastructures; that it works with a particular version
of GCC at a particular time means very little. Enabling it after headers
(probably including inline functions) have been parsed seems even riskier
than enabling it at the start of a source file before any headers have
been parsed (but I still don't think that would be safe).
[*] using_eh_for_cleanups - on that basis, it seems quite plausible that
cleanup attributes (as used in various ways in glibc) will not reliably
interact properly with exceptions if exceptions weren't enabled from the
Joseph S. Myers