Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 681878 - media-libs/x265 asm disabled regardless of USE=pic on x86
Summary: media-libs/x265 asm disabled regardless of USE=pic on x86
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-03-27 20:27 UTC by Alec Ari
Modified: 2020-05-24 20:24 UTC (History)
0 users

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


Attachments
[PATCH] Allow asm if pic is disabled (0001-Allow-asm-if-pic-is-disabled.patch,1.04 KB, patch)
2019-03-27 20:27 UTC, Alec Ari
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Ari 2019-03-27 20:27:11 UTC
Created attachment 570946 [details, diff]
[PATCH] Allow asm if pic is disabled

Currently the code is:

---SNIPPET 1---
IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
...
x265_variant_src_configure() {
...
local mycmakeargs=( "${myabicmakeargs[@]}" )
case "${MULTIBUILD_VARIANT}" in
	"main12")
		mycmakeargs+=(
			-DHIGH_BIT_DEPTH=ON
			-DEXPORT_C_API=OFF
			-DENABLE_SHARED=OFF
			-DENABLE_CLI=OFF
			-DMAIN12=ON
		)
		if [[ ${ABI} = x86 ]] ; then
			mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
		fi
...
	"main10")
		mycmakeargs+=(
			-DHIGH_BIT_DEPTH=ON
			-DEXPORT_C_API=OFF
			-DENABLE_SHARED=OFF
			-DENABLE_CLI=OFF
		)
		if [[ ${ABI} = x86 ]] ; then
			mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
		fi
---SNIPPET 1---

Then further down the ebuild:

---SNIPPET 2---
multilib_src_configure() {
...
	if [[ ${ABI} = x86 ]] ; then
		# Bug #528202
		if use pic ; then
			ewarn "PIC has been requested but x86 asm is not PIC-safe, disabling it."
			myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
		fi
---SNIPPET 2---

SNIPPET 1 does what should only _conditionally_ happen in SNIPPET 2. SNIPPET 2 is repetitive in this instance. -DENABLE_ASSEMBLY=OFF is already set, whether USE pic is on or off. I have attached a patch which addresses this.

Current behaviour: On x86, optimized assembly code is always disabled, regardless of pic USE flag.

Correct behaviour: On x86, optimized assembly code should always be enabled unless pic USE flag is enabled.

This looks like copypasta error. This isn't critical but should be addressed so I'm marking this as "minor." If this is "trivial" or "enhancement" please change accordingly.
Comment 1 Larry the Git Cow gentoo-dev 2020-05-24 20:24:53 UTC
The bug has been closed via the following commit(s):

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

commit eba596db8a926adb18595549c89294ed0a1e929e
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-05-24 15:07:04 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-05-24 20:23:50 +0000

    media-libs/x265: rework assembly support
    
    Closes: https://bugs.gentoo.org/681878
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 media-libs/x265/metadata.xml    |  1 +
 media-libs/x265/x265-3.3.ebuild | 66 ++++++++++++++++++++---------------------
 2 files changed, 34 insertions(+), 33 deletions(-)