From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0806615800A for ; Wed, 12 Jul 2023 12:26:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80E44E087A; Wed, 12 Jul 2023 12:25:13 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 45D6BE0875 for ; Wed, 12 Jul 2023 12:25:13 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass Date: Wed, 12 Jul 2023 14:22:55 +0200 Message-ID: <20230712122503.309626-5-mgorny@gentoo.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712122503.309626-1-mgorny@gentoo.org> References: <20230712122503.309626-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 4fe702ba-19ab-4f6e-a5fe-6f46ffe8f514 X-Archives-Hash: d2f8f4f45ee4f7c2dc3d461d517d3521 Strip LTO flags when cargo.eclass is inherited. This means that Rust extensions are being built, and linking them with C/C++ style LTO results in broken shared libraries. Closes: https://bugs.gentoo.org/910220 Signed-off-by: Michał Górny --- eclass/distutils-r1.eclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 924e83b54ad8..5f2decaa89a3 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -191,6 +191,7 @@ esac if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then _DISTUTILS_R1_ECLASS=1 +inherit flag-o-matic inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -1836,6 +1837,12 @@ distutils-r1_run_phase() { local -x CYTHON_FORCE_REGEN=1 fi + # Rust extensions are incompatible with C/C++ LTO compiler + # see e.g. https://bugs.gentoo.org/910220 + if [[ ${_CARGO_ECLASS} ]]; then + filter-lto + fi + # How to build Python modules in different worlds... local ldopts case "${CHOST}" in -- 2.41.0