The host might not have the correct tools to strip a foreign
architecture, therefore we need to use the cross tools.
The crosstools might be built in an architecture that they
cannot strip themselves and since they are not being part of the
packaged toolchain, we will just skip them.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
$(TARGET) :
ifeq "$(TOOLCHAIN)" "1"
# Strip everything in the toolchain
- $(DIR_SRC)/src/stripper $(TOOLS_DIR)
+ $(DIR_SRC)/src/stripper $(TOOLS_DIR) \
+ --strip="$(TOOLS_DIR)/$(CROSSTARGET)/bin/strip" \
+ --ignore-errors \
+ --exclude=$(TOOLS_DIR)/$(CROSSTARGET)
else
# Don't strip VDR binaries, because they use a weird plugin system
# which does not work when unneeded symbols get stripped from
paths=()
excludes=()
+strip="strip"
+break_on_error="1"
while [ $# -gt 0 ]; do
case "${1}" in
+ --strip=*)
+ strip="${1#*=}"
+ ;;
--exclude=*)
excludes+=( "!" "-path" "${1#*=}/*" )
;;
+ --ignore-errors)
+ break_on_error="0"
+ ;;
*)
paths+=( "${1}" )
;;
--absolute-names --dump "${file}" 2>/dev/null)"
echo "Stripping ${file}..."
- if ! strip "${args[@]}" "${file}"; then
- return 1
+ if ! "${strip}" "${args[@]}" "${file}"; then
+ return ${break_on_error}
fi
-
# Restore capabilities
if [ -n "${capabilities}" ]; then
setfattr --no-dereference --restore=<(echo "${capabilities}")