Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: Thomas Deutschmann <whissi@g.o>
Cc: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/
Date: Mon, 25 May 2020 13:04:26
Message-Id: 20200525150415.59587d04@gentoo.org
1 On Sun, 24 May 2020 20:25:11 +0000 (UTC)
2 "Thomas Deutschmann" <whissi@g.o> wrote:
3
4 > commit: eba596db8a926adb18595549c89294ed0a1e929e
5 > Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
6 > AuthorDate: Sun May 24 15:07:04 2020 +0000
7 > Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
8 > CommitDate: Sun May 24 20:23:50 2020 +0000
9 > URL:
10 > https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eba596db
11 >
12 > media-libs/x265: rework assembly support
13 >
14 > Closes: https://bugs.gentoo.org/681878
15 > Package-Manager: Portage-2.3.99, Repoman-2.3.22
16 > Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
17 >
18 > media-libs/x265/metadata.xml | 1 +
19 > media-libs/x265/x265-3.3.ebuild | 66
20 > ++++++++++++++++++++--------------------- 2 files changed, 34
21 > insertions(+), 33 deletions(-)
22 >
23 > diff --git a/media-libs/x265/metadata.xml
24 > b/media-libs/x265/metadata.xml index 22a07293b83..c585d553631 100644
25 > --- a/media-libs/x265/metadata.xml
26 > +++ b/media-libs/x265/metadata.xml
27 > @@ -5,6 +5,7 @@
28 > <email>media-video@g.o</email>
29 > </maintainer>
30 > <use>
31 > + <flag name="asm">Enable x86_64 assembly optimizations.</flag>
32
33
34
35 This should not even be an useflag.
36 Either it works or does not. Individual features support is controlled
37 by cpu_flags_* (or built-in and autodetected at runtime).
38 Please fix.
39
40
41
42 > <flag name="10bit">Add support for producing 10bits HEVC.</flag>
43 > <flag name="12bit">Add support for producing 12bits HEVC.</flag>
44 > <flag name="numa">Build with support for NUMA nodes.</flag>
45 >
46 > diff --git a/media-libs/x265/x265-3.3.ebuild
47 > b/media-libs/x265/x265-3.3.ebuild index 9fc0159bc00..f5c4fee6d97
48 > 100644 --- a/media-libs/x265/x265-3.3.ebuild
49 > +++ b/media-libs/x265/x265-3.3.ebuild
50 > @@ -19,15 +19,17 @@ HOMEPAGE="http://x265.org/
51 > https://bitbucket.org/multicoreware/x265/wiki/Home" LICENSE="GPL-2"
52 > # subslot = libx265 soname
53 > SLOT="0/188"
54 > -IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
55 > +IUSE="+asm +10bit +12bit cpu_flags_arm_neon numa pic power8 test"
56 >
57 > # Test suite requires assembly support and is known to be broken
58 > RESTRICT="test"
59 >
60 > ASM_DEPEND=">=dev-lang/yasm-1.2.0"
61 >
62 > -BDEPEND="abi_x86_32? ( ${ASM_DEPEND} )
63 > - abi_x86_64? ( ${ASM_DEPEND} )"
64 > +BDEPEND="asm? (
65 > + abi_x86_32? ( ${ASM_DEPEND} )
66 > + abi_x86_64? ( ${ASM_DEPEND} )
67 > + )"
68 >
69 > RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}]
70 > )"
71 > @@ -85,17 +87,6 @@ x265_variant_src_configure() {
72 > -DENABLE_CLI=OFF
73 > -DMAIN12=ON
74 > )
75 > - if [[ ${ABI} = x86 ]] ; then
76 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
77 > )
78 > - fi
79 > - if [[ ${ABI} = arm ]] ; then
80 > - # 589674
81 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
82 > )
83 > - fi
84 > - if [[ ${ABI} = ppc64 ]] ; then
85 > - #
86 > https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
87 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
88 > -DENABLE_ALTIVEC=OFF )
89 > - fi
90 > ;;
91 > "main10")
92 > mycmakeargs+=(
93 > @@ -104,17 +95,6 @@ x265_variant_src_configure() {
94 > -DENABLE_SHARED=OFF
95 > -DENABLE_CLI=OFF
96 > )
97 > - if [[ ${ABI} = x86 ]] ; then
98 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
99 > )
100 > - fi
101 > - if [[ ${ABI} = arm ]] ; then
102 > - # 589674
103 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
104 > )
105 > - fi
106 > - if [[ ${ABI} = ppc64 ]] ; then
107 > - #
108 > https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
109 > - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF
110 > -DENABLE_ALTIVEC=OFF )
111 > - fi
112 > ;;
113
114
115 What are you trying to fix here ?
116 This sounds like a regression to me: some asm will not work for
117 10/12bits variants while 8bit is fine. You are removing this work here.
118
119
120
121 > "main")
122 > if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ;
123 > then @@ -146,7 +126,6 @@ multilib_src_configure() {
124 > append-cxxflags -fPIC
125 >
126 > local myabicmakeargs=(
127 > - -DENABLE_TESTS=$(usex test ON OFF)
128 > $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
129 > -DENABLE_LIBNUMA=$(usex numa ON OFF)
130 > -DCPU_POWER8=$(usex power8 ON OFF)
131 > @@ -154,18 +133,39 @@ multilib_src_configure() {
132 > -DLIB_INSTALL_DIR="$(get_libdir)"
133 > )
134 >
135 > + local supports_asm=yes
136 > +
137 > if [[ ${ABI} = x86 ]] ; then
138 > - # Bug #528202
139 > - if use pic ; then
140 > + if use asm && use pic ; then
141 > + # Bug #528202
142 > ewarn "PIC has been requested but x86 asm is
143 > not PIC-safe, disabling it."
144 > - myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
145 > + supports_asm=no
146 > fi
147 > elif [[ ${ABI} = x32 ]] ; then
148 > - # bug #510890
149 > - myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
150 > + if use asm ; then
151 > + # bug #510890
152 > + ewarn "x32 ABI doesn't support asm"
153 > + supports_asm=no
154 > + fi
155 > elif [[ ${ABI} = arm ]] ; then
156 > - myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF
157 > $(usex cpu_flags_arm_neon ON OFF)) )
158 > - use cpu_flags_arm_neon && use pic && ewarn "PIC has
159 > been requested but arm neon asm is not PIC-safe, disabling it."
160 > + if use asm && use pic ; then
161 > + ewarn "PIC has been requested but arm neon
162 > asm is not PIC-safe, disabling it."
163 > + supports_asm=no
164 > + elif use asm && use cpu_flags_arm_neon ; then
165 > + supports_asm=yes
166 > + elif use asm ; then
167 > + supports_asm=no
168 > + fi
169 > + fi
170 > +
171 > + if [[ "${supports_asm}" = yes ]] && use asm ; then
172 > + myabicmakeargs+=( -DENABLE_ASSEMBLY=ON )
173 > +
174 > + if multilib_is_native_abi ; then
175 > + myabicmakeargs+=( -DENABLE_TESTS=$(usex test
176 > ON OFF) )
177 > + fi
178
179
180 Tying tests to native ABI seems wrong to me.
181
182
183
184 Alexis.