The state of PPC exception handling #17
Replies: 5 comments 24 replies
-
@iains will comment directly, but I believe the broken dylib he replaces with a current version is I have never tried it, myself. |
Beta Was this translation helpful? Give feedback.
-
for example, this is the one from libgcc11 on 10.14, right in front of me here:
|
Beta Was this translation helpful? Give feedback.
-
SjLj will not work - Darwin from 10.4 onwards uses the "zero cost" [DWARF-based] unwind, essentially sjlj is an invalid configuration. Because unwinders have global state about a process (and need to be able to find the frames for any function), there can only be one unwinder in a process. So that it is essential that the unwinder used for system libraries/frameworks is the same one as used in the application code. I know of two bugs (which are fixed on new GCC versions). 1/ That the compiler used to generate code that the /usr/lib/libgcc_s unwinder did understand - PR48-097/PR44107 - that is fixed back to GCC-9 and I have back ports available for gcc-8 and 7. 2/ When DYLD_LIBRARY_PATH is used (on versions of Darwin that support it) and that path includes the installation of the compiler's libgcc_s, the unwinder from the compiler's libgcc_s can be picked up unintentionally.
|
Beta Was this translation helpful? Give feedback.
-
we might need an “exactly how…” for 10.4 through 10.6, when/if you get a moment for that… |
Beta Was this translation helpful? Give feedback.
-
Small update: The unwinder patch for GCC9 also applies cleanly to GCC7.5. Compiling now... |
Beta Was this translation helpful? Give feedback.
-
A couple of projects built using MacPorts GCC 7.5 on 10.4.11 / PPC have run-time issues with C++ exception handling. An exception is thrown and there is an infinite loop of some kind before a handler is chosen or invoked. The most comprehensive report I have can be found in this thread:
kcat/openal-soft#610
In the above-linked thread, @kencu noted that the toolchain might be the culprit. I have seen a very similar issue attempting to run mrustc on the same machine, and so the toolchain is very much a "program of interest" in my investigation.
If this issue is already well-known, I'd like to get some clarity or read more about it. Could this be a GCC 7.5 issue – or is it possibly an issue with how MacPorts configures and installs GCC? Does these hangs affect 10.4 only (where I am seeing them) or 10.5 also? Are there compiler options that I could try to circumvent the issue? I will note that I am unable to reproduce the issue with simple "Hello, world" type programs.
As a workaround, I tried to bootstrap a compiler with
--enable-sjlj-exceptions
so that I could at least run the code with a parallel SJLJ C++ run-time. These efforts failed; the bootstrap process seemed to have a hard time keeping straight which components were compiled with SJLJ and which were not, and my few attempts at compilation ended with undefined symbols related to unwinding.Any pointers, links, or explanations would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions