diff mbox series

[v3,06/13] libjpeg-turbo: Fix build on mips/clang

Message ID 20250522-clang-toolchain-v3-6-16cfc6d9891b@gmail.com
State Accepted, archived
Commit 305072dbde8ec5a4f1d455f7fbfa3a631f9f947f
Headers show
Series clang: Add clang C/C++ toolchain | expand

Commit Message

Khem Raj May 23, 2025, 3:52 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Richard Purdie May 29, 2025, 9:22 a.m. UTC | #1
On Thu, 2025-05-22 at 20:52 -0700, Khem Raj via lists.openembedded.org
wrote:
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> index
> 8533bd8525311e783572cbafb6fccf240db9e0e8..90aa2ef43956f0a1e64f8e08e47
> d953bf5773e19 100644
> --- a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> +++ b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> @@ -47,6 +47,12 @@ EXTRA_OECMAKE:append:class-target:powerpc64le = "
> ${@bb.utils.contains("TUNE_FEA
>  DEBUG_OPTIMIZATION:append:armv4 = "
> ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> pointer', '', d)}"
>  DEBUG_OPTIMIZATION:append:armv5 = "
> ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> pointer', '', d)}"
>  
> +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
> +# <instantiation>:13:5: error: invalid token in expression
> +# .if $17 != 0
> +# ^
> +CFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as"
> +
>  PACKAGES =+ "jpeg-tools libturbojpeg"

I noticed you use "-no-integrated-as" but in the next patch in pixman,
you use "-fno-integrated-as". Should we be consistent or are these
different?

Cheers,

Richard
Khem Raj May 29, 2025, 4:28 p.m. UTC | #2
On 5/29/25 2:22 AM, Richard Purdie wrote:
> On Thu, 2025-05-22 at 20:52 -0700, Khem Raj via lists.openembedded.org
> wrote:
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>   meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
>> b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
>> index
>> 8533bd8525311e783572cbafb6fccf240db9e0e8..90aa2ef43956f0a1e64f8e08e47
>> d953bf5773e19 100644
>> --- a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
>> +++ b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
>> @@ -47,6 +47,12 @@ EXTRA_OECMAKE:append:class-target:powerpc64le = "
>> ${@bb.utils.contains("TUNE_FEA
>>   DEBUG_OPTIMIZATION:append:armv4 = "
>> ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
>> pointer', '', d)}"
>>   DEBUG_OPTIMIZATION:append:armv5 = "
>> ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
>> pointer', '', d)}"
>>   
>> +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
>> +# <instantiation>:13:5: error: invalid token in expression
>> +# .if $17 != 0
>> +# ^
>> +CFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as"
>> +
>>   PACKAGES =+ "jpeg-tools libturbojpeg"
> 
> I noticed you use "-no-integrated-as" but in the next patch in pixman,
> you use "-fno-integrated-as". Should we be consistent or are these
> different?

they are effectively same. -no-integrated-as is legacy clang option 
format while -fno-integrated-as is more in line with gcc options
it's generally better to use -fno-integrated-as since it follows the 
conventional flag naming pattern that other compilers might also recognize.

I will change it in a follow up for consistency.

> 
> Cheers,
> 
> Richard
Richard Purdie May 29, 2025, 8:26 p.m. UTC | #3
On Thu, 2025-05-29 at 09:28 -0700, Khem Raj wrote:
> 
> 
> On 5/29/25 2:22 AM, Richard Purdie wrote:
> > On Thu, 2025-05-22 at 20:52 -0700, Khem Raj via
> > lists.openembedded.org
> > wrote:
> > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ---
> > >   meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb | 6 ++++++
> > >   1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > index
> > > 8533bd8525311e783572cbafb6fccf240db9e0e8..90aa2ef43956f0a1e64f8e0
> > > 8e47
> > > d953bf5773e19 100644
> > > --- a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > +++ b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > @@ -47,6 +47,12 @@ EXTRA_OECMAKE:append:class-target:powerpc64le
> > > = "
> > > ${@bb.utils.contains("TUNE_FEA
> > >   DEBUG_OPTIMIZATION:append:armv4 = "
> > > ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> > > pointer', '', d)}"
> > >   DEBUG_OPTIMIZATION:append:armv5 = "
> > > ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> > > pointer', '', d)}"
> > >   
> > > +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
> > > +# <instantiation>:13:5: error: invalid token in expression
> > > +# .if $17 != 0
> > > +# ^
> > > +CFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as"
> > > +
> > >   PACKAGES =+ "jpeg-tools libturbojpeg"
> > 
> > I noticed you use "-no-integrated-as" but in the next patch in
> > pixman,
> > you use "-fno-integrated-as". Should we be consistent or are these
> > different?
> 
> they are effectively same. -no-integrated-as is legacy clang option 
> format while -fno-integrated-as is more in line with gcc options
> it's generally better to use -fno-integrated-as since it follows the 
> conventional flag naming pattern that other compilers might also
> recognize.
> 
> I will change it in a follow up for consistency.

I've tweaked the patch and merged it. With the pixman one we need to
explain the DEPENDS change before that one can go in.

Cheers,

Richard
Khem Raj May 29, 2025, 8:48 p.m. UTC | #4
On Thu, May 29, 2025 at 1:26 PM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Thu, 2025-05-29 at 09:28 -0700, Khem Raj wrote:
> >
> >
> > On 5/29/25 2:22 AM, Richard Purdie wrote:
> > > On Thu, 2025-05-22 at 20:52 -0700, Khem Raj via
> > > lists.openembedded.org
> > > wrote:
> > > > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > ---
> > > >   meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb | 6 ++++++
> > > >   1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > > b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > > index
> > > > 8533bd8525311e783572cbafb6fccf240db9e0e8..90aa2ef43956f0a1e64f8e0
> > > > 8e47
> > > > d953bf5773e19 100644
> > > > --- a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > > +++ b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
> > > > @@ -47,6 +47,12 @@ EXTRA_OECMAKE:append:class-target:powerpc64le
> > > > = "
> > > > ${@bb.utils.contains("TUNE_FEA
> > > >   DEBUG_OPTIMIZATION:append:armv4 = "
> > > > ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> > > > pointer', '', d)}"
> > > >   DEBUG_OPTIMIZATION:append:armv5 = "
> > > > ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-
> > > > pointer', '', d)}"
> > > >
> > > > +# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
> > > > +# <instantiation>:13:5: error: invalid token in expression
> > > > +# .if $17 != 0
> > > > +# ^
> > > > +CFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as"
> > > > +
> > > >   PACKAGES =+ "jpeg-tools libturbojpeg"
> > >
> > > I noticed you use "-no-integrated-as" but in the next patch in
> > > pixman,
> > > you use "-fno-integrated-as". Should we be consistent or are these
> > > different?
> >
> > they are effectively same. -no-integrated-as is legacy clang option
> > format while -fno-integrated-as is more in line with gcc options
> > it's generally better to use -fno-integrated-as since it follows the
> > conventional flag naming pattern that other compilers might also
> > recognize.
> >
> > I will change it in a follow up for consistency.
>
> I've tweaked the patch and merged it. With the pixman one we need to
> explain the DEPENDS change before that one can go in.
>

Thanks. For DEPENDS I am sending a new version

> Cheers,
>
> Richard
diff mbox series

Patch

diff --git a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
index 8533bd8525311e783572cbafb6fccf240db9e0e8..90aa2ef43956f0a1e64f8e08e47d953bf5773e19 100644
--- a/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
+++ b/meta/recipes-graphics/jpeg/libjpeg-turbo_3.1.0.bb
@@ -47,6 +47,12 @@  EXTRA_OECMAKE:append:class-target:powerpc64le = " ${@bb.utils.contains("TUNE_FEA
 DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}"
 
+# libjpeg-turbo-2.0.2/simd/mips/jsimd_dspr2.S
+# <instantiation>:13:5: error: invalid token in expression
+# .if $17 != 0
+# ^
+CFLAGS:append:toolchain-clang:mipsarch = " -no-integrated-as"
+
 PACKAGES =+ "jpeg-tools libturbojpeg"
 
 DESCRIPTION:jpeg-tools = "The jpeg-tools package includes client programs to access libjpeg functionality.  These tools allow for the compression, decompression, transformation and display of JPEG files and benchmarking of the libjpeg library."