mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-04 19:56:36 +08:00
Merge branch 'strip-ar' into 'master'
cookbook: Also strip ar files See merge request redox-os/redox!2427
This commit is contained in:
commit
5313cbba62
@ -313,7 +313,7 @@ mod tests {
|
||||
compressed: false,
|
||||
git_treeless: false,
|
||||
verbose: true,
|
||||
verbose_cmd: true,
|
||||
verbose_cmd: false,
|
||||
clean_build: false,
|
||||
clean_target: false,
|
||||
write_filetree: false
|
||||
|
||||
@ -460,12 +460,17 @@ strip_directory() {
|
||||
local strip_flags="${STRIP_ARGS:-}"
|
||||
|
||||
find "$target_dir" -type f -print0 | while IFS= read -r -d '' file; do
|
||||
if [ "$(od -An -t x1 -N 4 "$file" | tr -d ' \n')" = "7f454c46" ]; then
|
||||
# check magic bytes for elf and ar before stripping
|
||||
local magic_bytes="$(od -An -t x1 -N 4 "$file" | tr -d ' \n')"
|
||||
if [[ "$magic_bytes" = "7f454c46" || "$magic_bytes" = "213c6172" ]]; then
|
||||
"${STRIP}" ${STRIP_ARGS} "$file"
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
if [ -z "${COOKBOOK_NOSTRIP}" ]; then
|
||||
[ -z "${COOKBOOK_VERBOSE}" ] || echo "DEBUG: stripping binaries and libraries"
|
||||
fi
|
||||
|
||||
# Strip binaries
|
||||
for dir in "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/usr/bin" "${COOKBOOK_STAGE}/libexec" "${COOKBOOK_STAGE}/usr/libexec"
|
||||
do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user