[CMake] RPATH cross-compile issue with CHECK_*_EXISTS

Ray Donnelly mingw.android at gmail.com
Mon Feb 27 20:11:37 EST 2017


On Mon, Feb 27, 2017 at 9:39 PM, Brad King <brad.king at kitware.com> wrote:
> On 02/27/2017 03:54 PM, Ray Donnelly wrote:
>> This is why my PR asks the linker that the compiler will use for the
>> actual list of implicit link dirs. I'm sorry I've not had time to
>> write up a clear explanation yet.
>
> IIUC your case is the opposite of that under discussion in the rest
> of this thread.  You want to include a rpath that is not currently
> included.  Jörg wants to exclude a rpath that is currently being
> incorrectly included.  The detection you're proposing would not
> discover the lib32 entry that is causing Jörg's problem.
>

Not really, my PR is about ensuring that CMake's idea of implicit dirs
isn't mismatched with the linker's actual implicit dirs by actually
asking the linker. AFAICT, it fixes Jörg's problem too. I say that
because as stated:

> CMake passes the host rpath to the linker

CMake does this because it isn't *asking* the linker, it's making
assumptions instead (and adding some predefined values like
`/usr/lib32`). If we just ask the linker instead then everything
should work just fine (I am ignore linkers that cannot tell us here
like Apple's ld64. I'm not sure how to tackle that one yet).

> As I requested in your MR [1] it will be more appropriate to discuss
> your rpath-inclusion use case in a separate issue.
>
> Thanks,
> -Brad
>
> [1] https://gitlab.kitware.com/cmake/cmake/merge_requests/207#note_189880
>


More information about the CMake mailing list