aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-03-18 11:57:18 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-03-18 11:57:18 -0400
commit37bf2381d6c3bac22efd204a3e36d52d78e6b52b (patch)
tree1325e1aa71e57d51792f72b1792bb6676e568f57 /src
parent154db0514d8bcdc42fa9ab213c1f1d0c2c1c2985 (diff)
downloadspmc-37bf2381d6c3bac22efd204a3e36d52d78e6b52b.tar.gz
Assign default RPATHs when auto-generated string is empty
* Increased verbosity shows shell execution
Diffstat (limited to 'src')
-rw-r--r--src/rpath.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rpath.c b/src/rpath.c
index 11e9249..74ee28b 100644
--- a/src/rpath.c
+++ b/src/rpath.c
@@ -20,6 +20,10 @@ Process *patchelf(const char *_filename, const char *_args) {
strchrdel(filename, SHELL_INVALID);
sprintf(sh_cmd, "patchelf %s %s 2>&1", args, filename);
+ if (SPM_GLOBAL.verbose > 1) {
+ printf(" EXEC : %s\n", sh_cmd);
+ }
+
shell(&proc_info, SHELL_OUTPUT, sh_cmd);
free(filename);
@@ -211,6 +215,10 @@ char *rpath_autodetect(const char *filename, FSTree *tree) {
char *relative = _relative; // Pointer to relative path
size_t depth_to_root = 0;
+ // BUG: Perl dumps its shared library in a strange place.
+ // This function returns `$ORIGIN/../../../CORE` which is not what we want to see.
+ // TODO: We WANT to see this: `$ORIGIN/../lib/perl5/xx.xx.xx/<arch>/CORE` not just the basename()
+
// Change directory to the requested root
chdir(start);
@@ -276,6 +284,13 @@ char *rpath_autodetect(const char *filename, FSTree *tree) {
}
}
+ // Some programs do not require local libraries provided by SPM (i.e. libc)
+ // Inject "likely" defaults here
+ if (strlist_count(libs) == 0) {
+ strlist_append(libs, "$ORIGIN/../lib");
+ strlist_append(libs, "$ORIGIN/../lib64");
+ }
+
// Populate result string
result = join(libs->data, ":");