On Sun, 24 May 2020 20:25:11 +0000 (UTC)
"Thomas Deutschmann" <whi...@gentoo.org> wrote:

> commit:     eba596db8a926adb18595549c89294ed0a1e929e
> Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
> AuthorDate: Sun May 24 15:07:04 2020 +0000
> Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
> CommitDate: Sun May 24 20:23:50 2020 +0000
> URL:
> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eba596db
> 
> 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 <AT> gentoo.org>
> 
>  media-libs/x265/metadata.xml    |  1 +
>  media-libs/x265/x265-3.3.ebuild | 66
> ++++++++++++++++++++--------------------- 2 files changed, 34
> insertions(+), 33 deletions(-)
> 
> diff --git a/media-libs/x265/metadata.xml
> b/media-libs/x265/metadata.xml index 22a07293b83..c585d553631 100644
> --- a/media-libs/x265/metadata.xml
> +++ b/media-libs/x265/metadata.xml
> @@ -5,6 +5,7 @@
>      <email>media-vi...@gentoo.org</email>
>    </maintainer>
>    <use>
> +    <flag name="asm">Enable x86_64 assembly optimizations.</flag>



This should not even be an useflag.
Either it works or does not. Individual features support is controlled
by cpu_flags_* (or built-in and autodetected at runtime).
Please fix.



>      <flag name="10bit">Add support for producing 10bits HEVC.</flag>
>      <flag name="12bit">Add support for producing 12bits HEVC.</flag>
>      <flag name="numa">Build with support for NUMA nodes.</flag>
> 
> diff --git a/media-libs/x265/x265-3.3.ebuild
> b/media-libs/x265/x265-3.3.ebuild index 9fc0159bc00..f5c4fee6d97
> 100644 --- a/media-libs/x265/x265-3.3.ebuild
> +++ b/media-libs/x265/x265-3.3.ebuild
> @@ -19,15 +19,17 @@ HOMEPAGE="http://x265.org/
> https://bitbucket.org/multicoreware/x265/wiki/Home"; LICENSE="GPL-2"
>  # subslot = libx265 soname
>  SLOT="0/188"
> -IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
> +IUSE="+asm +10bit +12bit cpu_flags_arm_neon numa pic power8 test"
>  
>  # Test suite requires assembly support and is known to be broken
>  RESTRICT="test"
>  
>  ASM_DEPEND=">=dev-lang/yasm-1.2.0"
>  
> -BDEPEND="abi_x86_32? ( ${ASM_DEPEND} )
> -     abi_x86_64? ( ${ASM_DEPEND} )"
> +BDEPEND="asm? (
> +             abi_x86_32? ( ${ASM_DEPEND} )
> +             abi_x86_64? ( ${ASM_DEPEND} )
> +     )"
>  
>  RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}]
> )" 
> @@ -85,17 +87,6 @@ x265_variant_src_configure() {
>                               -DENABLE_CLI=OFF
>                               -DMAIN12=ON
>                       )
> -                     if [[ ${ABI} = x86 ]] ; then
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> )
> -                     fi
> -                     if [[ ${ABI} = arm ]] ; then
> -                             # 589674
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> )
> -                     fi
> -                     if [[ ${ABI} = ppc64 ]] ; then
> -                             #
> https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> -DENABLE_ALTIVEC=OFF )
> -                     fi
>                       ;;
>               "main10")
>                       mycmakeargs+=(
> @@ -104,17 +95,6 @@ x265_variant_src_configure() {
>                               -DENABLE_SHARED=OFF
>                               -DENABLE_CLI=OFF
>                       )
> -                     if [[ ${ABI} = x86 ]] ; then
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> )
> -                     fi
> -                     if [[ ${ABI} = arm ]] ; then
> -                             # 589674
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> )
> -                     fi
> -                     if [[ ${ABI} = ppc64 ]] ; then
> -                             #
> https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
> -                             mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
> -DENABLE_ALTIVEC=OFF )
> -                     fi
>                       ;;


What are you trying to fix here ?
This sounds like a regression to me: some asm will not work for
10/12bits variants while 8bit is fine. You are removing this work here.



>               "main")
>                       if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ;
> then @@ -146,7 +126,6 @@ multilib_src_configure() {
>       append-cxxflags -fPIC
>  
>       local myabicmakeargs=(
> -             -DENABLE_TESTS=$(usex test ON OFF)
>               $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
>               -DENABLE_LIBNUMA=$(usex numa ON OFF)
>               -DCPU_POWER8=$(usex power8 ON OFF)
> @@ -154,18 +133,39 @@ multilib_src_configure() {
>               -DLIB_INSTALL_DIR="$(get_libdir)"
>       )
>  
> +     local supports_asm=yes
> +
>       if [[ ${ABI} = x86 ]] ; then
> -             # Bug #528202
> -             if use pic ; then
> +             if use asm && use pic ; then
> +                     # Bug #528202
>                       ewarn "PIC has been requested but x86 asm is
> not PIC-safe, disabling it."
> -                     myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
> +                     supports_asm=no
>               fi
>       elif [[ ${ABI} = x32 ]] ; then
> -             # bug #510890
> -             myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
> +             if use asm ; then
> +                     # bug #510890
> +                     ewarn "x32 ABI doesn't support asm"
> +                     supports_asm=no
> +             fi
>       elif [[ ${ABI} = arm ]] ; then
> -             myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF
> $(usex cpu_flags_arm_neon ON OFF)) )
> -             use cpu_flags_arm_neon && use pic && ewarn "PIC has
> been requested but arm neon asm is not PIC-safe, disabling it."
> +             if use asm && use pic ; then
> +                     ewarn "PIC has been requested but arm neon
> asm is not PIC-safe, disabling it."
> +                     supports_asm=no
> +             elif use asm && use cpu_flags_arm_neon ; then
> +                     supports_asm=yes
> +             elif use asm ; then
> +                     supports_asm=no
> +             fi
> +     fi
> +
> +     if [[ "${supports_asm}" = yes ]] && use asm ; then
> +             myabicmakeargs+=( -DENABLE_ASSEMBLY=ON )
> +
> +             if multilib_is_native_abi ; then
> +                     myabicmakeargs+=( -DENABLE_TESTS=$(usex test
> ON OFF) )
> +             fi


Tying tests to native ABI seems wrong to me.



Alexis.

Reply via email to