package/glibc: drop dependency of utilities on bash
PATCH 1/1 package/glibc: drop dependency of utilities on bash
From: Carlos Santos <[email protected]>
The dependency was added because ldd uses bash-specific syntax to localize messages. Add a post-patch hook, instead, to replace the occurrences of $"foo" by "foo", simply, so the code becomes POSIX sh compliant if bash is not selected.
Also set the configuration environment accordingly to replace the /bin/bash hashbang by /bin/sh.
--- package/glibc/Config.in | 4 ---- package/glibc/glibc.mk | 11 ++++++++++- 2 files changed, 10 insertions(+), 5 deletions(-)
package/glibc/Config.in +0 -4
@@ -11,10 +11,6 @@ endif config BR2_PACKAGE_GLIBC_UTILS bool "Install glibc utilities" - depends on BR2_PACKAGE_BASH help Enabling this option will compile and install the getconf, ldconfig, ldd and locale glibc utilities for the target. - -comment "glibc utilities need bash" - depends on !BR2_PACKAGE_BASH
package/glibc/glibc.mk +10 -1
@@ -74,10 +74,19 @@ endef endif GLIBC_CONF_ENV = \ - ac_cv_path_BASH_SHELL=/bin/bash \ + ac_cv_path_BASH_SHELL=/bin/$(if $(BR2_PACKAGE_BASH),bash,sh) \ libc_cv_forced_unwind=yes \ libc_cv_ssp=no +# POSIX shell does not support localization, so remove the corresponding +# syntax from ldd if bash is not selected. +ifeq ($(BR2_PACKAGE_BASH),) +define GLIBC_LDD_NO_BASH + $(SED) 's/$$"/"/g' $(@D)/elf/ldd.bash.in +endef +GLIBC_POST_PATCH_HOOKS += GLIBC_LDD_NO_BASH +endif + # Override the default library locations of /lib64/<abi> and # /usr/lib64/<abi>/ for RISC-V. ifeq ($(BR2_riscv),y)
Signature · 1 line
2.18.1
PATCH 1/1 package/glibc: drop dependency of utilities on bash
Quoted 11 lines · On Mon, 2 Dec 2019 21:14:05 -0300 unixmania at gmail.com wrote:
From: Carlos Santos <[email protected]>
The dependency was added because ldd uses bash-specific syntax to localize messages. Add a post-patch hook, instead, to replace the occurrences of $"foo" by "foo", simply, so the code becomes POSIX sh compliant if bash is not selected.
Also set the configuration environment accordingly to replace the
/bin/bashhashbang by/bin/sh.Signed-off-by Carlos Santos <[email protected]>
I've applied, however I think it would be nice to have this mechanism supported upstream. It can probably be easily added using a check in configure.ac, and the proper autoconf replacement variable when generating elf/ldd.bash.
Could you have a look into this ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 package/glibc: drop dependency of utilities on bash
Quoted 16 lines · Thomas Petazzoni
Quoted 11 lines · On Mon, 2 Dec 2019 21:14:05 -0300 unixmania at gmail.com wrote:
From: Carlos Santos <[email protected]>
The dependency was added because ldd uses bash-specific syntax to localize messages. Add a post-patch hook, instead, to replace the occurrences of $"foo" by "foo", simply, so the code becomes POSIX sh compliant if bash is not selected.
Also set the configuration environment accordingly to replace the
/bin/bashhashbang by/bin/sh.Signed-off-by Carlos Santos <[email protected]>
Quoted 8 lines
I've applied, however I think it would be nice to have this mechanism supported upstream. It can probably be easily added using a check in configure.ac, and the proper autoconf replacement variable when generating elf/ldd.bash.
Could you have a look into this ?
Thanks!
I'm working on a patch series to glibc but it requires ATORECONF, which fails because GLIBC_SUBDIR is set to "build" and there configure.ac is not there. I circumvented the problem by using
define GLIBC_AUTORECONF
cd $(@D) && $(AUTORECONF) || true
endef
GLIBC_PRE_CONFIGURE_HOOKS = GLIBC_AUTORECONF
The "|| true" there is a kludge to ignore this error:
Use of uninitialized value $args[0] in split at /work/qemu_x86_64_glibc_eudev/host/bin/autoreconf line 493, <GEN2> line 4.
autoheader: warning: missing template: BIND_NOW
autoheader: Use AC_DEFINE([BIND_NOW], [], [Description])
autoheader: warning: missing template: DO_STATIC_NSS
autoheader: warning: missing template: ENABLE_STACKGUARD_RANDOMIZE
autoheader: warning: missing template: ENABLE_STATIC_PIE
autoheader: warning: missing template: EXPORT_UNWIND_FIND_FDE
autoheader: warning: missing template: HAVE_ASM_SET_DIRECTIVE
autoheader: warning: missing template: HAVE_BUILTIN_MEMSET
autoheader: warning: missing template: HAVE_BUILTIN_TRAP
autoheader: warning: missing template: HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
autoheader: warning: missing template: HAVE_CC_NO_STACK_PROTECTOR
autoheader: warning: missing template: HAVE_CC_WITH_LIBUNWIND
autoheader: warning: missing template: HAVE_EHDR_START
autoheader: warning: missing template: HAVE_GCC_IFUNC
autoheader: warning: missing template: HAVE_IFUNC
autoheader: warning: missing template: HAVE_PT_CHOWN
autoheader: warning: missing template: HAVE_SDATA_SECTION
autoheader: warning: missing template: HAVE_SECTION_QUOTES
autoheader: warning: missing template: HAVE_TUNABLES
autoheader: warning: missing template: HAVE_Z_COMBRELOC
autoheader: warning: missing template: LINK_OBSOLETE_NSL
autoheader: warning: missing template: LINK_OBSOLETE_RPC
autoheader: warning: missing template: NO_CTORS_DTORS_SECTIONS
autoheader: warning: missing template: NO_HIDDEN
autoheader: warning: missing template: STACK_PROTECTOR_LEVEL
autoheader: warning: missing template: USE_LDCONFIG
autoheader: warning: missing template: USE_MULTIARCH
autoheader: warning: missing template: USE_NSCD
autoheader: warning: missing template: USE_STAP_PROBE
autoreconf: /work/qemu_x86_64_glibc_eudev/host/bin/autoheader failed with exit status: 1
--
Carlos Santos <[email protected]>
PATCH 1/1 package/glibc: drop dependency of utilities on bash
Hello Carlos,
Quoted 6 lines · On Sun, 8 Dec 2019 22:38:52 -0300 Carlos Santos <[email protected]> wrote:
I'm working on a patch series to glibc but it requires ATORECONF, which fails because
GLIBC_SUBDIRis set to "build" and there configure.ac is not there. I circumvented the problem by usingdefine
GLIBC_AUTORECONFcd $(@D) && $(AUTORECONF) || true
Quoted 8 lines
endef
GLIBC_PRE_CONFIGURE_HOOKS=GLIBC_AUTORECONFThe "|| true" there is a kludge to ignore this error:
Use of uninitialized value $args[0] in split at /work/qemu_x86_64_glibc_eudev/host/bin/autoreconf line 493, <GEN2>
Hum, OK. Perhaps another way is to simply have your patch make its way upstream, and wait until the next glibc release to really use it in Buildroot. In the mean time, we can keep the post patch hook that you have implemented and that was merged in Buildroot.
What is important is that at some point in the future, there will be an upstream solution. We don't necessarily need to use it immediately in Buildroot.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 package/glibc: drop dependency of utilities on bash
Quoted 21 lines · Thomas Petazzoni
Hello Carlos,
Quoted 6 lines · On Sun, 8 Dec 2019 22:38:52 -0300 Carlos Santos <[email protected]> wrote:
I'm working on a patch series to glibc but it requires ATORECONF, which fails because
GLIBC_SUBDIRis set to "build" and there configure.ac is not there. I circumvented the problem by usingdefine
GLIBC_AUTORECONFcd $(@D) && $(AUTORECONF) || trueQuoted 8 lines
endef
GLIBC_PRE_CONFIGURE_HOOKS=GLIBC_AUTORECONFThe "|| true" there is a kludge to ignore this error:
Use of uninitialized value $args[0] in split at /work/qemu_x86_64_glibc_eudev/host/bin/autoreconf line 493, <GEN2>
Quoted 8 lines
Hum, OK. Perhaps another way is to simply have your patch make its way upstream, and wait until the next glibc release to really use it in Buildroot. In the mean time, we can keep the post patch hook that you have implemented and that was merged in Buildroot.
What is important is that at some point in the future, there will be an upstream solution. We don't necessarily need to use it immediately in Buildroot.
RFE submitted: https://sourceware.org/bugzilla/show_bug.cgi?id=25259
Signature · 1 line
Carlos Santos <[email protected]>
PATCH 1/1 package/glibc: drop dependency of utilities on bash
Quoted 10 lines · On Mon, 9 Dec 2019 08:41:40 -0300 Carlos Santos <[email protected]> wrote:
Quoted 8 lines
Hum, OK. Perhaps another way is to simply have your patch make its way upstream, and wait until the next glibc release to really use it in Buildroot. In the mean time, we can keep the post patch hook that you have implemented and that was merged in Buildroot.
What is important is that at some point in the future, there will be an upstream solution. We don't necessarily need to use it immediately in Buildroot.
RFE submitted: https://sourceware.org/bugzilla/show_bug.cgi?id=25259
Thanks a lot! Much appreciated.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com