diff mbox series

sbc: Fix for gcc 15 compile error

Message ID 20250521162632.27169-1-reatmon@ti.com
State Accepted, archived
Commit 2dc0664e966cd8d4c99798cc997c192785773e31
Headers show
Series sbc: Fix for gcc 15 compile error | expand

Commit Message

Ryan Eatmon May 21, 2025, 4:26 p.m. UTC
With the move to gcc 15, the code is not generating a compile error.

../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
   error: too many arguments to function 'sbc_analyze_eight_armv6';
      expected 0, have 3

Simple fix is to drop the C standard down to gnu17 to avoid this new
error.

Signed-off-by: Ryan Eatmon <reatmon@ti.com>
---
 meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Randy MacLeod May 21, 2025, 4:55 p.m. UTC | #1
Hi Ryan,

On 2025-05-21 12:26 p.m., Ryan Eatmon via lists.openembedded.org wrote:
> With the move to gcc 15, the code is not generating a compile error.

Do you mean *now*generating a compile error?


I guess the YP AB doesn't have a build that catches this target.


>
> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
>     error: too many arguments to function 'sbc_analyze_eight_armv6';
>        expected 0, have 3
>
> Simple fix is to drop the C standard down to gnu17 to avoid this new
> error.
It would be better to file a bug or at least send the
maintainer a patch or a bug description. That's:

    Marcel Holtmann <marcel@holtmann.org>

from:
https://git.kernel.org/pub/scm/bluetooth/sbc.git/tree/README

Anyway, we do have 17 other such work-arounds:

poky.git
❯ rg gnu17 | wc -l
17

so one more won't hurt that much!

../Randy


>
> Signed-off-by: Ryan Eatmon<reatmon@ti.com>
> ---
>   meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> index 5aaa52313f..8b91e7e65b 100644
> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
>   
>   inherit autotools pkgconfig
>   
> +CFLAGS += "-std=gnu17"
> +
>   PACKAGES =+ "${PN}-examples"
>   FILES:${PN}-examples += "${bindir}/*"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#217048):https://lists.openembedded.org/g/openembedded-core/message/217048
> Mute This Topic:https://lists.openembedded.org/mt/113232263/3616765
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ryan Eatmon May 21, 2025, 6:29 p.m. UTC | #2
On 5/21/2025 11:55 AM, Randy MacLeod wrote:
> Hi Ryan,
> 
> On 2025-05-21 12:26 p.m., Ryan Eatmon via lists.openembedded.org wrote:
>> With the move to gcc 15, the code is not generating a compile error.
> 
> Do you mean *now*generating a compile error?

Sigh... yes.  Me speak/type good. =P

I'll send a v2.

> 
> I guess the YP AB doesn't have a build that catches this target.
> 
> 
>> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
>>     error: too many arguments to function 'sbc_analyze_eight_armv6';
>>        expected 0, have 3
>>
>> Simple fix is to drop the C standard down to gnu17 to avoid this new
>> error.
> It would be better to file a bug or at least send the
> maintainer a patch or a bug description. That's:
> 
>     Marcel Holtmann <marcel@holtmann.org>
> 
> from:
> https://git.kernel.org/pub/scm/bluetooth/sbc.git/tree/README
> 
> Anyway, we do have 17 other such work-arounds:
> 
> poky.git
> ❯ rg gnu17 | wc -l
> 17
> 
> so one more won't hurt that much!
> 
> ../Randy
> 
> 
>> Signed-off-by: Ryan Eatmon<reatmon@ti.com>
>> ---
>>   meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> index 5aaa52313f..8b91e7e65b 100644
>> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
>>   
>>   inherit autotools pkgconfig
>>   
>> +CFLAGS += "-std=gnu17"
>> +
>>   PACKAGES =+ "${PN}-examples"
>>   FILES:${PN}-examples += "${bindir}/*"
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#217048):https://lists.openembedded.org/g/openembedded-core/message/217048
>> Mute This Topic:https://lists.openembedded.org/mt/113232263/3616765
>> Group Owner:openembedded-core+owner@lists.openembedded.org
>> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub  [randy.macleod@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
> 
> -- 
> # Randy MacLeod
> # Wind River Linux
>
Ryan Eatmon May 21, 2025, 6:38 p.m. UTC | #3
On 5/21/2025 11:55 AM, Randy MacLeod wrote:
> Hi Ryan,
> 
> On 2025-05-21 12:26 p.m., Ryan Eatmon via lists.openembedded.org wrote:
>> With the move to gcc 15, the code is not generating a compile error.
> 
> Do you mean *now*generating a compile error?
> 
> 
> I guess the YP AB doesn't have a build that catches this target.
> 
> 
>> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
>>     error: too many arguments to function 'sbc_analyze_eight_armv6';
>>        expected 0, have 3
>>
>> Simple fix is to drop the C standard down to gnu17 to avoid this new
>> error.
> It would be better to file a bug or at least send the
> maintainer a patch or a bug description. That's:
> 
>     Marcel Holtmann <marcel@holtmann.org>
> 
> from:
> https://git.kernel.org/pub/scm/bluetooth/sbc.git/tree/README

Sent bug report.


> Anyway, we do have 17 other such work-arounds:
> 
> poky.git
> ❯ rg gnu17 | wc -l
> 17
> 
> so one more won't hurt that much!
> 
> ../Randy
> 
> 
>> Signed-off-by: Ryan Eatmon<reatmon@ti.com>
>> ---
>>   meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> index 5aaa52313f..8b91e7e65b 100644
>> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
>>   
>>   inherit autotools pkgconfig
>>   
>> +CFLAGS += "-std=gnu17"
>> +
>>   PACKAGES =+ "${PN}-examples"
>>   FILES:${PN}-examples += "${bindir}/*"
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#217048):https://lists.openembedded.org/g/openembedded-core/message/217048
>> Mute This Topic:https://lists.openembedded.org/mt/113232263/3616765
>> Group Owner:openembedded-core+owner@lists.openembedded.org
>> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub  [randy.macleod@windriver.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
> 
> -- 
> # Randy MacLeod
> # Wind River Linux
>
Khem Raj May 21, 2025, 8:27 p.m. UTC | #4
On Wed, May 21, 2025 at 9:26 AM Ryan Eatmon via lists.openembedded.org
<reatmon=ti.com@lists.openembedded.org> wrote:
>
> With the move to gcc 15, the code is not generating a compile error.
>
> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
>    error: too many arguments to function 'sbc_analyze_eight_armv6';
>       expected 0, have 3
>
> Simple fix is to drop the C standard down to gnu17 to avoid this new
> error.
>
> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> ---
>  meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> index 5aaa52313f..8b91e7e65b 100644
> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
>
>  inherit autotools pkgconfig
>
> +CFLAGS += "-std=gnu17"

maybe changing
static void __attribute__((naked)) sbc_analyze_eight_armv6()

to
static void __attribute__((naked)) sbc_analyze_eight_armv6(const
unsigned char *buffer, int size, int channels)

in that file helps ?



> +
>  PACKAGES =+ "${PN}-examples"
>  FILES:${PN}-examples += "${bindir}/*"
> --
> 2.17.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#217048): https://lists.openembedded.org/g/openembedded-core/message/217048
> Mute This Topic: https://lists.openembedded.org/mt/113232263/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Ryan Eatmon May 22, 2025, 2:04 p.m. UTC | #5
On 5/21/2025 3:27 PM, Khem Raj wrote:
> On Wed, May 21, 2025 at 9:26 AM Ryan Eatmon via lists.openembedded.org
> <reatmon=ti.com@lists.openembedded.org> wrote:
>>
>> With the move to gcc 15, the code is not generating a compile error.
>>
>> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
>>     error: too many arguments to function 'sbc_analyze_eight_armv6';
>>        expected 0, have 3
>>
>> Simple fix is to drop the C standard down to gnu17 to avoid this new
>> error.
>>
>> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
>> ---
>>   meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> index 5aaa52313f..8b91e7e65b 100644
>> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
>> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
>>
>>   inherit autotools pkgconfig
>>
>> +CFLAGS += "-std=gnu17"
> 
> maybe changing
> static void __attribute__((naked)) sbc_analyze_eight_armv6()
> 
> to
> static void __attribute__((naked)) sbc_analyze_eight_armv6(const
> unsigned char *buffer, int size, int channels)
> 
> in that file helps ?

Likely that would help.  I guess the philosophy question is...

Patch the source code  vs.  Lower the C standard to match what the 
existing source was developed under?

What is the preferred method for handling things like this?

> 
> 
>> +
>>   PACKAGES =+ "${PN}-examples"
>>   FILES:${PN}-examples += "${bindir}/*"
>> --
>> 2.17.1
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#217048): https://lists.openembedded.org/g/openembedded-core/message/217048
>> Mute This Topic: https://lists.openembedded.org/mt/113232263/1997914
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
Khem Raj May 22, 2025, 2:34 p.m. UTC | #6
On Thu, May 22, 2025 at 7:04 AM Ryan Eatmon <reatmon@ti.com> wrote:
>
>
>
> On 5/21/2025 3:27 PM, Khem Raj wrote:
> > On Wed, May 21, 2025 at 9:26 AM Ryan Eatmon via lists.openembedded.org
> > <reatmon=ti.com@lists.openembedded.org> wrote:
> >>
> >> With the move to gcc 15, the code is not generating a compile error.
> >>
> >> ../sbc-2.1/sbc/sbc_primitives_armv6.c:284:9:
> >>     error: too many arguments to function 'sbc_analyze_eight_armv6';
> >>        expected 0, have 3
> >>
> >> Simple fix is to drop the C standard down to gnu17 to avoid this new
> >> error.
> >>
> >> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
> >> ---
> >>   meta/recipes-multimedia/sbc/sbc_2.1.bb | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> >> index 5aaa52313f..8b91e7e65b 100644
> >> --- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
> >> +++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
> >> @@ -19,5 +19,7 @@ SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
> >>
> >>   inherit autotools pkgconfig
> >>
> >> +CFLAGS += "-std=gnu17"
> >
> > maybe changing
> > static void __attribute__((naked)) sbc_analyze_eight_armv6()
> >
> > to
> > static void __attribute__((naked)) sbc_analyze_eight_armv6(const
> > unsigned char *buffer, int size, int channels)
> >
> > in that file helps ?
>
> Likely that would help.  I guess the philosophy question is...
>
> Patch the source code  vs.  Lower the C standard to match what the
> existing source was developed under?
>
> What is the preferred method for handling things like this?

I think it's subjective. distro hat on you want to do minimal changes and
perhaps pinning to C17 is fine, but we won't know when to remove it unless
we put some markers so its technical debt we will carry

However, fixing the package itself is paying the debt now and helps the
ecosystem but it does mean some extra work in upstreaming the patch
I know you have already reported the bug but this is one step more to
provide a potential fix as well.

>
> >
> >
> >> +
> >>   PACKAGES =+ "${PN}-examples"
> >>   FILES:${PN}-examples += "${bindir}/*"
> >> --
> >> 2.17.1
> >>
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#217048): https://lists.openembedded.org/g/openembedded-core/message/217048
> >> Mute This Topic: https://lists.openembedded.org/mt/113232263/1997914
> >> Group Owner: openembedded-core+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
>
> --
> Ryan Eatmon                reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
diff mbox series

Patch

diff --git a/meta/recipes-multimedia/sbc/sbc_2.1.bb b/meta/recipes-multimedia/sbc/sbc_2.1.bb
index 5aaa52313f..8b91e7e65b 100644
--- a/meta/recipes-multimedia/sbc/sbc_2.1.bb
+++ b/meta/recipes-multimedia/sbc/sbc_2.1.bb
@@ -19,5 +19,7 @@  SRC_URI[sha256sum] = "426633cabd7c798236443516dfa8335b47e004b0ef37ff107e0c7ead32
 
 inherit autotools pkgconfig
 
+CFLAGS += "-std=gnu17"
+
 PACKAGES =+ "${PN}-examples"
 FILES:${PN}-examples += "${bindir}/*"