Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 752069 - media-libs/opus: disable automagic intrinsics
Summary: media-libs/opus: disable automagic intrinsics
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords: PATCH, PullRequest
Depends on:
Blocks:
 
Reported: 2020-11-01 00:48 UTC by David Michael
Modified: 2021-05-28 15:37 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Michael 2020-11-01 00:48:06 UTC
The build system enables intrinsics automatically for runtime detection even when the CPU USE flags are disabled.  I'm compiling for an ARM chip with no FPU, but the package still builds NEON code that will never run.  This is because the ebuild explicitly enables intrinsics when CPU flags are set, but it is never explicitly disabled leaving it up to automagic.

Maybe related to bug #585776, but that seemed to be a problem specific to CFLAGS.

Reproducible: Always

Steps to Reproduce:
1. emerge -v media-libs/opus

Actual Results:  
checking if compiler supports ARM Neon intrinsics... no
checking if compiler supports ARM Neon intrinsics with -mfpu=neon -mfloat-abi=softfp... yes
...
      Intrinsics Optimizations: ...... ARM (NEON)
      Run-time CPU detection: ........ ARM (NEON Intrinsics)

Expected Results:  
It should not waste time and space building code that will not run.

LTO is also broken when compiling for this CPU when intrinsics are enabled.  This fixes that, too.

--- media-libs/opus/opus-1.3.1-r1.ebuild
+++ media-libs/opus/opus-1.3.1-r1.ebuild
@@ -25,6 +25,7 @@
 		$(use_enable custom-modes)
 		$(use_enable doc)
 		$(use_enable static-libs static)
+		--disable-intrinsics
 	)
 	for i in ${INTRINSIC_FLAGS} ; do
 		use ${i} && myeconfargs+=( --enable-intrinsics )
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-03-18 00:41:19 UTC
*** Bug 585776 has been marked as a duplicate of this bug. ***
Comment 2 Larry the Git Cow gentoo-dev 2021-05-28 15:37:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93253755df3984a0154319e605ef43c938124dfe

commit 93253755df3984a0154319e605ef43c938124dfe
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-05-28 15:37:04 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2021-05-28 15:37:04 +0000

    media-libs/opus: disable intrinsics automagic
    
    Thanks-to: David Michael <fedora.dm0@gmail.com>
    Closes: https://bugs.gentoo.org/752069
    Signed-off-by: Sam James <sam@gentoo.org>
    Signed-off-by: David Seifert <soap@gentoo.org>

 media-libs/opus/opus-1.3.1-r1.ebuild |  4 ++-
 media-libs/opus/opus-1.3.1-r2.ebuild | 48 ++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)