最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Use custom `libunwind` installation for C++ exceptions - Stack Overflow

programmeradmin5浏览0评论

Problem:
I need to connect a custom libunwind (a modified version of libunwind built from sources) installation to the default stack unwinding mechanism used in C++ exceptions.

Current state:
I already managed to switch stack unwinding library from libgcc to libunwind with the appropriate CLang options, though it still links with the system installation of libunwind. I tried manually linking the program with libunwind, though it does not override the path used by clang (I see two instances of the library in ldd - my own and the system one, which is used whenever an exception is thrown).

Is there a way to somehow force clang to use a custom installation of libunwind?

Potential, yet undesirable solutions:
I figured I can always rebuild clang from sources, hardcoding path to the library into the compiler, though I would like to avoid that as much as possible.

I also don't want to override the system library installation with my own, as I am planning to modify it in a rather janky way.

Problem:
I need to connect a custom libunwind (a modified version of libunwind built from sources) installation to the default stack unwinding mechanism used in C++ exceptions.

Current state:
I already managed to switch stack unwinding library from libgcc to libunwind with the appropriate CLang options, though it still links with the system installation of libunwind. I tried manually linking the program with libunwind, though it does not override the path used by clang (I see two instances of the library in ldd - my own and the system one, which is used whenever an exception is thrown).

Is there a way to somehow force clang to use a custom installation of libunwind?

Potential, yet undesirable solutions:
I figured I can always rebuild clang from sources, hardcoding path to the library into the compiler, though I would like to avoid that as much as possible.

I also don't want to override the system library installation with my own, as I am planning to modify it in a rather janky way.

Share Improve this question edited Mar 10 at 20:14 genpfault 52.2k12 gold badges91 silver badges151 bronze badges asked Mar 10 at 19:56 SigmarionidSigmarionid 215 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Turns out the libraries are different depending on whether you are building libunwind from the LLVM project repository or from the other distribution.

CLang searches for the version that links with libunwind.so.1 (the one that comes with the LLVM project), while the ladder produces libunwind.so.8, which I am not sure is even compatible with clang.

发布评论

评论列表(0)

  1. 暂无评论