[Buildroot] [PATCH v1] package/olsr: add upstream patch to fix compile with gpsd-3.23.1

Peter Seiderer ps.report at gmx.net
Sat Nov 6 18:22:48 UTC 2021


Hello Fabrice,

On Sat, 6 Nov 2021 16:15:24 +0100, Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:

> Le sam. 6 nov. 2021 à 15:09, Fabrice Fontaine
> <fontaine.fabrice at gmail.com> a écrit :
> >
> > Hi,
> >
> > Le sam. 6 nov. 2021 à 12:28, Peter Seiderer <ps.report at gmx.net> a écrit :  
> > >
> > > - add upstream patch ([1]) to fix compile with gpsd-3.23.1
> > >
> > > Fixes:
> > >
> > >   - http://autobuild.buildroot.org/results/53b06e72fb2d8b4c8b6ba41baf775ff33654cd18
> > >   - http://autobuild.buildroot.net/results/54cae924711e26f04045f8208db0d772292a3933
> > >
> > >   src/gpsdclient.c: In function 'nmeaInfoFromGpsd':
> > >   src/gpsdclient.c:374:30: error: 'STATUS_NO_FIX' undeclared (first use in this function); did you mean 'STATUS_PPS_FIX'?
> > >     374 |   if (gpsdata->fix.status == STATUS_NO_FIX) {
> > >         |                              ^~~~~~~~~~~~~
> > >         |                              STATUS_PPS_FIX
> > >
> > > [1] https://github.com/OLSR/olsrd/commit/69ae23be9f96b9e7dd68a0252f3ad05986bb222d
> > >
> > > Signed-off-by: Peter Seiderer <ps.report at gmx.net>
> > > ---
> > > Notes:
> > >
> > >   - @Fabrice: did not find a corresponding buildroot patch from you,
> > >      did you sent one and I missed it?  
> > Nope, I didn't send a patch as I wasn't sure that this commit was
> > correct after all: https://github.com/OLSR/olsrd/pull/107
> > Indeed, from my understanding of the gpsd maintainer, this commit will
> > fix the build failure but the code before and after this patch is
> > broken.
> > A better approach would be to use gpsdata->fix.mode instead of
> > gpsdata->fix.status:
> > https://github.com/swri-robotics/gps_umd/issues/50.
> > I'll send a PR to get feedback from upstream.  
> Patch has been merged upstream:
> https://github.com/OLSR/olsrd/commit/665051a845464c0f95edb81432104dac39426f79
> Feel free to send a v2.

Done:

	https://patchwork.ozlabs.org/project/buildroot/patch/20211106180942.27850-1-ps.report@gmx.net/

Thanks for providing the upstream patch and discussion ;-)

Regards,
Peter

> > > ---
> > >  .../0005-pud-fix-build-with-gpsd-3.23.1.patch | 44 +++++++++++++++++++
> > >  1 file changed, 44 insertions(+)
> > >  create mode 100644 package/olsr/0005-pud-fix-build-with-gpsd-3.23.1.patch
> > >
> > > diff --git a/package/olsr/0005-pud-fix-build-with-gpsd-3.23.1.patch b/package/olsr/0005-pud-fix-build-with-gpsd-3.23.1.patch
> > > new file mode 100644
> > > index 0000000000..a8d53482b9
> > > --- /dev/null
> > > +++ b/package/olsr/0005-pud-fix-build-with-gpsd-3.23.1.patch
> > > @@ -0,0 +1,44 @@
> > > +From 69ae23be9f96b9e7dd68a0252f3ad05986bb222d Mon Sep 17 00:00:00 2001
> > > +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > > +Date: Sun, 24 Oct 2021 23:22:11 +0200
> > > +Subject: [PATCH] pud: fix build with gpsd >= 3.23.1
> > > +
> > > +Fix the following build failure raised with gpsd >= 3.23.1 and
> > > +https://gitlab.com/gpsd/gpsd/-/commit/d4a4d8d3606fd50f10bcd20096a8a0cdb8b2d427:
> > > +
> > > +src/gpsdclient.c: In function 'nmeaInfoFromGpsd':
> > > +src/gpsdclient.c:374:30: error: 'STATUS_NO_FIX' undeclared (first use in this function); did you mean 'STATUS_PPS_FIX'?
> > > +  374 |   if (gpsdata->fix.status == STATUS_NO_FIX) {
> > > +      |                              ^~~~~~~~~~~~~
> > > +      |                              STATUS_PPS_FIX
> > > +
> > > +Fixes:
> > > + - http://autobuild.buildroot.org/results/53b06e72fb2d8b4c8b6ba41baf775ff33654cd18
> > > +
> > > +[Fixed-Commit-Message by: Nick Hainke <vincent at systemli.org>]
> > > +
> > > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > > +[Upstream: https://github.com/OLSR/olsrd/commit/69ae23be9f96b9e7dd68a0252f3ad05986bb222d]
> > > +Signed-off-by: Peter Seiderer <ps.report at gmx.net>
> > > +---
> > > + lib/pud/src/gpsdclient.c | 4 +++-
> > > + 1 file changed, 3 insertions(+), 1 deletion(-)
> > > +
> > > +diff --git a/lib/pud/src/gpsdclient.c b/lib/pud/src/gpsdclient.c
> > > +index a2a9cee0..9c98f4df 100644
> > > +--- a/lib/pud/src/gpsdclient.c
> > > ++++ b/lib/pud/src/gpsdclient.c
> > > +@@ -370,7 +370,9 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
> > > +           );
> > > +
> > > +   gpsdata->set &= ~STATUS_SET; /* always valid */
> > > +-  #if GPSD_API_MAJOR_VERSION >= 10
> > > ++  #if GPSD_API_MAJOR_VERSION >= 12
> > > ++  if (gpsdata->fix.status == STATUS_UNK) {
> > > ++  #elif GPSD_API_MAJOR_VERSION >= 10
> > > +   if (gpsdata->fix.status == STATUS_NO_FIX) {
> > > +   #else
> > > +   if (gpsdata->status == STATUS_NO_FIX) {
> > > +--
> > > +2.33.1
> > > +
> > > --
> > > 2.33.1
> > >  
> > Best Regards,
> >
> > Fabrice  
> Best Regards,
> 
> Fabrice
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot



More information about the buildroot mailing list