I want to specify an rpath, like this:

'ldflags': [
  '-rpath', '/usr/$LIB/myprog',
],

But when I check the resulting binary, I see it has another rpath:

$ objdump -x binary | grep RPATH
  RPATH                /usr//myprog:$ORIGIN/lib/

What I want is: /usr/$LIB/myprog:...

有帮助吗?

解决方案

The one should do the following:

'ldflags': [
  '-rpath', '/usr/\$$LIB/myprog',
],
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top