-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clang++ -fexceptions doesn't enable unwind information generation as documented for all targets #61216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-clang-driver |
The point of -fexceptions is, as the documentation suggests, to allow C++ "throw" exceptions to be thrown through clang-compiled functions. This has a few different effects... but it only ensures an unwind table for functions that might have an exception thrown through them. This is the opposite of -fno-exceptions, which disables exception throwing functionality. If clang can prove a function doesn't have an exception thrown through it, -fexceptions is irrelevant. -funwind-tables means "generate unwind tables even if clang can prove no exception will unwind through this function". This is only useful if you want to generate a stack trace, so it's separate from -fexceptions. I think this is working as expected; maybe the documentation could be made more clear. |
I've submitted https://reviews.llvm.org/D145564 as one suggestion for clarifying the documentation. Thanks for taking a look. |
As noted in <#61216>, the documentation for -fexceptions appears to imply that unwind information is always generated, which isn't the case. Differential Revision: https://reviews.llvm.org/D145564
As noted in <llvm/llvm-project#61216>, the documentation for -fexceptions appears to imply that unwind information is always generated, which isn't the case. Differential Revision: https://reviews.llvm.org/D145564
As noted in <llvm/llvm-project#61216>, the documentation for -fexceptions appears to imply that unwind information is always generated, which isn't the case. Differential Revision: https://reviews.llvm.org/D145564
is it okay to close this issue? |
Marking closed. |
At the time of writing,
clang/docs/CommandGuide/clang.rst
statesHowever, this doesn't seem to actually turn on unwind information for a number of targets (note that the precise triple matters - e.g. a recent patch enabled asynchronous unwind tables by default on RISC-V Linux targets, which hides this issue somewhat):
And here's what you get when explicitly enabling unwind tables:
Given the quoted documentation, I think I'd expect this same output for
-fexceptions
. Thanks to @mtvec for raising this issue.The text was updated successfully, but these errors were encountered: