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 C02D3158020 for ; Sat, 29 Oct 2022 16:01:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6157CE08BB; Sat, 29 Oct 2022 16:01:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 EC7CDE0869 for ; Sat, 29 Oct 2022 16:01:09 +0000 (UTC) Message-ID: <4611bfea-b23b-126f-3c84-2b6973115ebd@gentoo.org> Date: Sat, 29 Oct 2022 18:00:52 +0200 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 To: gentoo-dev@lists.gentoo.org Content-Language: en-US From: Piotr Karbowski Subject: [gentoo-dev] Multiple LLVM versions with single sys-devel/lld. How to match runtime? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 66eb0432-76e8-43f2-9f62-4ffb8140898e X-Archives-Hash: 2de9a67f09a6b0dcc091019a9f4cdacd Hi, The state for this very moment is that we can have many versions of llvm around, however we can at most have only one ld.lld installed. Usually matching the lowest version of clang installed. THis leads to build failures if one attempts to build some (but not all) software, Linux kernel being one of them. Currently if one have installed clang in 15 and 14 version, and ld.lld in 14, and attempt to build Linux kernel with simple 'make LLVM=1' it will fail on the mismatch between clang and ld.lld with "Opaque pointers are only supported in -opaque-pointers mode". This can be easily handled by doing 'make LLVM=1 CC=clang-14'. Now, the problem is with kernel modules that are in ::gentoo. One of the examples is ryzen_smu that has github's PR to support kernels built with clang and lto enabled. I might be not really up to the speed with llvm in gentoo, but it appears to me we have no interface to get matching clang+lld paths that could be callable like ts-getCC is. Setting CC=${CHOST}-clang when kernel's config has LLVM toggled will result in crash due to ld.lld mismatch, easy workaround would be to set $PATH before calling emerge so it would first find the matching 14 version, however emerge will build its own $PATH, ignoring whatever we provided there. Which means one would either need to write a code in ebuild to get lld version and then set CC to ${CHOST}-clang-${LLD_MAJOR_VERSION} or have similar code in /etc/portage/bashrc, neither of which are particularly appealing to me even though it's rather simple to get the version out of ld.lld. Before I invent such a atrocious code in ebuild, do you perhaps have any solution that is somewhat more reasonable than ebuild doing backflips to figure out working toolchain combination? -- Piotr.