FS#79683 - [libunwind] add cxx_exceptions support
Attached to Project:
Arch Linux
Opened by REmorin (REmorin) - Wednesday, 13 September 2023, 22:28 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:26 GMT
Opened by REmorin (REmorin) - Wednesday, 13 September 2023, 22:28 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:26 GMT
|
Details
Description:
libunwind so-files (specifically, `liunwind.so.8.0.1`) lack the symbols (called `cxx_exceptions` upstream) needed for some usecases. In my case I can't compile a program with a sanitizer using `clang -rtlib=compiler-rt -unwindlib=libunwind` because it needs `_Unwind_Backtrace` and `_Unwind_GetIP` which the so-file doesn't have. (https://github.com/llvm/llvm-project/issues/65796#issuecomment-1716486460) This situation is especially worse on Arch, because a few distros have llvm-libunwind which can provide it. (The AUR package is bad and not up to date.) But, there is an easy soulution, which, btw, Debian and Alpine use: Pass `--enable-cxx-exceptions` to `./configure` during buildtime. Works for every version: `1.6.2`, `1.7.2`, `1.5.0`. See https://github.com/libunwind/libunwind/issues/615#issuecomment-1718085148 for details. Additional info: * package version(s): 1.6.2-2 * config and/or log files etc.: see "steps to reproduce" and links. * link to upstream bug report, if any: https://github.com/libunwind/libunwind/issues/615 (not really a bug/issue report, just a question at this point about the distros situation and the default behavior; plus I dunno how long it'll take them to reply, they don't seem to reply very fast/often) Steps to reproduce: * `strings /usr/lib/libunwind.so.8.0.1 | grep '_Unwind'` * grep: exit 1 |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:26 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/libunwind/issues/1
Saturday, 25 November 2023, 20:26 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/libunwind/issues/1
Upstream possibly doesn't enable it by default due to this comment in `configure.ac'
"# C++ exception handling doesn't work too well on x86"
https://github.com/libunwind/libunwind/issues/615#issuecomment-1721622057
> Upstream possibly doesn't enable it by default due to this comment in `configure.ac'
Didn't find it in the file you mentioned (in the libunwind repo). Did you mean `configure.ac` in Void Linux source repo?
Actually, nevermind (about the configure.ac and "not working well on x86"), as I understood, they didn't enable cxx_exceptions by default just not to provide the alternatives for these symbols in libgcc, because some distros might not want them and some developers might not need them.
But they didn't say there's something bad about enabling them, they just said it's up to the distros themselves.
And considering Debian and Alpine decided to enable them, I don't see any reason not to enable them in Arch.
Also, Arch really needs cxx_exceptions, because it doesn't have `llvm-libunwind` package in the repos to provide them. (Again, the AUR package is outdated and not a very good option.)
Finally, since Arch is considered to be a distro for advanced users and developers, I don't see how developer's points really apply to Arch; I agree that distros for normies might not want to enable them, but it's normal for Arch to have a large number of C/C++ developers, a part of whom prefers to not use gcc entirely (including the toolchain; using `clang -rtlib=compiler-rt -unwindlib=libunwind`), and they need cxx_exceptions in libunwind for that, or otherwise they are gonna get a linking error.
Edit:
llvm-libunwind is in AUR [4].
[1] https://github.com/libunwind/libunwind/commit/478046442c40af587131966528f4579cafeb20af
[2] https://github.com/libunwind/libunwind/blob/v1.7.2/configure.ac#L247
[3] https://github.com/libunwind/libunwind/commit/1227c41d20be7e31ce8b5284b27d1d75009cd3eb
[4] https://aur.archlinux.org/packages/llvm-libunwind