Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951981 - dev-cpp/highway: Fails to build on arm64 with cpu_flags_arm_neon
Summary: dev-cpp/highway: Fails to build on arm64 with cpu_flags_arm_neon
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Daniel Novomeský
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-24 18:55 UTC by benoit.dufour
Modified: 2025-04-30 22:12 UTC (History)
3 users (show)

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


Attachments
build.log (sr_hc_lx2_highway_build.log,21.98 KB, text/x-log)
2025-03-24 18:55 UTC, benoit.dufour
Details
emerge --info (emerge_info_sr_lx2_arm64.txt,8.03 KB, text/plain)
2025-03-24 18:57 UTC, benoit.dufour
Details

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.dufour 2025-03-24 18:55:34 UTC
Created attachment 922368 [details]
build.log

See the logs.
Comment 1 benoit.dufour 2025-03-24 18:57:16 UTC
Created attachment 922369 [details]
emerge --info
Comment 2 benoit.dufour 2025-03-26 15:35:53 UTC
A closer look to the logs led me to think that those flags:
 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard 
are generated by this snippet of the CMakeLists.txt

https://github.com/google/highway/blob/99bb05378be47b4c21baef4c8ff0db831a2a88f1/CMakeLists.txt#L432C7-L432C21

So HWY_CMAKE_ARM7 which is turned on by the ebuild in multilib_src_configure().

And so it is trying to compile for armv7-a instead of armv8-a.
This behaviour is kinda bad since it doesn't take account for aarch64.
Comment 3 Vivian Heisz (demize) 2025-04-30 19:49:34 UTC
Potentially relevant upstream issue: https://github.com/google/highway/issues/2234

I'll note I've been unable to get the suggested workaround to work, though.
Comment 4 benoit.dufour 2025-04-30 20:05:59 UTC
As I tried to explain, the "-mfpu=neon-vfpv4" won't work for aarch64 since it doesn't exists.
"-mfloat-abi=hard" also doesn't seems to exists at all.
"-march=armv7-a" is also wrong since the current arch is armv8-a or anything newer.

See:
https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html

But the compiler should use neon on aarch64 even though there's no compiler flag for it.

So the actual fix would be to turn off the cpu_flags_arm_neon completly for aarch64 for dev-cpp/highway.

I guess this should be done in the ebuild.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-30 22:09:37 UTC
(In reply to benoit.dufour from comment #4)
> As I tried to explain, the "-mfpu=neon-vfpv4" won't work for aarch64 since
> it doesn't exists.

Often, a patch with commentary is helpful in getting the point across.

Anyway, indeed, this is another case of cpu_flags_arm_neon being wrong on 64-bit.
Comment 6 Larry the Git Cow gentoo-dev 2025-04-30 22:11:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1eb26dea6ba2aae4991a0e0fe417fc171f2f5428

commit 1eb26dea6ba2aae4991a0e0fe417fc171f2f5428
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-30 22:10:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-30 22:10:58 +0000

    profiles/arch/arm64: mask dev-cpp/highway[cpu_flags_arm_neon]
    
    It's for 32-bit only.
    
    Closes: https://bugs.gentoo.org/951981
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/arm64/package.use.mask | 4 ++++
 1 file changed, 4 insertions(+)