Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to remove rpath from executable

I am cross-compiling for an ARM platform. Amongst the many library files I'm linking, only a very few of them have an rpath.

I don't know where it is coming from, because I copied all libraries I needed into a single folder, and add them to the project with Netbeans (under Ubuntu with Linaro compiler). Even if I compile from command line the output is the same.

I tried patchelf, but it does not remove the rpath. The program per se works (for instance, if I create the path it is looking for when searching for libs).

Any idea how to fix it?

like image 645
Bob Avatar asked Sep 26 '26 19:09

Bob


2 Answers

If you use cmake,

There is a builtin CMake option CMAKE_SKIP_RPATH, if it is enabled all other RPATH related options are ignored, no RPATH is built into anything.

http://www.cmake.org/Wiki/CMake_RPATH_handling

like image 54
Gaurav Joseph Avatar answered Sep 28 '26 09:09

Gaurav Joseph


Have you tried using chrpath? , it might be available in your distribution packages

like image 39
Pruthvi Raj Avatar answered Sep 28 '26 11:09

Pruthvi Raj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!