File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 115
115
filename=$( basename " $i " )
116
116
if [[ -z " ${filename## ld-* } " ]]; then
117
117
PKG_LD=$filename # Use this file as the loader
118
- cp " $i " $PKG_DIR /lib
118
+ cp " $i " " $PKG_DIR /lib"
119
119
fi
120
120
continue
121
121
fi
@@ -128,12 +128,23 @@ if [[ $INCLUDE_LIBC == true ]]; then
128
128
do
129
129
filename=$( basename " $i " )
130
130
if [[ -z " ${filename## ld-* } " ]]; then
131
+ # if the loader is empty, then the binary is probably linked to a symlink of the loader. The symlink will
132
+ # not show up when quering the package manager for libc files. So, in this case, we want to copy the loader
133
+ if [[ -z " $PKG_LD " ]]; then
134
+ PKG_LD=$filename
135
+ cp " $i " " $PKG_DIR /lib" # we want to follow the symlink (default behavior)
136
+ fi
131
137
continue # We don't want the dynamic loader's symlink because its target is an absolute path (/lib/ld-*).
132
138
fi
133
139
cp --no-dereference " $i " " $PKG_DIR /lib"
134
140
done
135
141
fi
136
142
143
+ if [[ -z " $PKG_LD " ]]; then
144
+ echo " Failed to identify, locate or package the loader. Please file an issue on Github!" 1>&2
145
+ exit 1
146
+ fi
147
+
137
148
bootstrap_script=$( cat << EOF
138
149
#!/bin/bash
139
150
set -euo pipefail
You can’t perform that action at this time.
0 commit comments