1 |
On Fri, Oct 09, 2020 at 12:26:17AM +0000, Jonathan Yong wrote: |
2 |
> I'm open to fixing ebuild packages by myself in my own overlay, though I |
3 |
> prefer not to due to eventual bit rot. Any hints on how to mask CPU USE |
4 |
> flags based on multilib arch in the .ebuild file itself? |
5 |
|
6 |
I suppose you could detect whether a CPU_FLAG is enabled for a x86_32 multilib, |
7 |
although be wary that `MULTILIB_ABI_FLAG` is only exported for some multilib |
8 |
functions, such as `multilib_src_configure` [1]: |
9 |
|
10 |
if [[ ${MULTILIB_ABI_FLAG} == abi_x86_32 ]] && use cpu_flags_x86_avx2; |
11 |
then |
12 |
ewarn "Disabling AVX2 extensions for 32-bit build." |
13 |
# circumvention measures |
14 |
fi |
15 |
|
16 |
I'm not sure of the best way to achieve the "circumvention measures", hence the |
17 |
comment. You could run this conditional after GLOBALCMAKEARGS has been set, |
18 |
omitting the CPU_BASELINE definition in the main block [2], or you could sed |
19 |
through the USE flags and disable `cpu_flags_x86_avx2` there. You're probably |
20 |
better asking on IRC for the best-practice way to achieve this. |
21 |
|
22 |
As mentioned in the relevant bug report, this is not an issue caused by the |
23 |
ebuild, so although this might prove to be a temporary fix, it will hopefully be |
24 |
resolved by upstream very soon. Just be patient. ;-) |
25 |
|
26 |
[1] https://wiki.gentoo.org/wiki/Project:Multilib/multilib-build#MULTILIB_ABI_FLAG |
27 |
[2] https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options#customizing-cmake-options |
28 |
[3] https://bugs.gentoo.org/747163#c15 |
29 |
|
30 |
-- |
31 |
|
32 |
Ashley Dixon |
33 |
suugaku.co.uk |
34 |
|
35 |
2A9A 4117 |
36 |
DA96 D18A |
37 |
8A7B B0D2 |
38 |
A30E BF25 |
39 |
F290 A8AA |