User forums => Using Code::Blocks => Topic started by: oBFusCATed on May 28, 2013, 07:02:30 pm
Title: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: oBFusCATed on May 28, 2013, 07:02:30 pm
Is this currently possible? From what I've tried I can conclude that it isn't, because CB tries to replace the $ORIGIN with the value of the env var ORIGIN. Can I disable this just for this case?
Title: Re: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: Alpha on May 28, 2013, 07:26:41 pm
Try -Wl,--rpath=$$ORIGIN/blabla/. I think that worked for me last time (but I am not sure if it currently works).
Title: Re: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: oBFusCATed on May 28, 2013, 07:28:43 pm
No, it doesn't work. At least in rev 8888.
Title: Re: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: Jenna on May 28, 2013, 07:48:37 pm
Did you read this: http://forums.codeblocks.org/index.php/topic,16466.msg112453.html#msg112453 (http://forums.codeblocks.org/index.php/topic,16466.msg112453.html#msg112453) and my answer ?
Code
-Wl,--rpath=\\$$$ORIGIN/blabla/
Could you try if this works ?
Title: Re: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: oBFusCATed on May 28, 2013, 07:54:34 pm
OK, so double '\' + tripple '$' is the only string that works :) Can we make it better? Anyone care to explain why all those characters are needed?
Title: Re: How to pass -Wl,--rpath=$ORIGIN/blabla/ to the linker
Post by: Jenna on May 29, 2013, 06:16:48 am
This gives a little description: http://stackoverflow.com/questions/230364/how-to-get-rpath-with-origin-to-work-on-codeblocks-gcc (http://stackoverflow.com/questions/230364/how-to-get-rpath-with-origin-to-work-on-codeblocks-gcc)
It has to do with macro-replacement and shell escaping.