Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stripping changes #2

Merged
merged 8 commits into from
Mar 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/functions
Original file line number Diff line number Diff line change
Expand Up @@ -436,3 +436,10 @@ show_config() {

echo -e "$config_message"
}

# strip
debug_strip() {
if [ ! "$DEBUG" = yes ]; then
$STRIP `find $* -type f -executable 2>/dev/null` 2>/dev/null || :
fi
}
2 changes: 1 addition & 1 deletion config/optimize
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ "$DEBUG" = yes ]; then
else
TARGET_CFLAGS="$TARGET_CFLAGS -fomit-frame-pointer"
TARGET_CXXFLAGS="$TARGET_CXXFLAGS -fomit-frame-pointer"
TARGET_LDFLAGS="$TARGET_LDFLAGS -s"
TARGET_LDFLAGS="$TARGET_LDFLAGS"
fi

TARGET_CPPFLAGS=
Expand Down
4 changes: 4 additions & 0 deletions packages/lang/Python/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,8 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/bin/pydoc
rm -rf $INSTALL/usr/bin/smtpd.py
rm -rf $INSTALL/usr/bin/python*-config

# strip
chmod u+w $INSTALL/usr/lib/libpython*.so.*
debug_strip $INSTALL/usr
}
2 changes: 2 additions & 0 deletions packages/mediacenter/kodi/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ post_makeinstall_target() {
mkdir -p $INSTALL/usr/share/kodi/media/Fonts
cp $PKG_DIR/fonts/*.ttf $INSTALL/usr/share/kodi/media/Fonts
fi

debug_strip $INSTALL/usr/lib/kodi/kodi.bin
}

post_install() {
Expand Down
2 changes: 2 additions & 0 deletions packages/network/openssh/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ post_makeinstall_target() {

sed -i $INSTALL/etc/ssh/sshd_config -e "s|^#PermitRootLogin.*|PermitRootLogin yes|g"
echo "PubkeyAcceptedKeyTypes +ssh-dss" >> $INSTALL/etc/ssh/sshd_config

debug_strip $INSTALL/usr
}

post_install() {
Expand Down
4 changes: 4 additions & 0 deletions packages/sysutils/systemd/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ post_makeinstall_target() {
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/shutdown
ln -sf /usr/bin/systemctl $INSTALL/usr/sbin/telinit

# strip
debug_strip $INSTALL/usr

# defaults
mkdir -p $INSTALL/usr/config
cp -PR $PKG_DIR/config/* $INSTALL/usr/config

Expand Down
14 changes: 12 additions & 2 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,18 @@ if [ ! -f $STAMP ]; then
find $INSTALL -type d -exec rmdir -p "{}" ";" 2>/dev/null || true

if [ ! "$DEBUG" = yes ]; then
$STRIP `find $INSTALL -name "*.so" 2>/dev/null` 2>/dev/null || :
$STRIP `find $INSTALL -name "*.so.[0-9]*" 2>/dev/null` 2>/dev/null || :
$STRIP `find $INSTALL \
-type f -name "*.so*" \
! -name "ld-*.so" \
! -name "libc-*.so" \
! -name "libpthread-*.so" \
! -name "libthread_db-*so" \
2>/dev/null` 2>/dev/null || :
if [ "$TARGET" = "init" ]; then
$STRIP `find $INSTALL -type f -name "*.so*" 2>/dev/null` 2>/dev/null || :
fi
$STRIP `find $INSTALL/bin $INSTALL/usr/bin $INSTALL/sbin $INSTALL/usr/sbin \
-type f -executable 2>/dev/null` 2>/dev/null || :
fi
fi
fi
Expand Down