Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Paul Cercueil <paul@crapouillou.net>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2,1/1] package/libiio: fix sparc build
Date: Sun, 25 Sep 2022 19:22:19 +0200	[thread overview]
Message-ID: <20220925172219.GA1419013@scaer> (raw)
In-Reply-To: <20220925134647.577936-1-fontaine.fabrice@gmail.com>

Fabrice, All,

On 2022-09-25 15:46 +0200, Fabrice Fontaine spake thusly:
> Fix the following sparc build failure raised since bump to version 0.24
> in commit 9b5caa2ab45d7ec01e1657b10f94c2f60c7afe8e and
> https://github.com/analogdevicesinc/libiio/commit/2d3cae005f364742b3a9e7234d15b2fd2cbac664:
> 
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c: In function 'serial_configure':
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B2500000' undeclared (first use in this function); did you mean 'B1500000'?
>    99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
>       |                                                          ^
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:127:9: note: in expansion of macro 'CASE_BPS'
>   127 |         CASE_BPS(2500000, &tty_attrs);
>       |         ^~~~~~~~
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: note: each undeclared identifier is reported only once for each function it appears in
>    99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
>       |                                                          ^
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:127:9: note: in expansion of macro 'CASE_BPS'
>   127 |         CASE_BPS(2500000, &tty_attrs);
>       |         ^~~~~~~~
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B3000000' undeclared (first use in this function); did you mean 'B1000000'?
>    99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
>       |                                                          ^
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:128:9: note: in expansion of macro 'CASE_BPS'
>   128 |         CASE_BPS(3000000, &tty_attrs);
>       |         ^~~~~~~~
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B3500000' undeclared (first use in this function); did you mean 'B1500000'?
>    99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
>       |                                                          ^
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:129:9: note: in expansion of macro 'CASE_BPS'
>   129 |         CASE_BPS(3500000, &tty_attrs);
>       |         ^~~~~~~~
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B4000000' undeclared (first use in this function); did you mean 'B1000000'?
>    99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
>       |                                                          ^
> /home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:130:9: note: in expansion of macro 'CASE_BPS'
>   130 |         CASE_BPS(4000000, &tty_attrs);
>       |         ^~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/8a9902f6eddaab812ebce3506ed6de686f647e02
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Upstream aacepted your patch, so I did a proper backport, then applied
to master, thanks.

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v2 (after review of Yann E. Morin):
>  - Don't define values as they are explicitly not defined by kernel:
>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/sparc/include/uapi/asm/termbits.h#n157
> 
>  .../0001-iiod-serial.c-fix-sparc-build.patch  | 75 +++++++++++++++++++
>  1 file changed, 75 insertions(+)
>  create mode 100644 package/libiio/0001-iiod-serial.c-fix-sparc-build.patch
> 
> diff --git a/package/libiio/0001-iiod-serial.c-fix-sparc-build.patch b/package/libiio/0001-iiod-serial.c-fix-sparc-build.patch
> new file mode 100644
> index 0000000000..47a86cab48
> --- /dev/null
> +++ b/package/libiio/0001-iiod-serial.c-fix-sparc-build.patch
> @@ -0,0 +1,75 @@
> +From 0a325ceea8db7d57537dbdbe0c33a142b29ec5d7 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sun, 25 Sep 2022 11:19:18 +0200
> +Subject: [PATCH] iiod/serial.c: fix sparc build
> +
> +Fix the following sparc build failure raised since version 0.24 and
> +https://github.com/analogdevicesinc/libiio/commit/2d3cae005f364742b3a9e7234d15b2fd2cbac664:
> +
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c: In function 'serial_configure':
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B2500000' undeclared (first use in this function); did you mean 'B1500000'?
> +   99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
> +      |                                                          ^
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:127:9: note: in expansion of macro 'CASE_BPS'
> +  127 |         CASE_BPS(2500000, &tty_attrs);
> +      |         ^~~~~~~~
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: note: each undeclared identifier is reported only once for each function it appears in
> +   99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
> +      |                                                          ^
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:127:9: note: in expansion of macro 'CASE_BPS'
> +  127 |         CASE_BPS(2500000, &tty_attrs);
> +      |         ^~~~~~~~
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B3000000' undeclared (first use in this function); did you mean 'B1000000'?
> +   99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
> +      |                                                          ^
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:128:9: note: in expansion of macro 'CASE_BPS'
> +  128 |         CASE_BPS(3000000, &tty_attrs);
> +      |         ^~~~~~~~
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B3500000' undeclared (first use in this function); did you mean 'B1500000'?
> +   99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
> +      |                                                          ^
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:129:9: note: in expansion of macro 'CASE_BPS'
> +  129 |         CASE_BPS(3500000, &tty_attrs);
> +      |         ^~~~~~~~
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:99:58: error: 'B4000000' undeclared (first use in this function); did you mean 'B1000000'?
> +   99 | #define CASE_BPS(bps, attr) case bps: (attr)->c_cflag |= B##bps; break
> +      |                                                          ^
> +/home/buildroot/autobuild/instance-0/output-1/build/libiio-0.24/iiod/serial.c:130:9: note: in expansion of macro 'CASE_BPS'
> +  130 |         CASE_BPS(4000000, &tty_attrs);
> +      |         ^~~~~~~~
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/8a9902f6eddaab812ebce3506ed6de686f647e02
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: https://github.com/analogdevicesinc/libiio/pull/908]
> +---
> + iiod/serial.c | 8 ++++++++
> + 1 file changed, 8 insertions(+)
> +
> +diff --git a/iiod/serial.c b/iiod/serial.c
> +index f829361..b140d05 100644
> +--- a/iiod/serial.c
> ++++ b/iiod/serial.c
> +@@ -124,10 +124,18 @@ static int serial_configure(int fd, unsigned int uart_bps,
> + 	CASE_BPS(1152000, &tty_attrs);
> + 	CASE_BPS(1500000, &tty_attrs);
> + 	CASE_BPS(2000000, &tty_attrs);
> ++#ifdef B2500000 /* Not available on all architectures, i.e. sparc */
> + 	CASE_BPS(2500000, &tty_attrs);
> ++#endif
> ++#ifdef B3000000 /* Not available on all architectures, i.e. sparc */
> + 	CASE_BPS(3000000, &tty_attrs);
> ++#endif
> ++#ifdef B3500000 /* Not available on all architectures, i.e. sparc */
> + 	CASE_BPS(3500000, &tty_attrs);
> ++#endif
> ++#ifdef B4000000 /* Not available on all architectures, i.e. sparc */
> + 	CASE_BPS(4000000, &tty_attrs);
> ++#endif
> + 	default:
> + 		IIO_ERROR("Invalid baud rate\n");
> + 		return -EINVAL;
> +-- 
> +2.35.1
> +
> -- 
> 2.35.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2022-09-25 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 13:46 [Buildroot] [PATCH v2,1/1] package/libiio: fix sparc build Fabrice Fontaine
2022-09-25 17:22 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220925172219.GA1419013@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=paul@crapouillou.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox