3

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?

Bob
  • 10,741
  • 27
  • 89
  • 143
  • Could you provide some examples of steps you execute to build and analyze binaries? – unixsmurf Feb 11 '14 at 22:00
  • I'm using Netbeans. I link all libraries I need with absolute path, and that's pretty much what I do. – Bob Feb 12 '14 at 01:14
  • Yes, but you also say that the problem seems unrelated to Netbeans. And I had to google for Netbeans (call me a luddite). Nothing in the questions lets me reproduce, or even start theorising about, what you are seeing. – unixsmurf Feb 12 '14 at 09:23
  • try to create a simpler example and post it. I would guess rpath is coming from one of the libs you link or from the compiler. – auselen Feb 13 '14 at 08:05
  • 1
    Your question isn't entirely clear. The subject seems to indicate that it is your executable itself that gets an unwanted RPATH, while the question indicates that it is the library files themselves that are problematic. Which is it? Further, are these "many library files" things that you compile yourself, or do you get them from elsewhere? Are you talking about static libraries, or dynamic libraries (or perhaps even just ordinary object files)? – Dolda2000 Feb 17 '14 at 07:26
  • Maybe this helps you https://wiki.debian.org/RpathIssue – vzamanillo Feb 17 '14 at 15:51

2 Answers2

1

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

Pruthvi Raj
  • 3,016
  • 2
  • 22
  • 36
0

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

Gaurav Joseph
  • 927
  • 14
  • 25