From fa1113f44e2e51c731ee8a5b1d0b216b2daeb4e8 Mon Sep 17 00:00:00 2001 From: Eric Joldasov Date: Fri, 7 Mar 2025 00:38:29 +0500 Subject: [PATCH] profiles: force llvm USE-flag for Zig on unsupported targets Add an allowlist of targets where Zig can bootstrap itself without LLVM, and allow disabling `llvm` USE-flag only on that targets. Saves users from cryptic errors when they unknowingly try to use it on ARM or other architecture, and help a little bit with future keywording. Signed-off-by: Eric Joldasov Closes: https://github.com/gentoo/gentoo/pull/40948 Signed-off-by: Sam James --- profiles/arch/amd64/package.use.force | 6 +++++- profiles/arch/base/package.use.force | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 profiles/arch/base/package.use.force diff --git a/profiles/arch/amd64/package.use.force b/profiles/arch/amd64/package.use.force index da5032b5b2ecf..4d23ba1334288 100644 --- a/profiles/arch/amd64/package.use.force +++ b/profiles/arch/amd64/package.use.force @@ -1,6 +1,10 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Eric Joldasov (2025-03-11) +# "x86_64" backend can succesfully bootstrap itself for Linux. +>=dev-lang/zig-0.13 -llvm + # James Le Cuirot (2024-07-02) # Needed to build gcc. Force here rather than using BDEPEND to simplify # cross-compile scenarios. diff --git a/profiles/arch/base/package.use.force b/profiles/arch/base/package.use.force new file mode 100644 index 0000000000000..7914b1aeb2ca2 --- /dev/null +++ b/profiles/arch/base/package.use.force @@ -0,0 +1,10 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Eric Joldasov (2025-03-11) +# Force building Zig with LLVM extensions enabled. Non-LLVM backends +# are in active development, and while some backends progressed enough +# to build some simple or complex program, only small amount of them +# can succesfully bootstrap Zig. +# Unforce on targets where it's possible to bootstrap without LLVM. +dev-lang/zig llvm