rpath argument change in GCC / LD

Ken Cunningham ken.cunningham.webuse at gmail.com
Mon Feb 4 15:36:24 UTC 2019


For scipy etc, I imagine it would be more likely what the python build script does with it than what the linker driver does with it that might cause trouble.

Some of these build systems, esp these “simple" python script build systems, do funky business.

But if you pass those commands directly to clang, they should both be the same in the end on the linker invocation line.

That’s the other thing — these build systems are supposed to pass these commands to clang or to gcc, but sometimes they think they’re supposed to invoke “ld” directly, and that causes another level of pain.

Ken


PS: I did read later somewhere that -Wl,-rpath=/path/to/dir  is also a workable option for some gcc/ld versions, but it is apparently not universally accepted.



> On Feb 4, 2019, at 7:23 AM, Michael Dickens <michaelld at macports.org> wrote:
> 
> So from your list below as I've labeled them, only (3) works in my testing with GCC8 as the pass-through compiler between the SciPy script creating this code & the linker. I have not tested any other GCC version, but I'm guessing it's the linker that's called that determines whether the -rpath flag usage is valid. As I said: This is a fairly recent change in the linker, which I'm guessing has something to do with which linker is being used: MP's or Xcode's. All of my testing over the weekend was on 10.14, which passes the link command through to Xcode's linker. I will try testing on my older OSX boxes to see what happens there, since I'm guessing they use MP's linker (as Xcode's is so old). If (3) works on all of the linkers, then I'll go with it (patching to include the ""s). - MLD
> 
> On Mon, Feb 4, 2019, at 12:22 AM, Ken Cunningham wrote:
>> My understanding is that this should not work:
>> 
> (1) > -Wl,-rpath=“DIR”
>> 
>> But these two are functionally the same, assuming they are not reordered.
>> 
> (2) > -Wl,-rpath -Wl,”DIR”
>> 
>> or 
>> 
> (3) > -Wl,-rpath,”DIR”
>> 
>> Both are sent to the linker as two options sequentially:
>> 
>> -rpath “DIR”
>> 
>> Ken



More information about the macports-dev mailing list