Skip to contentSkip to conversation

gettext: fixup library permissions

PATCH New Gustavo Zacarias 4 participants 6 messages Sep 18, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 gettext: fixup library permissions

libintl.so* is installed without +x permissions thus preventing stripping. Fix it up in the post install target hooks.

---
 package/gettext/gettext.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/gettext/gettext.mk +7 -0
index baf42ef..7af2035 100644
@@ -58,5 +58,12 @@ endef
 endif
 endif # GETTEXT_TOOLS = n
 
+# Library lacks +x so strip skips it
+define GETTEXT_FIX_LIBRARY_MODE
+	-chmod +x $(TARGET_DIR)/usr/lib/libintl.so*
+endef
+
+GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_FIX_LIBRARY_MODE
+
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 2/3 libiconv: fixup library permissions

libiconv.so* and libcharset.so* are installed without +x permissions thus preventing stripping. Fix it up in the post install target hooks.

---
 package/libiconv/libiconv.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/libiconv/libiconv.mk +8 -0
index d6a1d6f..aa6d6de 100644
@@ -21,6 +21,14 @@ endef
 LIBICONV_POST_INSTALL_TARGET_HOOKS += LIBICONV_TARGET_REMOVE_PRELOADABLE_LIBS
 LIBICONV_POST_INSTALL_STAGING_HOOKS += LIBICONV_STAGING_REMOVE_PRELOADABLE_LIBS
 
+# Library lacks +x so strip skips it
+define LIBICONV_FIX_LIBRARY_MODE
+	-chmod +x $(TARGET_DIR)/usr/lib/libcharset.so*
+	-chmod +x $(TARGET_DIR)/usr/lib/libiconv.so*
+endef
+
+LIBICONV_POST_INSTALL_TARGET_HOOKS += LIBICONV_FIX_LIBRARY_MODE
+
 $(eval $(autotools-package))
 
 # Configurations where the toolchain supports locales and the libiconv
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 3/3 pciutils: fixup library permissions

In reply to Gustavo Zacarias

libpci.so* is installed without +x permissions thus preventing stripping. Fix it up in the post install target hooks.

---
 package/pciutils/pciutils.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pciutils/pciutils.mk +8 -0
index 350ca0d..fd6f8aa 100644
@@ -65,4 +65,12 @@ define PCIUTILS_INSTALL_STAGING_CMDS
 		SHARED=$(PCIUTILS_SHARED) install install-lib
 endef
 
+
+# Library lacks +x so strip skips it
+define PCIUTILS_FIX_LIBRARY_MODE
+	-chmod +x $(TARGET_DIR)/usr/lib/libpci.so*
+endef
+
+PCIUTILS_POST_INSTALL_TARGET_HOOKS += PCIUTILS_FIX_LIBRARY_MODE
+
 $(eval $(generic-package))
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH 1/3 gettext: fixup library permissions

In reply to Gustavo Zacarias
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Gustavo> libintl.so* is installed without +x permissions thus preventing Gustavo> stripping. Fix it up in the post install target hooks.

Committed series, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/3 gettext: fixup library permissions

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Quoted 4 lines · Gustavo Zacarias

libintl.so* is installed without +x permissions thus preventing stripping. Fix it up in the post install target hooks.

There are apparently a few other packages affected by this, see
http://patchwork.ozlabs.org/patch/246622/.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 1/3 gettext: fixup library permissions

In reply to Gustavo Zacarias
Quoted 4 lines · Gustavo Zacarias

libintl.so* is installed without +x permissions thus preventing stripping. Fix it up in the post install target hooks.

I wonder if this is the right path to take. There is really no reason
why shared libs should be executable. And in the target of my allpackageyesconfig I find a lot more than these three:

$ find target -type f -a \
   \( -name \*.so -o -name \*.so.[0-9]* \) -a \
   \! -executable
target/usr/libexec/sudoers.so
target/usr/libexec/sudo_noexec.so
target/usr/lib/libisc.so.57.1.2
target/usr/lib/python2.7/site-packages/_omniidlmodule.so.4.1
target/usr/lib/libdvbsec.so
target/usr/lib/libesg.so
target/usr/lib/libacl.so.1.1.0
target/usr/lib/libCOSDynamic4.so.1.6
target/usr/lib/libomniDynamic4.so.1.6
target/usr/lib/libhogweed.so.2.5
target/usr/lib/libdns.so.113.0.1
target/usr/lib/libpci.so.3.2.0
target/usr/lib/nm-n.libdirectfb-1.6.so.0
target/usr/lib/libisccfg.so.50.0.9
target/usr/lib/lua/cjson.so
target/usr/lib/nm-n.libdirect-1.6.so.0
target/usr/lib/libattr.so.1.1.0
target/usr/lib/libomniORB4.so.1.6
target/usr/lib/nm-n.libfusion-1.6.so.0
target/usr/lib/libbind9.so.50.0.10
target/usr/lib/libucsi.so
target/usr/lib/libisccc.so.50.0.4
target/usr/lib/libdvbcfg.so
target/usr/lib/libomniConnectionMgmt4.so.1.6
target/usr/lib/libebml.so.3
target/usr/lib/libproxychains4.so
target/usr/lib/libdvben50221.so
target/usr/lib/libomniCodeSets4.so.1.6
target/usr/lib/libmatroska.so.5
target/usr/lib/liblwres.so.50.0.9
target/usr/lib/libdvbapi.so
target/usr/lib/libCOS4.so.1.6
target/usr/lib/liblockdev.1.0.3.so
target/usr/lib/libnettle.so.4.7
target/usr/lib/libomnithread.so.3.4

In addition, such patches are not really future-safe in case a package
adds a new library.

So I would propose to instead change the find command to

STRIP_FIND_CMD += -type f
STRIP_FIND_CMD += \( -perm /111 -o -name \*.so -o -name \*.so.[0-9]* \)

Regards,
Arnout

Quoted 22 lines
---
  package/gettext/gettext.mk | 7 +++++++
  1 file changed, 7 insertions(+)
package/gettext/gettext.mk +7 -0
index baf42ef..7af2035 100644
@@ -58,5 +58,12 @@ endef
  endif
  endif # GETTEXT_TOOLS = n
 
+# Library lacks +x so strip skips it
+define GETTEXT_FIX_LIBRARY_MODE
+	-chmod +x $(TARGET_DIR)/usr/lib/libintl.so*
+endef
+
+GETTEXT_POST_INSTALL_TARGET_HOOKS += GETTEXT_FIX_LIBRARY_MODE
+
  $(eval $(autotools-package))
  $(eval $(host-autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F