Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 727432 - media-libs/libaom-2.0.0_rc1 fails to build on arm64
Summary: media-libs/libaom-2.0.0_rc1 fails to build on arm64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-07 16:11 UTC by Jannik Glückert
Modified: 2020-06-09 14:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log with neon disabled (libaom-2.0.0_rc1.build.log,152.36 KB, text/plain)
2020-06-07 16:11 UTC, Jannik Glückert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jannik Glückert 2020-06-07 16:11:29 UTC
Created attachment 643834 [details]
build.log with neon disabled

It seems like libaom changed the handling of neon (and potentially has a bug in their config?). Here's the build with cpu_flags_arm_neon disabled, as it is currently masked for this package on arm64

FAILED: CMakeFiles/aom_rtcd.dir/av1/common/av1_rtcd.c.o
In file included from ../av1/common/av1_rtcd.c:14:
./config/av1_rtcd.h: In function ‘setup_rtcd_internal’:
./config/av1_rtcd.h:524:40: error: ‘av1_apply_selfguided_restoration_neon’ undeclared (first use in this function); did you mean ‘av1_apply_selfguided_restoration_c’?
  524 |     av1_apply_selfguided_restoration = av1_apply_selfguided_restoration_neon;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        av1_apply_selfguided_restoration_c

and a dozen more of undeclared uses related to neon.

Unmasking cpu_flags_arm_neon and enabling it builds the package fine.
Out of curiosity I also tried libaom-1.0.0-r2 with neon, which also compiled fine. I think the flag can be unmasked for this package on arm64.

Attached is the build.log with cpu_flags_arm_neon disabled
Comment 1 Mart Raudsepp gentoo-dev 2020-06-09 10:47:44 UTC
ebuilds shouldn't be using cpu_flags_arm_neon to turn on neon on arm64; they should do that based on it being arm64.
cpu_flags_arm_neon is only for 32bit arm.
If libaom ENABLE_NEON knob works on 64bit, it should just be enabled unconditionally if arm64, with something like
-DENABLE_NEON=$(usex arm64 ON $(usex cpu_flags_arm_neon ON OFF))
(didn't test)
Comment 2 Luca Barbato gentoo-dev 2020-06-09 12:46:58 UTC
The bug is uncovered because the arm64 profile not hard enabling neon (as it should) while the build system assumes that.

The arch team should not hard-disable neon.
Comment 3 Luca Barbato gentoo-dev 2020-06-09 12:58:15 UTC
This should address it, upstream libaom should be notified, but it is as strange as hard-disabling sse on amd64.

diff --git a/profiles/arch/arm64/use.force b/profiles/arch/arm64/use.force
index 9747410d041..ad4cb1b4c75 100644
--- a/profiles/arch/arm64/use.force
+++ b/profiles/arch/arm64/use.force
@@ -9,6 +9,7 @@ cpu_flags_arm_v7
 cpu_flags_arm_v8

 cpu_flags_arm_edsp
+cpu_flags_arm_neon
 cpu_flags_arm_thumb
 cpu_flags_arm_thumb2
 cpu_flags_arm_vfp
diff --git a/profiles/arch/arm64/use.mask b/profiles/arch/arm64/use.mask
index e58c0bcf118..ed5c44fc41f 100644
--- a/profiles/arch/arm64/use.mask
+++ b/profiles/arch/arm64/use.mask
@@ -8,11 +8,6 @@
 # Mono is hopelessly broken on arm64
 mono

-# Aaron Bauman <bman@gentoo.org> (2019-12-27)
-# Mask cpu_flags_arm_neon for all of arm64
-# A neon64 USE is being discussed
-cpu_flags_arm_neon
-
 # Unmask arm specific USE flags
 -cpu_flags_arm_v4
 -cpu_flags_arm_v4
@@ -24,6 +19,7 @@ cpu_flags_arm_neon
 -cpu_flags_arm_aes
 -cpu_flags_arm_crc32
 -cpu_flags_arm_edsp
+-cpu_flags_arm_neon
 -cpu_flags_arm_sha1
 -cpu_flags_arm_sha2
 -cpu_flags_arm_thumb
Comment 4 Mart Raudsepp gentoo-dev 2020-06-09 13:08:25 UTC
NAK. We are not and should NOT hard-enable cpu_flags_arm_neon. Neon on arm and aarch64 is a bit different and various packages fail to build if cpu_flags_arm_neon is forced on them on a arm64 system.

As I explained in my previous comment and on IRC, arm64 compatible neon should just be unconditionally enabled if use arm64.
Comment 5 Larry the Git Cow gentoo-dev 2020-06-09 14:06:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=547d360604c083a21e7168d904506e055452d74f

commit 547d360604c083a21e7168d904506e055452d74f
Author:     Luca Barbato <lu_zero@gentoo.org>
AuthorDate: 2020-06-09 14:04:39 +0000
Commit:     Luca Barbato <lu_zero@gentoo.org>
CommitDate: 2020-06-09 14:05:28 +0000

    media-libs/libaom: Force neon on arm64
    
    Fixes: https://bugs.gentoo.org/727432
    
    Thanks to leio for the fix.
    
    Package-Manager: Portage-2.3.100, Repoman-2.3.22
    Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

 media-libs/libaom/libaom-2.0.0.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)