diff mbox series

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

Message ID 20210801165107.3294045-1-francois.perrad@gadz.org
State Changes Requested
Headers show
Series [v2] package/lua-lunix: fix build with recent gcc | expand

Commit Message

Francois Perrad Aug. 1, 2021, 4:51 p.m. UTC
Fixes: http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/
Signed-off-by: Francois Perrad <francois.perrad@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

Comments

Yann E. MORIN Aug. 1, 2021, 7:24 p.m. UTC | #1
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@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@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@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@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
diff mbox series

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@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@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
+ #endif
+ 
+ #if HAVE_IFADDRS_H
+-- 
+2.30.2