[Buildroot] [PATCH v2] package/lua-lunix: fix build with recent gcc

Yann E. MORIN yann.morin.1998 at free.fr
Sun Aug 1 19:24:47 UTC 2021


François, All,

On 2021-08-01 18:51 +0200, Francois Perrad spake thusly:
> Fixes: http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/
> Signed-off-by: Francois Perrad <francois.perrad at gadz.org>
> ---
>  ...ctl-instead-of-deprecated-sys-sysctl.patch | 31 +++++++++++++++++++
>  1 file changed, 31 insertions(+)
>  create mode 100644 package/lua-lunix/0003-use-linux-sysctl-instead-of-deprecated-sys-sysctl.patch
> 
> diff --git a/package/lua-lunix/0003-use-linux-sysctl-instead-of-deprecated-sys-sysctl.patch b/package/lua-lunix/0003-use-linux-sysctl-instead-of-deprecated-sys-sysctl.patch
> new file mode 100644
> index 000000000..7a904884d
> --- /dev/null
> +++ b/package/lua-lunix/0003-use-linux-sysctl-instead-of-deprecated-sys-sysctl.patch
> @@ -0,0 +1,31 @@
> +From 99b02b08d3f1a53e58b558b9f2250225e569a550 Mon Sep 17 00:00:00 2001
> +From: Tiago Seco <tiago at seco.ws>
> +Date: Sun, 20 Jun 2021 11:20:23 +0200
> +Subject: [PATCH] use <linux/sysctl.h> instead of deprectaed <sys/sysctl.h> for
> + linux systems
> +
> +Fetched from https://github.com/wahern/lunix/pull/18
> +Signed-off-by: Francois Perrad <francois.perrad at gadz.org>
> +---
> + lunix-rel-20170920/src/unix.c | 6 +++++-
> + 1 file changed, 5 insertions(+), 1 deletion(-)
> +
> +diff --git a/lunix-rel-20170920/src/unix.c b/lunix-rel-20170920/src/unix.c
> +index bea4d14..dfa26a3 100644
> +--- a/lunix-rel-20170920/src/unix.c
> ++++ b/lunix-rel-20170920/src/unix.c
> +@@ -560,7 +560,11 @@
> + #endif
> + 
> + #if HAVE_SYS_SYSCTL_H
> +-#include <sys/sysctl.h> /* CTL_KERN KERN_RANDOM RANDOM_UUID sysctl(2) */
> ++#ifdef __linux__
> ++#include <linux/sysctl.h> /* CTL_KERN KERN_RANDOM RANDOM_UUID sysctl(2) */
> ++#else
> ++#include <sys/sysctl.h>
> ++#endif

I don't think this is a correct fix.

Indeed, the sysctl() syscall has been entirely removed in kernel 5.5,
but lunix still uses it.

Also, switching to including linux/sysctl.h will not bring a definition
for sysctl() either.

I've added comment with some background, to the upstream pull request:

    https://github.com/wahern/lunix/pull/18#issuecomment-890572520

It is my understanding that lunix will have to change somehow, and not
just change the included header...

Regards,
Yann E. MORIN.

> + #endif
> + 
> + #if HAVE_IFADDRS_H
> +-- 
> +2.30.2
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/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.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list