Re: PATCH: v4l-utils/utils/ir-ctl/irc-ctl.c: fix musl build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Francesco,

On Mon, Feb 20, 2017 at 12:33:14PM +0100, Francesco wrote:
> This is my fist attempt to send a patch for v4l-utils project.
> I maintain v4l-utils package for Alpine Linux (www.alpinelinux.org), a
> musl-based distro.
> 
> This patch allows the build for v4l-utils by allowing alternatives to GLIBC
> assumptions.
> 
> Thanks for considering.

> From 71f399cb1399c35ff4ce165c2cec0fcd3256d34e Mon Sep 17 00:00:00 2001
> From: Francesco Colista <fcolista@xxxxxxxxxxxxx>
> Date: Mon, 20 Feb 2017 10:16:01 +0100
> Subject: [PATCH] utils/ir-ctl/ir-ctl.c: fix build with musl library
> 
> This patch allows to build correctly v4l-utils on musl-based distributions.
> It provides alternative to glibc assumptions.
> ---
>  utils/ir-ctl/ir-ctl.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/utils/ir-ctl/ir-ctl.c b/utils/ir-ctl/ir-ctl.c
> index bc58cee0..0bd0ddcc 100644
> --- a/utils/ir-ctl/ir-ctl.c
> +++ b/utils/ir-ctl/ir-ctl.c
> @@ -42,6 +42,20 @@
>  # define _(string) string
>  #endif
>  
> +#if !defined(__GLIBC__)

This might break other libc implementations. Instead, do

  #ifndef TEMP_FAILURE_RETRY

See 
https://git.busybox.net/buildroot/tree/package/libv4l/0002-ir-ctl-fixes-for-musl-compile.patch

> +
> +/* Evaluate EXPRESSION, and repeat as long as it returns -1 with `errno'
> +   set to EINTR.  */
> +
> +# define TEMP_FAILURE_RETRY(expression) \
> +  (__extension__                                                              \
> +    ({ long int __result;                                                     \
> +       do __result = (long int) (expression);                                 \
> +       while (__result == -1L && errno == EINTR);                             \
> +       __result; }))
> +
> +#endif
> +
>  # define N_(string) string

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@xxxxxxxxxx - tel: +972.52.368.4656, http://www.tkos.co.il -



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux