Skip to contentSkip to conversation

package/ffmpeg: altivec needs VSX with little endian

PATCH Applied Fabrice Fontaine 3 participants 3 messages Aug 23, 2022 – Sep 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/ffmpeg: altivec needs VSX with little endian

Fix the following build failure:

In file included from libavcodec/ppc/audiodsp.c:31:
libavcodec/ppc/audiodsp.c: In function 'scalarproduct_int16_altivec':
./libavutil/ppc/util_altivec.h:123:5: error: implicit declaration of function 'vec_vsx_ld'; did you mean 'vec_vslh'? [-Werror=implicit-function-declaration]

  123 |     vec_vsx_ld(offset, b)
      |     ^~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/b772d285f978ff9bc3b07872d009633c943f20b1

---
 package/ffmpeg/ffmpeg.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/ffmpeg/ffmpeg.mk +3 -1
index 82d229903f..7038f4f5f7 100644
@@ -511,7 +511,9 @@ endif
 FFMPEG_CONF_OPTS += --disable-asm
 endif # MIPS
 
-ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC):$(BR2_powerpc64le),y:)
+FFMPEG_CONF_OPTS += --enable-altivec
+else ifeq ($(BR2_POWERPC_CPU_HAS_VSX):$(BR2_powerpc64le),y:y)
 FFMPEG_CONF_OPTS += --enable-altivec
 else
 FFMPEG_CONF_OPTS += --disable-altivec
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

On 2022-08-23 23:22 +0200, Fabrice Fontaine spake thusly:

Quoted 21 lines

Fix the following build failure:

In file included from libavcodec/ppc/audiodsp.c:31:
libavcodec/ppc/audiodsp.c: In function 'scalarproduct_int16_altivec':
./libavutil/ppc/util_altivec.h:123:5: error: implicit declaration of function 'vec_vsx_ld'; did you mean 'vec_vslh'? [-Werror=implicit-function-declaration]

  123 |     vec_vsx_ld(offset, b)
      |     ^~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/b772d285f978ff9bc3b07872d009633c943f20b1

---
 package/ffmpeg/ffmpeg.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/ffmpeg/ffmpeg.mk +0 -0
index 82d229903f..7038f4f5f7 100644

package/ffmpeg/ffmpeg.mk endif · line 517

Quoted 8 lines
package/ffmpeg/ffmpeg.mk +3 -1
@@ -511,7 +511,9 @@ endif
 FFMPEG_CONF_OPTS += --disable-asm
 endif # MIPS
 
-ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
+ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC):$(BR2_powerpc64le),y:)
+FFMPEG_CONF_OPTS += --enable-altivec
+else ifeq ($(BR2_POWERPC_CPU_HAS_VSX):$(BR2_powerpc64le),y:y)
 FFMPEG_CONF_OPTS += --enable-altivec

So, this means you enable AltiVec when VSX support is available, which is a bit confusing. VSX is indeed a further extension to AltiVec [0].

However, in ffpmpeg, VSX is driven by its own --enable-vsx flag to, so not seeing it here is also a bit confusing.

So, I've added a cmment in the .mk and extended the commit log.

Applied to master, thanks.

[0] https://en.wikipedia.org/wiki/AltiVec#VSX_(Vector_Scalar_Extension)
This means that VSX implies AltiVec, but this is not accounted for in arch/Config.in.powerpc, and maybe we would need something like:

config BR2_POWERPC_CPU_HAS_VSX
bool
select BR2_POWERPC_CPU_HAS_ALTIVEC

Which would allow to simplify the entries for BR2_powerpc_power7 and BR2_powerpc_power8, so they would just need to select BR2_POWERPC_CPU_HAS_VSX But that is for a separate patch, of course...

Regards,
Yann E. MORIN.

Quoted 9 lines
package/ffmpeg/ffmpeg.mk +0 -0
 else
 FFMPEG_CONF_OPTS += --disable-altivec
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Fabrice Fontaine
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

Fix the following build failure:
In file included from libavcodec/ppc/audiodsp.c:31:
libavcodec/ppc/audiodsp.c: In function 'scalarproduct_int16_altivec':
./libavutil/ppc/util_altivec.h:123:5: error: implicit declaration of function 'vec_vsx_ld'; did you mean 'vec_vslh'? [-Werror=implicit-function-declaration]

Quoted 7 lines
  123 |     vec_vsx_ld(offset, b)
      |     ^~~~~~~~~~

Fixes:
- http://autobuild.buildroot.org/results/b772d285f978ff9bc3b07872d009633c943f20b1

Committed to 2022.05.x and 2022.02.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot