Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Patch gpsd-2.95 for avr32
@ 2012-04-11 10:27 spdawson at gmail.com
  2012-04-11 10:40 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: spdawson at gmail.com @ 2012-04-11 10:27 UTC (permalink / raw)
  To: buildroot

gpsd does not compile for avr32, due to use of finite() rather than
isfinite(). See, for example, random buildroot test
build b7c357dddd7c1f749813035ddbee731d233c59b8

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 package/gpsd/gpsd-2.95-c99-math.patch.avr32 |   53 +++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)
 create mode 100644 package/gpsd/gpsd-2.95-c99-math.patch.avr32

diff --git a/package/gpsd/gpsd-2.95-c99-math.patch.avr32 b/package/gpsd/gpsd-2.95-c99-math.patch.avr32
new file mode 100644
index 0000000..54161d5
--- /dev/null
+++ b/package/gpsd/gpsd-2.95-c99-math.patch.avr32
@@ -0,0 +1,53 @@
+Replace calls to finite() with calls to isfinite(), so that gpsd-2.95 will
+compile for avr32.
+
+N.B. It will not be necessary to patch later releases of gpsd, where the
+finite() -> isfinite() replacement has already been made.
+
+Signed-off-by: Simon Dawson <spdawson@gmail.com>
+---
+
+diff -Nur a/libgpsd_core.c b/libgpsd_core.c
+--- a/libgpsd_core.c	2010-06-11 20:45:37.000000000 +0100
++++ b/libgpsd_core.c	2012-04-11 11:09:42.154508993 +0100
+@@ -545,18 +545,18 @@
+     gpsd_report(LOG_DATA, "modeling errors: mode=%d, masks=%s\n",
+ 		fix->mode, gpsd_maskdump(session->gpsdata.set));
+     if (fix->mode >= MODE_2D) {
+-	if (isnan(fix->epx) != 0 && finite(session->gpsdata.dop.hdop) != 0)
++	if (isnan(fix->epx) != 0 && isfinite(session->gpsdata.dop.hdop) != 0)
+ 	    fix->epx = session->gpsdata.dop.xdop * h_uere;
+ 
+-	if (isnan(fix->epy) != 0 && finite(session->gpsdata.dop.hdop) != 0)
++	if (isnan(fix->epy) != 0 && isfinite(session->gpsdata.dop.hdop) != 0)
+ 	    fix->epy = session->gpsdata.dop.ydop * h_uere;
+ 
+ 	if ((fix->mode >= MODE_3D)
+-	    && isnan(fix->epv) != 0 && finite(session->gpsdata.dop.vdop) != 0)
++	    && isnan(fix->epv) != 0 && isfinite(session->gpsdata.dop.vdop) != 0)
+ 	    fix->epv = session->gpsdata.dop.vdop * v_uere;
+ 
+ 	if (isnan(session->gpsdata.epe) != 0
+-	    && finite(session->gpsdata.dop.pdop) != 0)
++	    && isfinite(session->gpsdata.dop.pdop) != 0)
+ 	    session->gpsdata.epe = session->gpsdata.dop.pdop * p_uere;
+ 	else
+ 	    session->gpsdata.epe = NAN;
+diff -Nur a/pseudonmea.c b/pseudonmea.c
+--- a/pseudonmea.c	2010-06-02 22:03:02.000000000 +0100
++++ b/pseudonmea.c	2012-04-11 11:09:58.686508257 +0100
+@@ -215,10 +215,10 @@
+ 	nmea_add_checksum(bufp2);
+ 	bufp += strlen(bufp);
+     }
+-    if (finite(session->gpsdata.fix.epx)
+-	&& finite(session->gpsdata.fix.epy)
+-	&& finite(session->gpsdata.fix.epv)
+-	&& finite(session->gpsdata.epe)) {
++    if (isfinite(session->gpsdata.fix.epx)
++	&& isfinite(session->gpsdata.fix.epy)
++	&& isfinite(session->gpsdata.fix.epv)
++	&& isfinite(session->gpsdata.epe)) {
+ 	struct tm tm;
+ 	time_t intfixtime;
+ 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Patch gpsd-2.95 for avr32
  2012-04-11 10:27 [Buildroot] [PATCH] Patch gpsd-2.95 for avr32 spdawson at gmail.com
@ 2012-04-11 10:40 ` Thomas Petazzoni
  2012-04-11 11:26   ` Simon Dawson
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2012-04-11 10:40 UTC (permalink / raw)
  To: buildroot

Hello,

Le Wed, 11 Apr 2012 11:27:11 +0100,
spdawson at gmail.com a ?crit :

> gpsd does not compile for avr32, due to use of finite() rather than
> isfinite(). See, for example, random buildroot test
> build b7c357dddd7c1f749813035ddbee731d233c59b8

Thanks Simon. I haven't investigated this particular problem. Do you
know why it would be avr32-specific?

Moreover, gpsd 2.95 is quite ancient, the latest version is 3.4, and it
has this problem fixed (see
http://git.savannah.gnu.org/cgit/gpsd.git/commit/pseudonmea.c?id=3b00bd2e71d277283062ed83078de9741a4a8b98).
However, it looks like gpsd is now using Scons as its builds system, so
bumping to 3.4 will require quite a bit of work on gpsd.mk.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Patch gpsd-2.95 for avr32
  2012-04-11 10:40 ` Thomas Petazzoni
@ 2012-04-11 11:26   ` Simon Dawson
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Dawson @ 2012-04-11 11:26 UTC (permalink / raw)
  To: buildroot

> Thanks Simon. I haven't investigated this particular problem. Do you
> know why it would be avr32-specific?

No, I don't know why the problem should be avr32-specific. (The
package builds for arm without the patch, incidentally.)

> Moreover, gpsd 2.95 is quite ancient, the latest version is 3.4, and it
> has this problem fixed (see
> http://git.savannah.gnu.org/cgit/gpsd.git/commit/pseudonmea.c?id=3b00bd2e71d277283062ed83078de9741a4a8b98).
> However, it looks like gpsd is now using Scons as its builds system, so
> bumping to 3.4 will require quite a bit of work on gpsd.mk.

Yes, I realised that it would be non-trivial to just bump the gpsd
version in buildroot. Is the avr32 patch therefore an acceptable
short-term solution to the build problem?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-11 11:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11 10:27 [Buildroot] [PATCH] Patch gpsd-2.95 for avr32 spdawson at gmail.com
2012-04-11 10:40 ` Thomas Petazzoni
2012-04-11 11:26   ` Simon Dawson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox