File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 115115 filename=$( basename " $i " )
116116 if [[ -z " ${filename## ld-* } " ]]; then
117117 PKG_LD=$filename # Use this file as the loader
118- cp " $i " $PKG_DIR /lib
118+ cp " $i " " $PKG_DIR /lib"
119119 fi
120120 continue
121121 fi
@@ -128,12 +128,23 @@ if [[ $INCLUDE_LIBC == true ]]; then
128128 do
129129 filename=$( basename " $i " )
130130 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
131137 continue # We don't want the dynamic loader's symlink because its target is an absolute path (/lib/ld-*).
132138 fi
133139 cp --no-dereference " $i " " $PKG_DIR /lib"
134140 done
135141fi
136142
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+
137148bootstrap_script=$( cat << EOF
138149#!/bin/bash
139150set -euo pipefail
You can’t perform that action at this time.
0 commit comments