<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 10 oct. 2019 à 10:36, DIXON, MARK C. <<a href="mailto:mark.c.dixon@durham.ac.uk">mark.c.dixon@durham.ac.uk</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 9 Oct 2019, Aaron Cohen wrote:<br>
<br>
> Is it not feasible to just let the build system do whatever it is going to<br>
> and use "chrpath" or "patchelf" to change the rpath after-the-fact?<br>
<br>
Thanks for the suggestion, but I need to add directories to the rpath: I <br>
believe that neither utility allows it to increase in size.<br></blockquote><div><br></div><div><br></div><div>No they can't because the maximum size is burried into the binary ELF file, </div><div>that why CMake "reserve" some space with many ";;;" in order to replace BUILD_RPATH with INSTALL_RPATH when doing</div><div>'install'.</div><div><br></div><div>Note however that you should be able to "delete" RPATH: chrpath -d</div><div>and then rely on LD_LIBRARY_PATH, ld.so.config, etc....</div><div><br></div><div>The thing I don't quite understand why you need to replace/amend RPATH. In my (very personal) use case when I have to integrate third-party software:</div><div><br></div><div>1a) I compile them from source and install them using the install prefix *I need*. For cmake enabled build</div><div> the RPATH will be updated with the one I need *during install*<br><br>2a) I use relocatable binary package (of any kind rpm, deb, or even tar.gz) for which I know that RPATH are </div><div> relative which can adapt to the location where I put them.</div><div> If I cannot find a relocatable binary package then I go back to 1a).</div><div><br></div><div>As noted by Hendrik not every software developer are aware of the need for relocation so they may bury non-relocatable rpath in their buildsystem.</div><div><br></div><div>Note that there is usually 2 options for CMake buildsystem and install RPATH.</div><div>You can either:<br> 1. set some install RPATH (preferably in a relocatable way using $ORIGIN)</div><div> 2. don't specify install RPATH at all and let the final user/integrator setup LD_LIBRARY_PATH or ld.so.config etc...</div><div> </div><div>This is quite well summarized here:</div><div><a href="https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling">https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling</a><br></div><div><br></div><div>If the developers of the software you are using have chosen in their CMake build-system to define an install RPATH your only safe bet</div><div>is probably to build & install the software at your favorite location or propose an upstream patch for supporting unspecified RPATH.</div><div><br></div><div>But may be I miss something in your use case?</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>