All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] python: fix to ensure libpython is stripped
Date: Thu, 23 Jan 2014 15:06:08 +0100	[thread overview]
Message-ID: <CAAXf6LV1vHUAEDGdCmMZ0nC-XX3x9QSZOWnAZbNS=rG=0bGnFA@mail.gmail.com> (raw)
In-Reply-To: <1390448438-13114-1-git-send-email-przemyslaw.wrzos@calyptech.com>

On Thu, Jan 23, 2014 at 4:40 AM, Przemyslaw Wrzos
<przemyslaw.wrzos@calyptech.com> wrote:
> The python and python3 builds mark libpython as read-only which
> prevents it from being stripped out correctly for the target.
>
> Signed-off-by: Przemyslaw Wrzos <przemyslaw.wrzos@calyptech.com>
> ---
>  package/python/python.mk   | 9 +++++++++
>  package/python3/python3.mk | 9 +++++++++
>  2 files changed, 18 insertions(+)
>
>  NOTE: Resubmitting as part of patchwork cleanup #6.
>
> diff --git a/package/python/python.mk b/package/python/python.mk
> index 6a6aaac..69662c3 100644
> --- a/package/python/python.mk
> +++ b/package/python/python.mk
> @@ -162,6 +162,15 @@ endef
>
>  PYTHON_POST_INSTALL_TARGET_HOOKS += PYTHON_REMOVE_USELESS_FILES
>
> +#
> +# Make sure libpython gets stripped out on target
> +#
> +define PYTHON_ENSURE_LIBPYTHON_STRIPPED
> +       chmod u+w $(TARGET_DIR)/usr/lib/libpython$(PYTHON_VERSION_MAJOR)*.so
> +endef
> +
> +PYTHON_POST_INSTALL_TARGET_HOOKS += PYTHON_ENSURE_LIBPYTHON_STRIPPED
> +
>  PYTHON_AUTORECONF = YES
>
>  $(eval $(autotools-package))
> diff --git a/package/python3/python3.mk b/package/python3/python3.mk
> index b5e9689..6cbe772 100644
> --- a/package/python3/python3.mk
> +++ b/package/python3/python3.mk
> @@ -149,6 +149,15 @@ endef
>
>  PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_REMOVE_USELESS_FILES
>
> +#
> +# Make sure libpython gets stripped out on target
> +#
> +define PYTHON3_ENSURE_LIBPYTHON_STRIPPED
> +       chmod u+w $(TARGET_DIR)/usr/lib/libpython$(PYTHON3_VERSION_MAJOR)*.so
> +endef
> +
> +PYTHON3_POST_INSTALL_TARGET_HOOKS += PYTHON3_ENSURE_LIBPYTHON_STRIPPED
> +
>  PYTHON3_AUTORECONF = YES
>
>  define PYTHON3_INSTALL_SYMLINK
> --

Acked-by: Thomas De Schampheleire <thomas.de_schampheleire@alcatel-lucent.com>
Tested-by: Thomas De Schampheleire <thomas.de_schampheleire@alcatel-lucent.com>
(tested with python2 only)

Note: the library will remain writable, but this doesn't look like a
big problem to me...

By the way: nice find! Saves about 4MB on Python 2!

  reply	other threads:[~2014-01-23 14:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23  3:40 [Buildroot] [PATCH] python: fix to ensure libpython is stripped Przemyslaw Wrzos
2014-01-23 14:06 ` Thomas De Schampheleire [this message]
2014-01-23 23:53   ` Przemyslaw Wrzos
2014-01-27 20:05   ` Thomas De Schampheleire
2014-02-13 21:08 ` Thomas Petazzoni
2014-02-14  0:22   ` Przemyslaw Wrzos
2014-02-14  8:17     ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAXf6LV1vHUAEDGdCmMZ0nC-XX3x9QSZOWnAZbNS=rG=0bGnFA@mail.gmail.com' \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.