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 badges1 Answer
Reset to default 0Turns 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.