All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0
@ 2022-09-25 15:24 Fabrice Fontaine
  2022-09-25 19:50 ` Yann E. MORIN
  2022-11-03 22:23 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2022-09-25 15:24 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine

Drop static from first patch to fix the following build failure with
gcc >= 11 and uclibc < 1.0.0 (prior to
https://github.com/wbx-github/uclibc-ng/commit/5c484467f718a25e94a88b11bdbb670ddb1c0d0f):

skinlcars.c:1105:12: error: 'int getloadavg(double*, int)' was declared 'extern' and later 'static' [-fpermissive]
 1105 | static int getloadavg (double loadavg[], int nelem)
      |            ^~~~~~~~~~
In file included from /home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/include/c++/11.3.0/cstdlib:75,
                 from /home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/include/c++/11.3.0/stdlib.h:36,
                 from config.h:15,
                 from channels.h:13,
                 from skins.h:13,
                 from skinlcars.h:13,
                 from skinlcars.c:26:
/home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/include/stdlib.h:920:12: note: previous declaration of 'int getloadavg(double*, int)'
  920 | extern int getloadavg (double __loadavg[], int __nelem)
      |            ^~~~~~~~~~

Fixes:
 - http://autobuild.buildroot.org/results/2d9fe8548ccbbcad3f86051509bf811fedb1d8e9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/vdr/0001-getloadavg.patch | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/vdr/0001-getloadavg.patch b/package/vdr/0001-getloadavg.patch
index 9e6316e284..fbb02d4dd1 100644
--- a/package/vdr/0001-getloadavg.patch
+++ b/package/vdr/0001-getloadavg.patch
@@ -4,6 +4,8 @@ Ported from
 https://github.com/stschake/buildroot-grasshopper/blob/master/package/torsmo/torsmo-0.18-uclibc-getloadavg.patch
 
 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+{Fabrice: drop static to fix build with gcc >= 11 and uclibc < 1.0.0]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 
 diff -uwNr vdr-2.3.1.org/skinlcars.c vdr-2.3.1/skinlcars.c
 --- vdr-2.3.1.org/skinlcars.c	2015-09-01 12:07:07.000000000 +0200
@@ -14,7 +16,7 @@ diff -uwNr vdr-2.3.1.org/skinlcars.c vdr-2.3.1/skinlcars.c
  
 +/* uclibc and dietlibc do not have this junk -ReneR */
 +#if defined (__UCLIBC__) || defined (__dietlibc__)
-+static int getloadavg (double loadavg[], int nelem)
++int getloadavg (double loadavg[], int nelem)
 +{
 +  int fd;
 +
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0
  2022-09-25 15:24 [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0 Fabrice Fontaine
@ 2022-09-25 19:50 ` Yann E. MORIN
  2022-11-03 22:23 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2022-09-25 19:50 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot

Fabrice, All,

On 2022-09-25 17:24 +0200, Fabrice Fontaine spake thusly:
> Drop static from first patch to fix the following build failure with
> gcc >= 11 and uclibc < 1.0.0 (prior to
> https://github.com/wbx-github/uclibc-ng/commit/5c484467f718a25e94a88b11bdbb670ddb1c0d0f):
[--SNIP--]
>  diff -uwNr vdr-2.3.1.org/skinlcars.c vdr-2.3.1/skinlcars.c
>  --- vdr-2.3.1.org/skinlcars.c	2015-09-01 12:07:07.000000000 +0200
> @@ -14,7 +16,7 @@ diff -uwNr vdr-2.3.1.org/skinlcars.c vdr-2.3.1/skinlcars.c
>   
>  +/* uclibc and dietlibc do not have this junk -ReneR */
>  +#if defined (__UCLIBC__) || defined (__dietlibc__)
> -+static int getloadavg (double loadavg[], int nelem)
> ++int getloadavg (double loadavg[], int nelem)

If you drop the static, the getlaodavag will come clashing with the one
defined in the C library: uClibc-ng does have a getloadavg since version
1.0.42, which we do have in Buildroot now.

So, what the patch should do, is really test whether getlaodavg is
available or not. But this is a generic-pacakge, so it's not going to be
trivial.

Regards,
Yann E. MORIN.

>  +{
>  +  int fd;
>  +
> -- 
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0
  2022-09-25 15:24 [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0 Fabrice Fontaine
  2022-09-25 19:50 ` Yann E. MORIN
@ 2022-11-03 22:23 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-03 22:23 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot

On Sun, 25 Sep 2022 17:24:52 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Drop static from first patch to fix the following build failure with
> gcc >= 11 and uclibc < 1.0.0 (prior to
> https://github.com/wbx-github/uclibc-ng/commit/5c484467f718a25e94a88b11bdbb670ddb1c0d0f):

This explanation can't be correct, because the build failure does not
occur with uclibc < 1.0.0. The build failure you're pointing to is
recent, so it was with a recent version of uclibc, as the build failure
configuration is using an internal toolchain. Or I'm missing something?

> 
> skinlcars.c:1105:12: error: 'int getloadavg(double*, int)' was declared 'extern' and later 'static' [-fpermissive]
>  1105 | static int getloadavg (double loadavg[], int nelem)
>       |            ^~~~~~~~~~
> In file included from /home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/include/c++/11.3.0/cstdlib:75,
>                  from /home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/include/c++/11.3.0/stdlib.h:36,
>                  from config.h:15,
>                  from channels.h:13,
>                  from skins.h:13,
>                  from skinlcars.h:13,
>                  from skinlcars.c:26:
> /home/buildroot/autobuild/run/instance-3/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/include/stdlib.h:920:12: note: previous declaration of 'int getloadavg(double*, int)'
>   920 | extern int getloadavg (double __loadavg[], int __nelem)
>       |            ^~~~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/2d9fe8548ccbbcad3f86051509bf811fedb1d8e9
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Also, Yann came up with some feedback. Have you had the chance to look
into it?

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-03 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25 15:24 [Buildroot] [PATCH 1/1] package/vdr: fix build with gcc >= 11 and uclibc < 1.0.0 Fabrice Fontaine
2022-09-25 19:50 ` Yann E. MORIN
2022-11-03 22:23 ` Thomas Petazzoni via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.