OpenWrt Forum Archive

Topic: 'disown' support in Bash 3.2.0 cross-compiled for arm

The content of this topic has been archived on 4 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have compiled Bash 3.2.0 for x86 and when doing so it includes the built-in 'disown' feature.  However, when cross-compiling for arm it is disappointingly absent.  I have modified the OpenWRT makefile to try and compensate but have thus far been unsuccessful.

I have tried:

define Build/Configure
    $(call Build/Configure/Default, \
        --enable-disown=yes \
        --with-disown=yes \
        --disable-restricted \
        --without-bash-malloc \
        --bindir=/bin \
    )
endef

as well as

define Build/Configure
    (cd $(PKG_BUILD_DIR); \
                     $(TARGET_CONFIGURE_OPTS) \
                     CFLAGS="$(TARGET_CFLAGS) \
                     CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
                     LD="$(TARGET_CC)" \
                     LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
                     ./configure \
                            --target=$(GNU_TARGET_NAME) \
                            --host=$(GNU_TARGET_NAME) \
                            --build=$(GNU_HOST_NAME) \
                            --with-disown=yes \
       )
endef

Any suggestion would be most appreciated!

For anyone who has had this problem I decide to write a patch to force the ./configure script to auto ignore the check.  The problem lay in ./configure not being able to test signalling due to cross-compilation and thus it automatically just chose no when doing the cross compiling.  The patch:

Forgive the lack of format:
----------------------------------------------------------------------------------------------------------------------------------
diff -U 3 -dHBbrN -- bash-3.2.orig/configure.in bash-3.2/configure.in
--- bash-3.2.orig/configure.in  2008-11-17 17:08:14.000000000 -0800
+++ bash-3.2/configure.in       2008-11-17 17:10:40.000000000 -0800
@@ -386,6 +386,9 @@
CROSS_COMPILE=
if test "x$cross_compiling" = "xyes"; then
     case "${host}" in
+    *-linux-gnu)
+        cross_cache=${srcdir}/cross-build/linux-gnu.cache
+        ;;
     *-cygwin*)
        cross_cache=${srcdir}/cross-build/cygwin32.cache
        ;;
diff -U 3 -dHBbrN -- bash-3.2.orig/cross-build/linux-gnu.cache bash-3.2/cross-build/linux-gnu.cache
--- bash-3.2.orig/cross-build/linux-gnu.cache   1969-12-31 16:00:00.000000000 -0800
+++ bash-3.2/cross-build/linux-gnu.cache        2008-11-17 17:08:59.000000000 -0800
@@ -0,0 +1,6 @@
+ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void=yes}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=yes}
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+bash_cv_job_control_missing=${bash_cv_job_control_missing=no}
+bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=yes}
--------------------------------------------------------------------------------------------------------------------------------

Hopes this helps the next....

The discussion might have continued from here.