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: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: media-video herd
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-03-27 20:27 UTC by Alec Ari
Modified: 2019-03-28 09:22 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.