All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/bash: fix strtoimax builtin inclusion logic
@ 2023-02-07 11:47 Yann E. MORIN
  0 siblings, 0 replies; only message in thread
From: Yann E. MORIN @ 2023-02-07 11:47 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=12d85e9646ed89552c732775de000ad0b436a139
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Backport fixes from upstream to fix an issue where the strtoimax builtin
got built when not necessary.

This resolves bash static builds issues when using musl and uClibc.

We fix both the m4 file and configure in that order, to be safe andnot
trigger an automatic autoreconf (even though bash does not have a rule
to automatically regenerate configure if an m4 file changes).

Fixes:
 http://autobuild.buildroot.org/results/f8c/f8cb91f7f9ac6a46bb2ecfc22c1e42cf699f28d3//
 http://autobuild.buildroot.org/results/b0e/b0e5fcab9eeb799e31bca27fcb7280b728349bc6//

Upstream:
  https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=43e861c2cd840946a81dfd0386966eb4f3a17ce9

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
[yann.morin.1998@free.fr:
  - patch configure after the m4 file
  - add blurb in commit log to explain that
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 ...re-invert-condition-for-strtoimax-builtin.patch | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/package/bash/0003-configure-invert-condition-for-strtoimax-builtin.patch b/package/bash/0003-configure-invert-condition-for-strtoimax-builtin.patch
new file mode 100644
index 0000000000..c412dcfce2
--- /dev/null
+++ b/package/bash/0003-configure-invert-condition-for-strtoimax-builtin.patch
@@ -0,0 +1,62 @@
+From 754e0d1edc1c01b18f4890de7c58f7610e589d76 Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <vfazio@gmail.com>
+Date: Tue, 7 Feb 2023 03:55:28 -0600
+Subject: [PATCH] configure: invert condition for strtoimax builtin
+
+Previously, bash would attempt to build a replacement for strtoimax if
+it found that the C library had the function already declared.
+
+This caused build errors when linking against static libraries that did
+not define the function as a weak alias but, in reality, was a logic
+error since bash should only provide it's own implementation if one is
+not provided by the C library.
+
+Now, fix this by inverting the logic.
+
+Upstream:
+  https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=43e861c2cd840946a81dfd0386966eb4f3a17ce9
+
+Signed-off-by: Vincent Fazio <vfazio@gmail.com>
+[yann.morin.1998@free.fr: patch configure after the m file]
+Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
+---
+ configure       | 6 +++++-
+ m4/strtoimax.m4 | 5 ++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
+index 30985723..fa43ac7b 100644
+--- a/m4/strtoimax.m4
++++ b/m4/strtoimax.m4
+@@ -29,7 +29,10 @@ AC_CACHE_VAL(bash_cv_func_strtoimax,
+   fi
+ ])
+ AC_MSG_RESULT($bash_cv_func_strtoimax)
+-if test $bash_cv_func_strtoimax = yes; then
++if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
++AC_DEFINE([HAVE_DECL_STRTOIMAX], [1])
++fi
++if test $bash_cv_func_strtoimax = no; then
+ AC_LIBOBJ(strtoimax)
+ fi
+ ])
+diff --git a/configure b/configure
+index 47313753..6039cee7 100755
+--- a/configure
++++ b/configure
+@@ -20443,7 +20443,11 @@ fi
+ 
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strtoimax" >&5
+ printf "%s\n" "$bash_cv_func_strtoimax" >&6; }
+-if test $bash_cv_func_strtoimax = yes; then
++if test "$ac_cv_have_decl_strtoimax" = "yes" ; then
++printf "%s\n" "#define HAVE_DECL_STRTOIMAX 1" >>confdefs.h
++
++fi
++if test $bash_cv_func_strtoimax = no; then
+ case " $LIBOBJS " in
+   *" strtoimax.$ac_objext "* ) ;;
+   *) LIBOBJS="$LIBOBJS strtoimax.$ac_objext"
+-- 
+2.25.1
+
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-07 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 11:47 [Buildroot] [git commit] package/bash: fix strtoimax builtin inclusion logic Yann E. MORIN

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.