On 1/22/19 2:25 PM, Chet Ramey wrot
The bash link step doesn't do anything with rpath.
The readline Makefiles set rpath to the installed location of the library
at build time (using $libdir), so if you install it somewhere else that's
going to be wrong. It should probably use $(DESTDIR)$(libdir) if that's
what you use to install your copy of readline.
Indeed, I don't modify the installation directory of readline and rpath
works fine there.
Is there any special reason that rpath isn't managed for Bash (similar
to how its managed for readline)?
Let me give some background on the cause of my problem and why I need to
have rpath in Bash.
I am an astrophysicist and maintainer of GNU Astronomy Utilities. In the
sciences, we have a big problem of reproducibility: were research teams
arrive at a result and publish it, but many don't know the versions of
the programs they were using to get that result or how they were
configured. As a result, many published research results are not
reproducible.
I am trying to tackle this problem in a "reproducible paper" project
[1]. It builds all the necessary programs for a project (starting from
Make and Bash and going all the way up to the higher-level science
software used in a project and also an installation of TeX to enable
creation of the paper in a closed environment also). It then runs those
programs in the pre-defined order to get the exact same result, and
finally builds the paper's PDF, using its internal build of LaTeX.
Ofcourse, since many users use Mac, it has to also work on a Mac OS, so
I don't currently build the C compiler or linker and rely on the host's
low-level system libraries, compiler and linker. But above that, I try
to keep everything.
With the update of Bash and Readline 5.0 on my host operating system, I
suddenly noticed that my build of Bash was crashing and after
investigation I saw that it was actually linking to the readline
installation on the host at run time, not to the readline within the
project.
I am currently using patchelf to add RPATH manually to the Bash
executable. So I am really curious why RPATH isn't managed in Bash
similar to how its managed in readline?
Thanks a lot for all the great work on Bash and help and support,
Cheers,
Mohammad
[1]:
https://gitlab.com/makhlaghi/reproducible-paper/blob/pipeline/README-pipeline.md