From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-193251-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A66BA138359
	for <garchives@archives.gentoo.org>; Fri,  9 Oct 2020 09:30:05 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C1378E08AD;
	Fri,  9 Oct 2020 09:29:59 +0000 (UTC)
Received: from mail.suugaku.co.uk (unknown [IPv6:2a02:c7d:25f3:2800:c68:8688:e93c:2aa2])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 5597CE0874
	for <gentoo-user@lists.gentoo.org>; Fri,  9 Oct 2020 09:29:59 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=suugaku.co.uk; s=mail;
	t=1602235996; bh=tYbyu3YtbmtZED4piRofogW/yqshVdmCYHrCx/s/xCw=;
	h=Date:From:To:Subject:References:In-Reply-To;
	b=csnnjCnVfcqT2HY+HOxPLoM0WZyfP+/k08NT7knJaF+GzfjXUQwI0uG8WdydVoeQS
	 0BT3ETuhLh7ysKQOOso6S5L2Rug7FEmYKJgxoYA6tSluBkiEmYo3zSb72CKbvnGTjp
	 kKAh7JdXsEmnDtneIZz8opNJcXxLp8dfZ50UeTRU=
Date: Fri, 9 Oct 2020 10:27:56 +0100
From: Ashley Dixon <ash@suugaku.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: Multilib ABI specific CPU use flags?
Message-ID: <20201009092756.mq5absezaoinzugf@ad-gentoo-main>
Mail-Followup-To: gentoo-user@lists.gentoo.org
X-PGP-Key: fp="2A9A DA96 8A7B A30E F290 4117 D18A B0D2 BF25 A8AA";
 id="0xBF25A8AA"; get=<http://suugaku.co.uk/pubkey.asc>;
 get=<hkp://pgp.mit.edu/pks/lookup?search=0xD18AB0D2BF25A8AA&op=get>
X-Operating-System: Linux ad-gentoo-main 5.4.60-gentoo 
X-Editor: vim 8.2
References: <b5d38ae5-5000-c75f-763e-4a81ab3a1df1@gmail.com>
 <20201008154045.xxnqw6gz26kibopv@ad-gentoo-main>
 <76048102-ff3e-790f-151c-4cb0af266bd7@gmail.com>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="xomb6hfbdvc3tupk"
Content-Disposition: inline
In-Reply-To: <76048102-ff3e-790f-151c-4cb0af266bd7@gmail.com>
X-Archives-Salt: 282365d5-f71f-467b-bf4a-4f6868105c1a
X-Archives-Hash: 5de87382e3bd4ed2c2dd315b282f344d


--xomb6hfbdvc3tupk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Oct 09, 2020 at 12:26:17AM +0000, Jonathan Yong wrote:
> I'm open to fixing ebuild packages by myself in my own overlay, though I
> prefer not to due to eventual bit rot. Any hints on how to mask CPU USE
> flags based on multilib arch in the .ebuild file itself?

I suppose you could detect whether a CPU_FLAG is enabled for a x86_32  mult=
ilib,
although be wary that `MULTILIB_ABI_FLAG` is only  exported  for  some  mul=
tilib
functions, such as `multilib_src_configure` [1]:

        if [[ ${MULTILIB_ABI_FLAG} =3D=3D abi_x86_32 ]] && use cpu_flags_x8=
6_avx2;
        then
		ewarn "Disabling AVX2 extensions for 32-bit build."
		# circumvention measures
	fi

I'm not sure of the best way to achieve the "circumvention measures", hence=
  the
comment.  You could run this conditional after  GLOBALCMAKEARGS  has  been =
 set,
omitting the CPU_BASELINE definition in the main block [2],  or  you  could=
  sed
through the USE flags and disable `cpu_flags_x86_avx2` there.   You're  pro=
bably
better asking on IRC for the best-practice way to achieve this.

As mentioned in the relevant bug report, this is not  an  issue  caused  by=
  the
ebuild, so although this might prove to be a temporary fix, it will hopeful=
ly be
resolved by upstream very soon. Just be patient. ;-)

[1] https://wiki.gentoo.org/wiki/Project:Multilib/multilib-build#MULTILIB_A=
BI_FLAG
[2] https://github.com/opencv/opencv/wiki/CPU-optimizations-build-options#c=
ustomizing-cmake-options
[3] https://bugs.gentoo.org/747163#c15

--=20

Ashley Dixon
suugaku.co.uk

2A9A 4117
DA96 D18A
8A7B B0D2
A30E BF25
F290 A8AA


--xomb6hfbdvc3tupk
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEKpralop7ow7ykEEX0Yqw0r8lqKoFAl+ALRwACgkQ0Yqw0r8l
qKqWrxAAn5zyRLk+uuFjMlLoCrGdx0kxACTK8jdHRScMeg9py/U9W30jHRUfwtNq
Q86nQPtD6z16C4fUir11Z9kOrewf6HHPAlgePUwXkLz89RtQa6HFvK1qxfCCsrH4
JnJQgZW9wz+PhcesWxp6dAAgP/MpMRsJYeWSJPP5+yUqwnmXf9yMnRWBbY3hToXT
T79dtUZLr2aDhudn1HEEQlJRtPvaT+Dipl6LvUIQhphqHS4BBHeCDghUI3q6ujvv
SJaqKCCpw2chTQsY+StDPmUEyLyXZYHqgImo0RWd9bPJdOas2qXf9POEuRXU6hZ4
7/FJNRMEUhdgUpWrNlWrE3RRvSxxH9GLZ/xKKxaCFk+mb5rrjBu/JcZFHhqcYZC9
XmFayujD+Tl795KMhO/rC8S/CK7tm2Zy5IMXRivGXJwM7ot+yrZe8GaZ8+HTZYxA
AcTtzaqMXURahv1V0uc87BKR9qXimfh8gnDzfOaaWYNsBiidf1CDts1lVWPHURnX
CacfrpLXVxvdwIqa7JYpEqBAU1Wz3mg/EGT4NFg8XR41OQLqyfPKDcDEi4zQpHIo
mMpPkipL++ElqD9tncNm/LPe0V1VUj+aoJDQJz8JQzikWgmH7+2jGnWfN8kIWwMm
UZu/X2p7O/xi9dwOI6txU0zhAAp7Ri7ZUYnm8ild0BvmIhBq+/I=
=JD24
-----END PGP SIGNATURE-----

--xomb6hfbdvc3tupk--