This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR target/80556


This PR was raised because of a bootstrap failure on Darwin. The cause
was a mishandled exception raised by Rtsfind.Load_Fail while
processing g-exptty.adb. g-exptty.adb had been updated on 2017-04-25
(but so had a lot of other parts of GNAT). Since a lot of other
compilations had been performed successfully by this point in the
build, one may assume that this was the first that actually caused an
exception.

The exception was mishandled because the default ldflags call up
-static-libgcc, and (on Darwin; not, it seems, on Debian [jessie]),
the notes on -static-libgcc/-shared-libgcc at
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html which say

   However, if a library or main executable is supposed to throw or
   catch exceptions, you must link it using the G++ driver, as
   appropriate for the languages used in the program, or using the
   option -shared-libgcc, such that it is linked with the shared
   libgcc.

do actually apply (this affects all the Ada executables, in this case
specifically gnat1).

The result of the mishandling of the exception is that gnat1 crashes
with SIGILL.

The change proposed here is to include -lSystem in such a way that
it's called in before the (static) libgcc, and thus supplies the
required exception unwinders.

Bootstrapped on Darwin 16.6.0 and on Debian Jessie.

A question: I've checked for x86_64-apple-darwin*, is this OK or
should it be more restrictive?

Changelog:

        2017-06-09 Simon Wright <simon@pushface.org>

        PR target/80556
        * configure.ac (stage1_ldflags): For Darwin, include -lSystem.
          (poststage1_ldflags): likewise.
        * configure: regenerated.

Attachment: 80556-3.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]