From patchwork Wed Jan 18 14:49:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 46268 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 833AB27BBEB; Wed, 18 Jan 2023 14:51:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B0E1C27BBE9 for ; Wed, 18 Jan 2023 14:51:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI9mM-0007gB-TP; Wed, 18 Jan 2023 09:51:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI9mJ-0007fB-Cz for guix-patches@gnu.org; Wed, 18 Jan 2023 09:51:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI9mI-0005KP-CU for guix-patches@gnu.org; Wed, 18 Jan 2023 09:51:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pI9mH-0004vW-Ri for guix-patches@gnu.org; Wed, 18 Jan 2023 09:51:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60934] [CORE-UPDATES PATCH] gnu: mesa: Use smaller llvm backend. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 Jan 2023 14:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60934 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60934@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Efraim Flashner X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167405342318873 (code B ref -1); Wed, 18 Jan 2023 14:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jan 2023 14:50:23 +0000 Received: from localhost ([127.0.0.1]:39993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI9le-0004uL-LT for submit@debbugs.gnu.org; Wed, 18 Jan 2023 09:50:23 -0500 Received: from lists.gnu.org ([209.51.188.17]:53050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI9ld-0004uC-0j for submit@debbugs.gnu.org; Wed, 18 Jan 2023 09:50:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI9lc-0007Sq-3e for guix-patches@gnu.org; Wed, 18 Jan 2023 09:50:20 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI9lX-00057q-Ke; Wed, 18 Jan 2023 09:50:17 -0500 Received: by mail-ej1-x62b.google.com with SMTP id az20so64728039ejc.1; Wed, 18 Jan 2023 06:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=MhuyZQE5B3jYrjCGzDPbq6eg1xydjwenNic5jJ5tY2Y=; b=X3FO7BhjufpNr2jtrvquUIPZEmpFj0A7LPOL3qhlBSuSmqzJoiRcO78SKZY+6VPHIt mkquNXUpaQr0gFAo2EFbmDWLp3kyjzmYKQQcN/JDFURf/QFPRCMsmdzMVFkTBWVW/f3r hhXnjga/xJSI/bo6/UoK7G5r/wZ3lmb8eKcPp0yoX+3L2ODyfvD7jiQ/DMVep4GuiPLV 46RB/dk+QBlampETSAx9AOKXZJk22lZ2hZberj+4c5FFKuPf/AYBoJKM9bN5+zwgcC7z CoA/vVVXWyLscAMD+yJz1ZT5GXE461OOZZLOik9mlnjJiyaImE/bwiiJ5a9CaUVKTVX2 tCig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MhuyZQE5B3jYrjCGzDPbq6eg1xydjwenNic5jJ5tY2Y=; b=Q3m68eBw6GoH0jV5FphUhtmah3Ak9PbfgCueAPCl3BCvnccAxae9m43wSWBFGL04G9 66YcX6YbHqq9ZiyGh8ZLRVEH8fydp3VRmCbnhp4YE85I0LBUbf5rnepp5kkFKrTrNz4z fglsdoKkkUBH3i61LrCg432hXVqLXdGpdgNP92Hb5SKYXhHpCCu50La4BYHXbf1vuwuI QLxi+f2lbXSx0QrvPaFa8M7JfX7akK0qc7odbANiFnUHSXsDL6g7CeLEjYgFE7+z49gI TidsRW1RoiAat1HOn2rJvP8DgIQz7/9tkLXuqIDaPwD36d43ZVOVq3X7MRI22Zj6Sb7q bQDA== X-Gm-Message-State: AFqh2kqQNmdkZLj/WR8BYlWcDh2mwqZNmrf2MLn10Spyu3DObM7bcDVA J+PcXeI8l8thE2rln39TQF/nQr5XEj6i4g== X-Google-Smtp-Source: AMrXdXtlWszFBib2fy4krYTMyIEmgsNxSA3Pefq1eu/rce6sLJ0PZHn+xbGjvRltEOhfQqf92JssQQ== X-Received: by 2002:a17:907:c11:b0:844:79b1:ab36 with SMTP id ga17-20020a1709070c1100b0084479b1ab36mr28482209ejc.25.1674053411451; Wed, 18 Jan 2023 06:50:11 -0800 (PST) Received: from localhost ([2a02:ed3:910:1100:b62e:99ff:fef0:7bc0]) by smtp.gmail.com with ESMTPSA id hr35-20020a1709073fa300b00877557ae644sm1156009ejc.71.2023.01.18.06.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 06:50:10 -0800 (PST) From: Efraim Flashner Date: Wed, 18 Jan 2023 16:49:59 +0200 Message-Id: <74f9211b057dcd50bee26f45d240f63f05db55cb.1674053238.git.efraim@flashner.co.il> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=efraim.flashner@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/gl.scm (mesa)[inputs]: Replace llvm with llvm-for-mesa. * gnu/packages/llvm.scm (llvm-for-mesa): New variable. --- I wasn't able to tweak this to be able to build a cross compiled mesa. I was able to build and run glxgears on core-updates with this patch applied. gnu/packages/gl.scm | 5 ++--- gnu/packages/llvm.scm | 49 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 4 deletions(-) base-commit: b8d684af76a41f5856b73640eb6f21940f214497 prerequisite-patch-id: 32cb914a2879991546162c9c87e371e7faf56c27 prerequisite-patch-id: 322468b8512360f3addd2e9788a3b53166fc3997 prerequisite-patch-id: 7b9e82394c1c3b8f7cb04ed14c6c17e7e6a19020 diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index dd62fac13e..bce2aead4c 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver ;;; Copyright © 2016 Nikita ;;; Copyright © 2016, 2017, 2018, 2020, 2021 Ricardo Wurmus -;;; Copyright © 2017, 2018, 2019, 2021 Efraim Flashner +;;; Copyright © 2017-2019, 2021, 2023 Efraim Flashner ;;; Copyright © 2017 Arun Isaac ;;; Copyright © 2017, 2018, 2019 Rutger Helling ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice @@ -298,8 +298,7 @@ (define-public mesa libxml2 libxrandr libxvmc - ;; Note: update the 'clang' input of mesa-opencl when bumping this. - llvm + llvm-for-mesa wayland wayland-protocols)) (native-inputs diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index b46cb06443..2296647969 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -7,7 +7,7 @@ ;;; Copyright © 2017 Roel Janssen ;;; Copyright © 2018–2022 Marius Bakke ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice -;;; Copyright © 2018, 2021, 2022 Efraim Flashner +;;; Copyright © 2018, 2021-2023 Efraim Flashner ;;; Copyright © 2018 Tim Gesthuizen ;;; Copyright © 2018 Pierre Neidhardt ;;; Copyright © 2019 Rutger Helling @@ -1886,6 +1886,53 @@ (define-public emacs-clang-rename ;;; LLVM variants. ;;; +(define-public llvm-for-mesa + ;; Note: update the 'clang' input of mesa-opencl when bumping this. + (let ((base-llvm llvm-13)) + (package + (inherit base-llvm) + ;; If we can separate out the include directory we'd save another 23MB. + (outputs (list "out")) + (version (package-version base-llvm)) + (arguments + (substitute-keyword-arguments (package-arguments base-llvm) + ((#:configure-flags _ ''()) + #~(list + ;; AMDGPU is needed by the vulkan drivers. + #$(string-append "-DLLVM_TARGETS_TO_BUILD=" + (system->llvm-target) ";AMDGPU") + "-DLLVM_BUILD_TOOLS=NO" + "-DLLVM_BUILD_LLVM_DYLIB=YES" + "-DLLVM_LINK_LLVM_DYLIB=YES" + "-DLLVM_ENABLE_RTTI:BOOL=TRUE")) + ((#:phases phases '%standard-phases) + #~(modify-phases #$phases + (add-after 'install 'delete-static-libraries + (lambda* (#:key outputs #:allow-other-keys) + (for-each delete-file + (find-files (string-append + (assoc-ref outputs "out") "/lib") + "\\.a$")))) + ;; We don't need it for this version. + (replace 'install-opt-viewer + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (delete-file-recursively + (string-append out "/share/opt-viewer"))))) + (add-after 'install 'build-and-install-llvm-config + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (substitute* + "tools/llvm-config/CMakeFiles/llvm-config.dir/link.txt" + (((string-append "/tmp/guix-build-llvm-" + #$version ".drv-0/build/lib")) + (string-append out "/lib"))) + (invoke "make" "llvm-config") + (install-file "bin/llvm-config" + (string-append out "/bin"))))))))) + (properties `((hidden? . #t) + ,@(package-properties base-llvm)))))) + (define make-ocaml-llvm ;; Make it a memoizing procedure so its callers below don't end up defining ;; two equal-but-not-eq "ocaml-llvm" packages for the default LLVM.