* [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan)
@ 2017-02-08 15:17 Carlos Santos
2017-02-09 21:14 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Carlos Santos @ 2017-02-08 15:17 UTC (permalink / raw)
To: buildroot
- Cherry-pick a patch from upstream to link scriptreplay to libm (for
"isnam").
- Add a patch that improves the detection of isnan when using uClibc.
This patch is for util-linux v2.29.1 and must be adapted to their
master branch to be submitted upstream.
Fixes:
http://autobuild.buildroot.net/results/2c2/2c29a78ed81ca844a87dcd076ab3e14ea080296d
http://autobuild.buildroot.net/results/404/404b10f359b2ae8a7216729fa1bab37fed2d3d4c
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
...-sys-use-lm-for-scriptreplay-if-necessary.patch | 32 +++++++++++++++++++
...mprove-detection-of-the-isnan-function-in.patch | 37 ++++++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch
create mode 100644 package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch
diff --git a/package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch b/package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch
new file mode 100644
index 0000000..8333ee1
--- /dev/null
+++ b/package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch
@@ -0,0 +1,32 @@
+From 02283be90292b2f57183aa930c4d69375f1d905d Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 18 Jan 2017 13:17:21 +0100
+Subject: [PATCH 1/2] build-sys: use -lm for scriptreplay if necessary
+
+Reported-by: Bert van Hall <bert.vanhall@avionic-design.de>
+Addresses: https://github.com/karelzak/util-linux/pull/397
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit feda4342df1ced25df3d200ed23469e740196c86)
+
+Conflicts:
+ configure.ac
+---
+ term-utils/Makemodule.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/term-utils/Makemodule.am b/term-utils/Makemodule.am
+index 1b7c5fc..ad1bb1f 100644
+--- a/term-utils/Makemodule.am
++++ b/term-utils/Makemodule.am
+@@ -21,7 +21,7 @@ if BUILD_SCRIPTREPLAY
+ usrbin_exec_PROGRAMS += scriptreplay
+ dist_man_MANS += term-utils/scriptreplay.1
+ scriptreplay_SOURCES = term-utils/scriptreplay.c
+-scriptreplay_LDADD = $(LDADD) libcommon.la
++scriptreplay_LDADD = $(LDADD) libcommon.la $(MATH_LIBS)
+ endif # BUILD_SCRIPTREPLAY
+
+
+--
+2.7.4
+
diff --git a/package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch b/package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch
new file mode 100644
index 0000000..4f1bb23
--- /dev/null
+++ b/package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch
@@ -0,0 +1,37 @@
+From 064a0445f33a67e5498d492dabe0dfc687859756 Mon Sep 17 00:00:00 2001
+From: Carlos Santos <casantos@datacom.ind.br>
+Date: Wed, 8 Feb 2017 09:29:30 -0200
+Subject: [PATCH 2/2] build-sys: improve detection of the "isnan" function in
+ uClibc
+
+Since commit beceb14b450ded6560ed743634a5e80604a8edf3, MATH_LIBS is set
+to "-lm" when the isnan function is detected. In uClibc, however, isnan
+is a macro that calls __isnan, __isnanf, or __isnanl, depending on the
+size of the argument (double, float or long double).
+
+Fixes:
+ http://autobuild.buildroot.net/results/2c2/2c29a78ed81ca844a87dcd076ab3e14ea080296d/
+ http://autobuild.buildroot.net/results/404/404b10f359b2ae8a7216729fa1bab37fed2d3d4c/
+
+Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index cc0563b..d03469c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -428,7 +428,8 @@ AC_CHECK_FUNCS([reboot], [have_reboot=yes],[have_reboot=no])
+ AM_CONDITIONAL([HAVE_OPENAT], [test "x$have_openat" = xyes])
+
+ AC_CHECK_FUNCS([isnan], [],
+- [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])]
++ [AC_CHECK_LIB([m], [isnan], [MATH_LIBS="-lm"])]
++ [AC_CHECK_LIB([m], [__isnan], [MATH_LIBS="-lm"])]
+ )
+ AC_SUBST([MATH_LIBS])
+
+--
+2.7.4
+
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan)
2017-02-08 15:17 [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan) Carlos Santos
@ 2017-02-09 21:14 ` Thomas Petazzoni
2017-02-09 21:20 ` Carlos Santos
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-02-09 21:14 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 8 Feb 2017 13:17:43 -0200, Carlos Santos wrote:
> - Cherry-pick a patch from upstream to link scriptreplay to libm (for
> "isnam").
> - Add a patch that improves the detection of isnan when using uClibc.
> This patch is for util-linux v2.29.1 and must be adapted to their
> master branch to be submitted upstream.
>
> Fixes:
> http://autobuild.buildroot.net/results/2c2/2c29a78ed81ca844a87dcd076ab3e14ea080296d
> http://autobuild.buildroot.net/results/404/404b10f359b2ae8a7216729fa1bab37fed2d3d4c
>
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> ...-sys-use-lm-for-scriptreplay-if-necessary.patch | 32 +++++++++++++++++++
> ...mprove-detection-of-the-isnan-function-in.patch | 37 ++++++++++++++++++++++
> 2 files changed, 69 insertions(+)
> create mode 100644 package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch
> create mode 100644 package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch
Applied to master, thanks. To be honest I'm not sure PATCH 2/2 is the
most correct solution, but it's good enough. Could you submit it
upstream?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan)
2017-02-09 21:14 ` Thomas Petazzoni
@ 2017-02-09 21:20 ` Carlos Santos
2017-02-09 21:26 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Carlos Santos @ 2017-02-09 21:20 UTC (permalink / raw)
To: buildroot
> From: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org
> Sent: Thursday, February 9, 2017 7:14:44 PM
> Subject: Re: [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan)
> Hello,
>
> On Wed, 8 Feb 2017 13:17:43 -0200, Carlos Santos wrote:
>> - Cherry-pick a patch from upstream to link scriptreplay to libm (for
>> "isnam").
>> - Add a patch that improves the detection of isnan when using uClibc.
>> This patch is for util-linux v2.29.1 and must be adapted to their
>> master branch to be submitted upstream.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/2c2/2c29a78ed81ca844a87dcd076ab3e14ea080296d
>> http://autobuild.buildroot.net/results/404/404b10f359b2ae8a7216729fa1bab37fed2d3d4c
>>
>> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
>> ---
>> ...-sys-use-lm-for-scriptreplay-if-necessary.patch | 32 +++++++++++++++++++
>> ...mprove-detection-of-the-isnan-function-in.patch | 37 ++++++++++++++++++++++
>> 2 files changed, 69 insertions(+)
>> create mode 100644
>> package/util-linux/0001-build-sys-use-lm-for-scriptreplay-if-necessary.patch
>> create mode 100644
>> package/util-linux/0002-build-sys-improve-detection-of-the-isnan-function-in.patch
>
> Applied to master, thanks. To be honest I'm not sure PATCH 2/2 is the
> most correct solution, but it's good enough. Could you submit it
> upstream?
Patch 2/2 was accepted upstream. Quoting the maintainer (Karel Zak):
?Applied, thanks. (It would be possible to use AC_COMPILE_IFELSE() monster,
but if AC_CHECK_LIB() is good enough than it's probably better.)?
Carlos Santos (Casantos) - DATACOM, P&D
?Something must be done. This is something. Therefore we must do it.?
(from the BBC series ?Yes, Prime Minister?, ?Power to the people?)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan)
2017-02-09 21:20 ` Carlos Santos
@ 2017-02-09 21:26 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-02-09 21:26 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 9 Feb 2017 19:20:26 -0200 (BRST), Carlos Santos wrote:
> Patch 2/2 was accepted upstream. Quoting the maintainer (Karel Zak):
Great!
> ?Applied, thanks. (It would be possible to use AC_COMPILE_IFELSE() monster,
> but if AC_CHECK_LIB() is good enough than it's probably better.)?
Indeed, AC_COMPILE_IFELSE() would have been the alternative, but it's
admittedly a bit more complicated.
So if it's been merged upstream, we're good.
Thanks a lot!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-09 21:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 15:17 [Buildroot] [PATCH] util-linux: link scriptreplay with libm (for isnan) Carlos Santos
2017-02-09 21:14 ` Thomas Petazzoni
2017-02-09 21:20 ` Carlos Santos
2017-02-09 21:26 ` Thomas Petazzoni
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.