How to add library to RPATH?

why is the library path removed from RUNPATH?

Probably because it’s soname isn’t listed in DT_NEEDED (cf. patchelf --print-needed .../bin/cb)

how can one prevent this from happening?

patchelf $out/bin/cb/ --add-needed libcbx11.so

How to add library to RPATH?

If that really were the goal, patchelf $out/bin/cb --append-rpath $out/lib. But you normally want --add-needed instead

1 Like