Libraries were treated differently and therfore it could
happen that they were not stripped from any unnecessary
relocation information at all.
This patch changes that and strips everything from
libraries that we do not need.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
# Enables hardening
HARDENING_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong"
- CFLAGS="-O2 -pipe -Wall -fexceptions -fPIC ${CFLAGS_ARCH}"
+ CFLAGS="-O2 -g -pipe -Wall -fexceptions -fPIC ${CFLAGS_ARCH}"
CXXFLAGS="${CFLAGS}"
# Determine parallelism
function _strip() {
local file=${1}
- local cmd="${STRIP-strip}"
+ local strip="${STRIP-strip}"
local exclude l
for exclude in ${excludes}; do
fi
done
+ local cmd=( "${strip}" "--strip-unneeded" )
+
case "$(file -bi ${file})" in
- application/x-sharedlib*|application/x-archive*)
- cmd="${cmd} --strip-debug --remove-section=.comment --remove-section=.note"
- ;;
- *)
- cmd="${cmd} --strip-unneeded"
+ application/x-sharedlib*)
+ cmd+=( "--strip-debug" "--remove-section=.comment" "--remove-section=.note" )
;;
esac
echo "Stripping ${file}..."
- ${cmd} ${file}
+ ${cmd[*]} ${file}
}
for dir in ${dirs}; do