Message ID | 20210804134635.262095-1-francois.perrad@gadz.org |
---|---|
State | Superseded |
Headers | show |
Series | [v3,1/2] package/lua-lunix: fix build with recent gcc | expand |
On 04/08/2021 15:46, Francois Perrad wrote: > Fixes: http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ > Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > --- > package/lua-lunix/0003-force-no-sysctl.patch | 32 ++++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 package/lua-lunix/0003-force-no-sysctl.patch > > diff --git a/package/lua-lunix/0003-force-no-sysctl.patch b/package/lua-lunix/0003-force-no-sysctl.patch > new file mode 100644 > index 000000000..3467e2713 > --- /dev/null > +++ b/package/lua-lunix/0003-force-no-sysctl.patch > @@ -0,0 +1,32 @@ > +From d9b65e306478f5d2356ef90eab8191984534238a Mon Sep 17 00:00:00 2001 > +From: Francois Perrad <francois.perrad@gadz.org> > +Date: Wed, 4 Aug 2021 15:27:05 +0200 > +Subject: [PATCH] force no sysctl > + > +Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > +--- > + lunix-rel-20170920/lunix-20170920-1.rockspec | 9 +++++++++ > + 1 file changed, 9 insertions(+) > + > +diff --git a/lunix-rel-20170920/lunix-20170920-1.rockspec b/lunix-rel-20170920/lunix-20170920-1.rockspec > +index 76cafeb..e42fd34 100644 > +--- a/lunix-rel-20170920/lunix-20170920-1.rockspec > ++++ b/lunix-rel-20170920/lunix-20170920-1.rockspec > +@@ -35,5 +35,14 @@ build = { > + }; > + }; > + }; > ++ linux = { > ++ modules = { > ++ ["unix"] = { > ++ defines = {nil, nil, nil; > ++ "HAVE_SYS_SYSCTL_H=0"; That's a really dirty way of setting a define... Unless this patch is accepted upstream (unlikely, given that there was no maintainer activity on [1] since more than a month), a much better way IMHO is to set it from the .mk file: LUA_LUNIX_BUILD_OPTS = CFLAGS="$(TARGET_CFLAGS) -DHAVE_SYS_SYSCTL_H=0" (This may not work though, depending on the order of the flags added by luarocks.) Regards, Arnout > ++ }; > ++ }; > ++ }; > ++ }; > + }; > + } > +-- > +2.30.2 > + >
François, All, The commit title is wrong: as I explained in the upstream PR, the problem is not with "recent gcc". The header of concern is from the C library, so it is missign from recent glibc versions. And eventually, the sysctl syscall is missing in recent kernel versions. Nothing to do with recent gcc versions. On 2021-08-04 15:46 +0200, Francois Perrad spake thusly: > Fixes: http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ > Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > --- > package/lua-lunix/0003-force-no-sysctl.patch | 32 ++++++++++++++++++++ > 1 file changed, 32 insertions(+) > create mode 100644 package/lua-lunix/0003-force-no-sysctl.patch > > diff --git a/package/lua-lunix/0003-force-no-sysctl.patch b/package/lua-lunix/0003-force-no-sysctl.patch > new file mode 100644 > index 000000000..3467e2713 > --- /dev/null > +++ b/package/lua-lunix/0003-force-no-sysctl.patch > @@ -0,0 +1,32 @@ > +From d9b65e306478f5d2356ef90eab8191984534238a Mon Sep 17 00:00:00 2001 > +From: Francois Perrad <francois.perrad@gadz.org> > +Date: Wed, 4 Aug 2021 15:27:05 +0200 > +Subject: [PATCH] force no sysctl > + > +Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > +--- > + lunix-rel-20170920/lunix-20170920-1.rockspec | 9 +++++++++ > + 1 file changed, 9 insertions(+) > + > +diff --git a/lunix-rel-20170920/lunix-20170920-1.rockspec b/lunix-rel-20170920/lunix-20170920-1.rockspec > +index 76cafeb..e42fd34 100644 > +--- a/lunix-rel-20170920/lunix-20170920-1.rockspec > ++++ b/lunix-rel-20170920/lunix-20170920-1.rockspec > +@@ -35,5 +35,14 @@ build = { > + }; > + }; > + }; > ++ linux = { > ++ modules = { > ++ ["unix"] = { > ++ defines = {nil, nil, nil; > ++ "HAVE_SYS_SYSCTL_H=0"; Icky... :-( Regards, Yann E. MORIN. > ++ }; > ++ }; > ++ }; > ++ }; > + }; > + } > +-- > +2.30.2 > + > -- > 2.30.2 > > _______________________________________________ > buildroot mailing list > buildroot@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot
Le jeu. 5 août 2021 à 19:05, Arnout Vandecappelle <arnout@mind.be> a écrit : > > > On 04/08/2021 15:46, Francois Perrad wrote: > > Fixes: > http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ > > Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > > --- > > package/lua-lunix/0003-force-no-sysctl.patch | 32 ++++++++++++++++++++ > > 1 file changed, 32 insertions(+) > > create mode 100644 package/lua-lunix/0003-force-no-sysctl.patch > > > > diff --git a/package/lua-lunix/0003-force-no-sysctl.patch > b/package/lua-lunix/0003-force-no-sysctl.patch > > new file mode 100644 > > index 000000000..3467e2713 > > --- /dev/null > > +++ b/package/lua-lunix/0003-force-no-sysctl.patch > > @@ -0,0 +1,32 @@ > > +From d9b65e306478f5d2356ef90eab8191984534238a Mon Sep 17 00:00:00 2001 > > +From: Francois Perrad <francois.perrad@gadz.org> > > +Date: Wed, 4 Aug 2021 15:27:05 +0200 > > +Subject: [PATCH] force no sysctl > > + > > +Signed-off-by: Francois Perrad <francois.perrad@gadz.org> > > +--- > > + lunix-rel-20170920/lunix-20170920-1.rockspec | 9 +++++++++ > > + 1 file changed, 9 insertions(+) > > + > > +diff --git a/lunix-rel-20170920/lunix-20170920-1.rockspec > b/lunix-rel-20170920/lunix-20170920-1.rockspec > > +index 76cafeb..e42fd34 100644 > > +--- a/lunix-rel-20170920/lunix-20170920-1.rockspec > > ++++ b/lunix-rel-20170920/lunix-20170920-1.rockspec > > +@@ -35,5 +35,14 @@ build = { > > + }; > > + }; > > + }; > > ++ linux = { > > ++ modules = { > > ++ ["unix"] = { > > ++ defines = {nil, nil, nil; > > ++ "HAVE_SYS_SYSCTL_H=0"; > > That's a really dirty way of setting a define... > > Unless this patch is accepted upstream (unlikely, given that there was no > maintainer activity on [1] since more than a month), a much better way > IMHO is > to set it from the .mk file: > > LUA_LUNIX_BUILD_OPTS = CFLAGS="$(TARGET_CFLAGS) -DHAVE_SYS_SYSCTL_H=0" > > It looks elegant but it doesn't work, because CFLAGS is already set in pkg-luarocks.mk The file lunix-20170920-1.rockspec is not a part of the upstream project ( https://25thandclement.com/~william/projects/releases/lunix-20170920.tgz or https://github.com/wahern/lunix). It was created by the author of Luarocks package, it is only available on https://luarocks.org/modules/daurnimator/lunix So, my patch cannot be upstreamed, but it is currently the only way to do. François > (This may not work though, depending on the order of the flags added by > luarocks.) > > > Regards, > Arnout > > > ++ }; > > ++ }; > > ++ }; > > ++ }; > > + }; > > + } > > +-- > > +2.30.2 > > + > > > _______________________________________________ > buildroot mailing list > buildroot@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot >
François, All, On 2021-08-07 10:55 +0200, François Perrad spake thusly: > Le jeu. 5 août 2021 à 19:05, Arnout Vandecappelle < [1]arnout@mind.be> a écrit : [--SNIP--] > Unless this patch is accepted upstream (unlikely, given that there was no > maintainer activity on [1] since more than a month), a much better way IMHO is > to set it from the .mk file: > > LUA_LUNIX_BUILD_OPTS = CFLAGS="$(TARGET_CFLAGS) -DHAVE_SYS_SYSCTL_H=0" > > It looks elegant but it doesn't work, because CFLAGS is already set in [6]pkg-luarocks.mk I would argue that lua packages should have a way to provide their own CFLAGS that would be able to override settng, probably something like: diff --git a/package/pkg-luarocks.mk b/package/pkg-luarocks.mk index fd79855878..4230783af0 100644 --- a/package/pkg-luarocks.mk +++ b/package/pkg-luarocks.mk @@ -117,7 +117,7 @@ define $(2)_INSTALL_TARGET_CMDS LUA_LIBDIR="$$(STAGING_DIR)/usr/lib" \ CC=$$(TARGET_CC) \ LD=$$(TARGET_CC) \ - CFLAGS="$$(LUAROCKS_CFLAGS)" \ + CFLAGS="$$(LUAROCKS_CFLAGS) $$($(2)_LUAROCKS_CFLAGS)" \ LIBFLAG="-shared $$(TARGET_LDFLAGS)" \ $$($(2)_BUILD_OPTS) $$($(2)_ROCKSPEC) endef Could you please have a look into this? Regards, Yann E. MORIN. > The file lunix-20170920-1.rockspec is not a part of the upstream project ( > [7]https://25thandclement.com/~william/projects/releases/lunix-20170920.tgz or [8]https://github.com/wahern/lunix). > It was created by the author of Luarocks package, it is only available on [9]https://luarocks.org/modules/daurnimator/lunix > So, my patch cannot be upstreamed, but it is currently the only way to do. > > François > > > (This may not work though, depending on the order of the flags added by luarocks.) > > Regards, > Arnout > > > ++ > }; > > ++ }; > > ++ }; > > ++ }; > > + }; > > + } > > +-- > > +2.30.2 > > + > > > _______________________________________________ > buildroot mailing list > [10]buildroot@busybox.net > [11]http://lists.busybox.net/mailman/listinfo/buildroot > > Links: > 1. mailto:arnout@mind.be > 2. http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ > 3. mailto:francois.perrad@gadz.org > 4. mailto:francois.perrad@gadz.org > 5. mailto:francois.perrad@gadz.org > 6. http://pkg-luarocks.mk > 7. https://25thandclement.com/~william/projects/releases/lunix-20170920.tgz > 8. https://github.com/wahern/lunix > 9. https://luarocks.org/modules/daurnimator/lunix > 10. mailto:buildroot@busybox.net > 11. http://lists.busybox.net/mailman/listinfo/buildroot > _______________________________________________ > buildroot mailing list > buildroot@busybox.net > http://lists.busybox.net/mailman/listinfo/buildroot
Le sam. 7 août 2021 à 11:13, Yann E. MORIN <yann.morin.1998@free.fr> a écrit : > François, All, > > On 2021-08-07 10:55 +0200, François Perrad spake thusly: > > Le jeu. 5 août 2021 à 19:05, Arnout Vandecappelle < [1]arnout@mind.be> > a écrit : > [--SNIP--] > > Unless this patch is accepted upstream (unlikely, given that there > was no > > maintainer activity on [1] since more than a month), a much better way > IMHO is > > to set it from the .mk file: > > > > LUA_LUNIX_BUILD_OPTS = CFLAGS="$(TARGET_CFLAGS) -DHAVE_SYS_SYSCTL_H=0" > > > > It looks elegant but it doesn't work, because CFLAGS is already set in > [6]pkg-luarocks.mk > > I would argue that lua packages should have a way to provide their own > CFLAGS that would be able to override settng, probably something like: > > diff --git a/package/pkg-luarocks.mk b/package/pkg-luarocks.mk > index fd79855878..4230783af0 100644 > --- a/package/pkg-luarocks.mk > +++ b/package/pkg-luarocks.mk > @@ -117,7 +117,7 @@ define $(2)_INSTALL_TARGET_CMDS > LUA_LIBDIR="$$(STAGING_DIR)/usr/lib" \ > CC=$$(TARGET_CC) \ > LD=$$(TARGET_CC) \ > - CFLAGS="$$(LUAROCKS_CFLAGS)" \ > + CFLAGS="$$(LUAROCKS_CFLAGS) > $$($(2)_LUAROCKS_CFLAGS)" \ > LIBFLAG="-shared $$(TARGET_LDFLAGS)" \ > $$($(2)_BUILD_OPTS) $$($(2)_ROCKSPEC) > endef > > Could you please have a look into this? > > I don't like this idea. Finally, I push this : https://github.com/wahern/lunix/pull/20/files François > Regards, > Yann E. MORIN. > > > The file lunix-20170920-1.rockspec is not a part of the upstream project > ( > > [7] > https://25thandclement.com/~william/projects/releases/lunix-20170920.tgz > or [8]https://github.com/wahern/lunix). > > It was created by the author of Luarocks package, it is only available > on [9]https://luarocks.org/modules/daurnimator/lunix > > So, my patch cannot be upstreamed, but it is currently the only way to > do. > > > > François > > > > > > (This may not work though, depending on the order of the flags added > by luarocks.) > > > > Regards, > > Arnout > > > > > ++ > > }; > > > ++ }; > > > ++ }; > > > ++ }; > > > + }; > > > + } > > > +-- > > > +2.30.2 > > > + > > > > > _______________________________________________ > > buildroot mailing list > > [10]buildroot@busybox.net > > [11]http://lists.busybox.net/mailman/listinfo/buildroot > > > > Links: > > 1. mailto:arnout@mind.be > > 2. > http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ > > 3. mailto:francois.perrad@gadz.org > > 4. mailto:francois.perrad@gadz.org > > 5. mailto:francois.perrad@gadz.org > > 6. http://pkg-luarocks.mk > > 7. > https://25thandclement.com/~william/projects/releases/lunix-20170920.tgz > > 8. https://github.com/wahern/lunix > > 9. https://luarocks.org/modules/daurnimator/lunix > > 10. mailto:buildroot@busybox.net > > 11. http://lists.busybox.net/mailman/listinfo/buildroot > > > _______________________________________________ > > buildroot mailing list > > buildroot@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. | > > '------------------------------^-------^------------------^--------------------' >
diff --git a/package/lua-lunix/0003-force-no-sysctl.patch b/package/lua-lunix/0003-force-no-sysctl.patch new file mode 100644 index 000000000..3467e2713 --- /dev/null +++ b/package/lua-lunix/0003-force-no-sysctl.patch @@ -0,0 +1,32 @@ +From d9b65e306478f5d2356ef90eab8191984534238a Mon Sep 17 00:00:00 2001 +From: Francois Perrad <francois.perrad@gadz.org> +Date: Wed, 4 Aug 2021 15:27:05 +0200 +Subject: [PATCH] force no sysctl + +Signed-off-by: Francois Perrad <francois.perrad@gadz.org> +--- + lunix-rel-20170920/lunix-20170920-1.rockspec | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/lunix-rel-20170920/lunix-20170920-1.rockspec b/lunix-rel-20170920/lunix-20170920-1.rockspec +index 76cafeb..e42fd34 100644 +--- a/lunix-rel-20170920/lunix-20170920-1.rockspec ++++ b/lunix-rel-20170920/lunix-20170920-1.rockspec +@@ -35,5 +35,14 @@ build = { + }; + }; + }; ++ linux = { ++ modules = { ++ ["unix"] = { ++ defines = {nil, nil, nil; ++ "HAVE_SYS_SYSCTL_H=0"; ++ }; ++ }; ++ }; ++ }; + }; + } +-- +2.30.2 +
Fixes: http://autobuild.buildroot.net/results/749a11d5289c6fec3b2f236b9073fc1ab730d090/ Signed-off-by: Francois Perrad <francois.perrad@gadz.org> --- package/lua-lunix/0003-force-no-sysctl.patch | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/lua-lunix/0003-force-no-sysctl.patch