diff mbox

[2/5] readline: fix installed libraries permission

Message ID 1465917079-30473-2-git-send-email-gilles.chanteperdrix@xenomai.org
State Rejected
Headers show

Commit Message

Gilles Chanteperdrix June 14, 2016, 3:11 p.m. UTC
In order to avoid strip failing to strip the library.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
---
 package/readline/0009-avoid-strip-perm-issue.patch | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 package/readline/0009-avoid-strip-perm-issue.patch

Comments

Yann E. MORIN June 14, 2016, 8:04 p.m. UTC | #1
Gilles, All,

On 2016-06-14 17:11 +0200, Gilles Chanteperdrix spake thusly:
> In order to avoid strip failing to strip the library.

I just tried to build readline, and the two libraries that are installed
are already 755:

    -rwxr-xr-x 1 ymorin ymorin  33K Jun 14 21:59 target/usr/lib/libhistory.so.6.3*
    -rwxr-xr-x 1 ymorin ymorin 261K Jun 14 21:59 target/usr/lib/libreadline.so.6.3*

And after some inspection, we already fix that in our readline.mk:

    # libraries get installed read only, so strip fails
    define READLINE_INSTALL_FIXUPS_SHARED
        chmod +w $(addprefix $(TARGET_DIR)/usr/lib/,libhistory.so.* libreadline.so.*)
    endef
    READLINE_POST_INSTALL_TARGET_HOOKS += READLINE_INSTALL_FIXUPS_SHARED

Regards,
Yann E. MORIN.

> Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> ---
>  package/readline/0009-avoid-strip-perm-issue.patch | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>  create mode 100644 package/readline/0009-avoid-strip-perm-issue.patch
> 
> diff --git a/package/readline/0009-avoid-strip-perm-issue.patch b/package/readline/0009-avoid-strip-perm-issue.patch
> new file mode 100644
> index 0000000..55d5166
> --- /dev/null
> +++ b/package/readline/0009-avoid-strip-perm-issue.patch
> @@ -0,0 +1,14 @@
> +Avoid libreadline to be installed read-only, as it makes stripping fail.
> +
> +Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> +--- readline-6.3/support/shlib-install~	2012-07-10 21:58:08.000000000 +0200
> ++++ readline-6.3/support/shlib-install	2016-02-27 01:19:09.878310797 +0100
> +@@ -73,7 +73,7 @@ fi
> + case "$host_os" in
> + hpux*|darwin*|macosx*|linux*|solaris2*)
> + 	if [ -z "$uninstall" ]; then
> +-		chmod 555 ${INSTALLDIR}/${LIBNAME}
> ++		chmod 755 ${INSTALLDIR}/${LIBNAME}
> + 	fi ;;
> + cygwin*|mingw*)
> + 	IMPLIBNAME=`echo ${LIBNAME} \
> -- 
> 2.8.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard June 14, 2016, 8:21 p.m. UTC | #2
>>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:

 > In order to avoid strip failing to strip the library.
 > Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>

Thanks, but we already have logic in readline.mk to fix this:

ifneq ($(BR2_STATIC_LIBS),y)
# libraries get installed read only, so strip fails
define READLINE_INSTALL_FIXUPS_SHARED
	chmod +w $(addprefix $(TARGET_DIR)/usr/lib/,libhistory.so.* libreadline.so.*)
endef
READLINE_POST_INSTALL_TARGET_HOOKS += READLINE_INSTALL_FIXUPS_SHARED
endif

So why this patch instead? It would be good if we could get rid of both,
have you tried sending it upstream?
Gilles Chanteperdrix June 15, 2016, 9:32 p.m. UTC | #3
On Tue, Jun 14, 2016 at 10:21:23PM +0200, Peter Korsgaard wrote:
> >>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:
> 
>  > In order to avoid strip failing to strip the library.
>  > Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> 
> Thanks, but we already have logic in readline.mk to fix this:

Ok, I guess I made the original patch before you included that patch
in readline.mk.

> 
> ifneq ($(BR2_STATIC_LIBS),y)
> # libraries get installed read only, so strip fails
> define READLINE_INSTALL_FIXUPS_SHARED
> 	chmod +w $(addprefix $(TARGET_DIR)/usr/lib/,libhistory.so.* libreadline.so.*)
> endef
> READLINE_POST_INSTALL_TARGET_HOOKS += READLINE_INSTALL_FIXUPS_SHARED
> endif
> 
> So why this patch instead? It would be good if we could get rid of both,
> have you tried sending it upstream?

No, and I will not.
Peter Korsgaard June 15, 2016, 9:48 p.m. UTC | #4
>>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:

Hi,

 > On Tue, Jun 14, 2016 at 10:21:23PM +0200, Peter Korsgaard wrote:
 >> >>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:
 >> 
 >> > In order to avoid strip failing to strip the library.
 >> > Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
 >> 
 >> Thanks, but we already have logic in readline.mk to fix this:

 > Ok, I guess I made the original patch before you included that patch
 > in readline.mk.

This patch was added in January. Please base your patches on recent
versions to ensure they still apply / are needed.

 >> So why this patch instead? It would be good if we could get rid of both,
 >> have you tried sending it upstream?

 > No, and I will not.

:/
Gilles Chanteperdrix June 16, 2016, 7:43 p.m. UTC | #5
On Wed, Jun 15, 2016 at 11:48:43PM +0200, Peter Korsgaard wrote:
> >>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:
> 
> Hi,
> 
>  > On Tue, Jun 14, 2016 at 10:21:23PM +0200, Peter Korsgaard wrote:
>  >> >>>>> "Gilles" == Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> writes:
>  >> 
>  >> > In order to avoid strip failing to strip the library.
>  >> > Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>  >> 
>  >> Thanks, but we already have logic in readline.mk to fix this:
> 
>  > Ok, I guess I made the original patch before you included that patch
>  > in readline.mk.
> 
> This patch was added in January. Please base your patches on recent
> versions to ensure they still apply / are needed.

I worked on these issues starting from the latest release at the
time which was 2015.11.1. I of course rebased the patch on master
(exactly commit 00bd9daf0e75f76c2d15196feb9c7f608668430e, as you can
see using the URL I posted) but I simply missed the fact that
readline.mk had been modified, because the patch applied cleanly.

> 
>  >> So why this patch instead? It would be good if we could get rid of both,
>  >> have you tried sending it upstream?
> 
>  > No, and I will not.
> 
> :/

Well, anyone else can submit it if he is interested. You can even
remove my name and put yours instead, I do not care.
diff mbox

Patch

diff --git a/package/readline/0009-avoid-strip-perm-issue.patch b/package/readline/0009-avoid-strip-perm-issue.patch
new file mode 100644
index 0000000..55d5166
--- /dev/null
+++ b/package/readline/0009-avoid-strip-perm-issue.patch
@@ -0,0 +1,14 @@ 
+Avoid libreadline to be installed read-only, as it makes stripping fail.
+
+Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
+--- readline-6.3/support/shlib-install~	2012-07-10 21:58:08.000000000 +0200
++++ readline-6.3/support/shlib-install	2016-02-27 01:19:09.878310797 +0100
+@@ -73,7 +73,7 @@ fi
+ case "$host_os" in
+ hpux*|darwin*|macosx*|linux*|solaris2*)
+ 	if [ -z "$uninstall" ]; then
+-		chmod 555 ${INSTALLDIR}/${LIBNAME}
++		chmod 755 ${INSTALLDIR}/${LIBNAME}
+ 	fi ;;
+ cygwin*|mingw*)
+ 	IMPLIBNAME=`echo ${LIBNAME} \