From unknown Sat Jun 21 04:59:43 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#73413 <73413@debbugs.gnu.org> To: bug#73413 <73413@debbugs.gnu.org> Subject: Status: [PATCH 0/3] Update cling to 1.1 and wrap with GCC include paths Reply-To: bug#73413 <73413@debbugs.gnu.org> Date: Sat, 21 Jun 2025 11:59:43 +0000 retitle 73413 [PATCH 0/3] Update cling to 1.1 and wrap with GCC include pat= hs reassign 73413 guix-patches submitter 73413 Maxim Cournoyer severity 73413 normal tag 73413 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 12:23:40 2024 Received: (at submit) by debbugs.gnu.org; 21 Sep 2024 16:23:41 +0000 Received: from localhost ([127.0.0.1]:40245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss2tY-0001Ce-HV for submit@debbugs.gnu.org; Sat, 21 Sep 2024 12:23:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:47472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss2tW-0001CU-F3 for submit@debbugs.gnu.org; Sat, 21 Sep 2024 12:23:39 -0400 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 1ss2tB-0006XC-02 for guix-patches@gnu.org; Sat, 21 Sep 2024 12:23:17 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ss2t9-0000Rs-Jb for guix-patches@gnu.org; Sat, 21 Sep 2024 12:23:16 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-7198de684a7so2341188b3a.2 for ; Sat, 21 Sep 2024 09:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726935793; x=1727540593; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RLV7919tiJzgU3HhobqmMejWBmUu7iHThIiAIooMwZY=; b=IVYHq3pf7qY+KBGrrIxbMrI9zJddC0O6w2UKck3W/Uxb9Ddc/t6mD+dnOUHm3nUwZy QU5J5dX+qzqfUSvM7uQh9L026g2iMAK+MXSdBKpBP5lz2p+jPNe+gTrF/5bmnkpWUZyy 7X14Ho1PH0z4vquo2pCqG+ImumgwNFSL21thXuf8Zy1jWAXLel73iNHh9juuNoNxkHkB cdenpz9UB103EMzsLWcvuyJ1f8TAKAeoUVju4WrwKAfkVxK0thiQ6CM9agkevV8pay1d IEaVELoYm/ZAC0WjAQSv0iAkR3SyMpBOTQkglRgV+czg02mDRuzRZ3FVxyjB6XlHGWVF Ad1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726935793; x=1727540593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RLV7919tiJzgU3HhobqmMejWBmUu7iHThIiAIooMwZY=; b=uboP+9QPnlT3Oreek9Dwhe6TfgR6dcsW5e0LXuookEewYWEMdu7q4ypEVaOTb+L5l0 /56dzXlZDEBd8ahxBhB+sYgrpyTKb7HSH3UvrTYUshIu14JiBavG9UEhrIEoDhEaEbcN jj2FZAUxQleHhcAH34Gda4QL6V5AGNmmZLnGX7TVZfxbm6H3Wq8NTRrvOehVWRaj6J9+ xsl8WSJvv/305Fcc0+Y6m7AWyayYUcTb+nM/VRUHV6Fokh5sT1PrrpnyN+q9qBTLchm/ OavWRpmpWCXljkSk4XmVtn4MQ9F/1wg44fSz3i4J5R8EtH1Vur7SWomrFkETw9nTbfQC TN/g== X-Gm-Message-State: AOJu0YzvghQYGhmF62FbL4t/KCbgy7irlT2h6PiIOyKTvfZD9zLdLr/1 Bbx0nqr316RO8gPm+/7wIdJlhJnOQfvQdqAu81A0eyfr8621fwyKdbcg5Q== X-Google-Smtp-Source: AGHT+IHw1X+QC69kllxWwynKEOthJVUlxA2L6Bond6IW0UHiKLeDFjzFwK+JDU27yqEOlVmOZAfpxg== X-Received: by 2002:a05:6a00:c90:b0:710:6f54:bc9c with SMTP id d2e1a72fcca58-7199cd7a3b1mr8855080b3a.2.1726935792752; Sat, 21 Sep 2024 09:23:12 -0700 (PDT) Received: from hurd.lan ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7db4ad07d62sm10872789a12.47.2024.09.21.09.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 09:23:12 -0700 (PDT) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/3] Update cling to 1.1 and wrap with GCC include paths Date: Sun, 22 Sep 2024 01:23:02 +0900 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This series does two things: 1. Update the cling package and its related inputs 2. Fix cling crashing when wrong or missing GCC includes were not provided. Cling is built to use the specific GCC version it knows from at build time; the headers available should match that version. Wrapping cling with the gcc-toolchain ones ensures it works correctly out of the box, without the user having to know to manually match the right GCC (such as in 'guix shell cling gcc-toolchain@11'). Maxim Cournoyer (3): gnu: cling: Wrap with GCC include paths. gnu: cling: Update to 1.1. gnu: cling: Reduce closure by 236 MiB. gnu/local.mk | 4 - gnu/packages/llvm.scm | 99 ++++---- .../clang-cling-13-libc-search-path.patch | 96 -------- ...g-cling-13-remove-crypt-interceptors.patch | 214 ------------------ ...g-cling-runtime-13-glibc-2.36-compat.patch | 50 ---- .../patches/cling-use-shared-library.patch | 107 --------- 6 files changed, 56 insertions(+), 514 deletions(-) delete mode 100644 gnu/packages/patches/clang-cling-13-libc-search-path.patch delete mode 100644 gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch delete mode 100644 gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch delete mode 100644 gnu/packages/patches/cling-use-shared-library.patch base-commit: 2c54c2db410ebdda8cd71716315e4ea4d31befbd -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 12:36:37 2024 Received: (at 73413) by debbugs.gnu.org; 21 Sep 2024 16:36:37 +0000 Received: from localhost ([127.0.0.1]:40259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss364-0001yC-QS for submit@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:37 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:50515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss362-0001xs-As for 73413@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:35 -0400 Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2d88edf1340so2180824a91.1 for <73413@debbugs.gnu.org>; Sat, 21 Sep 2024 09:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726936507; x=1727541307; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=icUeS+POsGuRgzdRy4jjayyO0WwltzkucsCmAFrZxX8=; b=UOWdn3TeCHfPq+HUzSqbm9qbX3tsbtMM9RPUl9Z36/FvP8K6OAKaoVroYhjVENUjG0 ViYCVigqDw6MlLXtGcN3UV5gUEImLSx1mVTkon2++10tPOYf0eSmvzsVcRlP/Ut4JBtG anKcTLVKe4INHtxial6diGRmjCyJ4Id7JuwcXGpkzbnXTfN87cRcbq9aIn8tqqnDalyb cH3h0eAKDRJ3Wqqm5kL6xdLlbXU62VPGyQ1psxydgGFD1T4sHzbwyXRFAd5jwfwtdbUl LdF4gAT8MhowcKQl6zmzUOPRluHBmvT9EWSRS6yboSdpvGQ2R63x1uUXsbCGedl2c7bK Fq7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726936507; x=1727541307; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=icUeS+POsGuRgzdRy4jjayyO0WwltzkucsCmAFrZxX8=; b=C51jOGNj6A5E/SdGOvmrD0l3ASXWhkZDIH/l8cVBbRpmdpwZRSkbyHm6ONfc4Mrr0W 0WzP8jKIOsZ6DJZzGD/8G3jgc4k/yX1xD72sTbn0hsemGwNtqP7C70n1kymYwWLpf4Gb +PD6A7iFTWsu5Ba6X3jfWySBfGqfNdv4aZ3Hl+zP5YyB7IbRDd5Vk7AJzR5Tjj5yu5VK ViJFuQY6NNk3YY1tvQpJ5dS6e0bEL/W/7sEbnfGZfhNgkb7RQtZvsXatUa4dfdVTOPwB CQBFu+3jxFMXNoQEKCJiLXinVHid6eTEPoPgvKGNpc5Kp6z6V0eW3HOJzoUvDNMpawjm o/cw== X-Gm-Message-State: AOJu0YzL8c3I3EJV1pPofnmBEreVO89GFnT/wgvf04+fv4sO8Pvf19iD AVbDgMm7Se9F4cXO7nBGkM/GiPor+4X2sw9BtPCLPKFC7lQcOr1lnmauQg== X-Google-Smtp-Source: AGHT+IEUfeXFW15KBL2T2z9K87AkFfmbp/doP8V1pjLbJPa7S+mw2uMqtFG7UvPH5s2vnj4uWggE/Q== X-Received: by 2002:a17:90b:1344:b0:2d8:ad96:6ef4 with SMTP id 98e67ed59e1d1-2dd7f708a20mr9173228a91.28.1726936506864; Sat, 21 Sep 2024 09:35:06 -0700 (PDT) Received: from hurd.lan ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef3c64fsm6235289a91.38.2024.09.21.09.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 09:35:06 -0700 (PDT) From: Maxim Cournoyer To: 73413@debbugs.gnu.org Subject: [PATCH 1/3] gnu: cling: Wrap with GCC include paths. Date: Sun, 22 Sep 2024 01:32:25 +0900 Message-ID: <49c179bdd2979a38122e7f06464557d69857eab8.1726935737.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73413 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (cling) [phases] : Do not patch CLING_CXX_RLTV anymore; this is now handled more correctly by wrapping the 'cling' executable. Adjust file name of clang lib directory. : New phases. [inputs]: Add gcc-toolchain*, a delayed version of gcc-toolchain, used in the wrap phase. Fixes: https://issues.guix.gnu.org/57116 Change-Id: I29f9eee8f4a0e91eadc2eeff2a70d58db3ed0a26 --- gnu/packages/llvm.scm | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 2ee1cf21c3..91fe9e7882 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -2390,12 +2390,6 @@ (define-public cling (substitute* "lib/Interpreter/CIFactory.cpp" (("\\bsed\\b") (which "sed")) - ;; This ensures that the default C++ library used by Cling is - ;; that of the compiler that was used to build it, rather - ;; than that of whatever g++ happens to be on PATH. - (("ReadCompilerIncludePaths\\(CLING_CXX_RLTV") - (format #f "ReadCompilerIncludePaths(~s" - (search-input-file inputs "bin/g++"))) ;; Cling uses libclang's CompilerInvocation::GetResourcesPath ;; to resolve Clang's library prefix, but this fails on Guix ;; because it is relative to the output of cling rather than @@ -2427,9 +2421,28 @@ (define-public cling (add-after 'install 'delete-static-libraries ;; This reduces the size from 17 MiB to 5.4 MiB. (lambda _ - (for-each delete-file (find-files #$output "\\.a$"))))))) + (for-each delete-file (find-files #$output "\\.a$")))) + (add-after 'install 'wrap-with-include-paths + ;; Cling is sensitive to miss-matched include directives; ensure + ;; the GCC includes used match that of the GCC used to build + ;; Cling. + (lambda* (#:key inputs #:allow-other-keys) + (let ((gcc-toolchain #$(this-package-input "gcc-toolchain"))) + (wrap-program (string-append #$output "/bin/cling") + `("C_INCLUDE_PATH" prefix + (,(string-append gcc-toolchain "/include"))) + `("CPLUS_INCLUDE_PATH" prefix + (,(string-append gcc-toolchain "/include/c++") + ,(string-append gcc-toolchain "/include"))))))) + (add-after 'wrap-with-include-paths 'fix-wrapper + (lambda _ + ;; When -a $0 is used, the cling executable segfauts (see: + ;; https://issues.guix.gnu.org/73405). + (substitute* (string-append #$output "/bin/cling") + (("\"\\$0\"") + "\"${0##*/}\""))))))) (native-inputs (list python python-lit)) - (inputs (list clang-cling llvm-cling libxcrypt)) + (inputs (list clang-cling (force gcc-toolchain*) llvm-cling libxcrypt)) (home-page "https://root.cern/cling/") (synopsis "Interactive C++ interpreter") (description "Cling is an interactive C++17 standard compliant -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 12:36:42 2024 Received: (at 73413) by debbugs.gnu.org; 21 Sep 2024 16:36:42 +0000 Received: from localhost ([127.0.0.1]:40262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss368-0001yU-FK for submit@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:42 -0400 Received: from mail-pg1-f175.google.com ([209.85.215.175]:52241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss365-0001xy-9v for 73413@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:39 -0400 Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7d4fbe62bf5so1856782a12.0 for <73413@debbugs.gnu.org>; Sat, 21 Sep 2024 09:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726936510; x=1727541310; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7G0fpNnWXeEsmBSqSU4oE/iA1JIXacMx42rzo/I7aCg=; b=jXyAaoLBMWF7eGMc5hOYDWR50CKNDfw8NLqLw8VbiJSrVukpJDufg90NrXA81BdERb 6J/fULHv7yB1z7zZQJveYDlptN/9lLJDAvTB+sF7V18DCPctWtQRRbabe8Rwfchy4d0+ 5L6aZASfcBbfXBLKjEHn/e5w0VVtehzaCmtbkSgdSBpy37ugY33lnm2r/w1cfXVVn9jx t97IbYpV1Rd4sozLziGIJYxDtBpxvlO1EuE6De/9sGXKtbOyDZQTcducjHtjeXoNzkQ2 YumPJteMIX9xadm71T8fXT9gLDgD1umwpeBTTVGvt18hmE5rpMliTZDdZ4aF+jRFRnaP EAwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726936510; x=1727541310; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7G0fpNnWXeEsmBSqSU4oE/iA1JIXacMx42rzo/I7aCg=; b=tOU8vtTRPRRMlTqbNgW22DB4upQ6woo6hoMvwVMkHn6bXRpjv05n4EmlaqzY0qmOu5 rhTc2ekmvjQEGvU1QXMF6Jb5I0d7yY9Je88ahDSbZgQwc9hGI/EsalO8/hfGaoHB6fPt TMfXzwqPH1wNQD+H1cJyPppLWuphWHI/XiYxUZ7KzdEm5gc9AWPfiIX5gzjYGyQnuUof 8kBOEFSR56vsSTWRdU754SWRPLlOzRILCx/CBwvq1JDt+ypxGkSxkrfZxKGrerlp0ONC /nASU5AWIzM/3rHjK65paeDtlm1+yly/MCo212GC0F1pxNR9BOTSv6ngwuaD60Ynzma0 OCGA== X-Gm-Message-State: AOJu0YzWGHuGu70jarctpL9qTAZLSqazeKp4FQGU6FjR4aEhkQxpIcLG N7xDCXo1xsaNrmgh5ExJ3wb47787eaM9SksgZuXdg3UnKRfFdnA+Lil2dg== X-Google-Smtp-Source: AGHT+IHyX60fFL3FhMrcMNi95adJ9qgEtaQt2b28eUDP7m5gw8M+VCFcd45mlxsLv0TDHXq7jDCm+g== X-Received: by 2002:a17:90b:4b83:b0:2d3:d68e:e8d8 with SMTP id 98e67ed59e1d1-2dd7f752757mr6806443a91.40.1726936509897; Sat, 21 Sep 2024 09:35:09 -0700 (PDT) Received: from hurd.lan ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef3c64fsm6235289a91.38.2024.09.21.09.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 09:35:09 -0700 (PDT) From: Maxim Cournoyer To: 73413@debbugs.gnu.org Subject: [PATCH 2/3] gnu: cling: Update to 1.1. Date: Sun, 22 Sep 2024 01:32:26 +0900 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 73413 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) * gnu/packages/llvm.scm (llvm-cling-base): New variable (llvm-cling): Use it. Update to version 16-20240621-02. [source]: Delete patches. (clang-cling-runtime): Base on clang-runtime-16. [phases]: Delete change-directory phase. (clang-cling): Base on clang-16. [phases]: Delete change-directory and delete-static-libraries phases (the later would cause CMake to fail due to baking the static targets in). (cling): Update to 1.1. [source]: Delete patches. [arguments] <#:tests?>: Reference upstream discussion in comment. [phases] : Adjust file name of clang lib directory. : New phase. [native-inputs]: Add clang-cling, used by the test suite. * gnu/packages/patches/clang-cling-13-libc-search-path.patch * gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch * gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch * gnu/packages/patches/cling-use-shared-library.patch: Delete files. * gnu/local.mk (dist_patch_DATA): De-register deleted files. Change-Id: Ia8b58188ad9de2795a52289bd46ed15a8e722bfa --- gnu/local.mk | 4 - gnu/packages/llvm.scm | 63 +++--- .../clang-cling-13-libc-search-path.patch | 96 -------- ...g-cling-13-remove-crypt-interceptors.patch | 214 ------------------ ...g-cling-runtime-13-glibc-2.36-compat.patch | 50 ---- .../patches/cling-use-shared-library.patch | 107 --------- 6 files changed, 28 insertions(+), 506 deletions(-) delete mode 100644 gnu/packages/patches/clang-cling-13-libc-search-path.patch delete mode 100644 gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch delete mode 100644 gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch delete mode 100644 gnu/packages/patches/cling-use-shared-library.patch diff --git a/gnu/local.mk b/gnu/local.mk index a092122d22..0a21831a17 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1070,9 +1070,6 @@ dist_patch_DATA = \ %D%/packages/patches/clang-17.0-libc-search-path.patch \ %D%/packages/patches/clang-17.0-link-dsymutil-latomic.patch \ %D%/packages/patches/clang-18.0-libc-search-path.patch \ - %D%/packages/patches/clang-cling-13-libc-search-path.patch \ - %D%/packages/patches/clang-cling-13-remove-crypt-interceptors.patch \ - %D%/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/clang-runtime-13-glibc-2.36-compat.patch \ @@ -1086,7 +1083,6 @@ dist_patch_DATA = \ %D%/packages/patches/clasp-hide-event-ids.patch \ %D%/packages/patches/classpath-aarch64-support.patch \ %D%/packages/patches/classpath-miscompilation.patch \ - %D%/packages/patches/cling-use-shared-library.patch \ %D%/packages/patches/clitest-grep-compat.patch \ %D%/packages/patches/clog-fix-shared-build.patch \ %D%/packages/patches/clucene-pkgconfig.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 91fe9e7882..bdd805c59f 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -67,6 +67,7 @@ (define-module (gnu packages llvm) #:use-module (gnu packages compression) #:use-module (gnu packages libedit) #:use-module (gnu packages libffi) + #:use-module (gnu packages linux) #:use-module (gnu packages llvm-meta) #:use-module (gnu packages lua) #:use-module (gnu packages mpi) @@ -86,6 +87,11 @@ (define-module (gnu packages llvm) #:export (make-lld-wrapper system->llvm-target)) +;; Lazily resolve the gcc-toolchain to avoid a circular dependency. +(define gcc-toolchain* + (delay (module-ref (resolve-interface '(gnu packages commencement)) + 'gcc-toolchain))) + (define* (system->llvm-target #:optional (system (or (and=> (%current-target-system) gnu-triplet->nix-system) @@ -2281,15 +2287,15 @@ (define-public llvm-julia (properties `((hidden? . #t) ,@(package-properties llvm-13))))) +(define llvm-cling-base llvm-16) + (define llvm-cling - ;; To determine which version of LLVM a given release of Cling should use, - ;; consult the - ;; https://raw.githubusercontent.com/root-project/cling/master/LastKnownGoodLLVMSVNRevision.txt - ;; file. - (let ((base llvm-15)) ;for a DYLIB build + (let ((base llvm-cling-base)) (package/inherit base (name "llvm-cling") - (version "13-20240318-01") + ;; Use the latest tag for the major LLVM version currently targeted by + ;; Cling (often mentioned in Cling's release notes). + (version "16-20240621-02") (source (origin (inherit (package-source base)) @@ -2300,14 +2306,10 @@ (define llvm-cling (file-name (git-file-name "llvm-cling" version)) (sha256 (base32 - "1zh6yp8px9hla7v9i67a6anbph140f8ixxbsz65aj7fizksjs1h3")) - (patches (search-patches - "clang-cling-13-libc-search-path.patch" - "clang-cling-runtime-13-glibc-2.36-compat.patch" - "clang-cling-13-remove-crypt-interceptors.patch"))))))) + "05libb4mc385n8sq0bilalvidwzzrcyiqsfkn7j179kkx66a8rzy"))))))) (define clang-cling-runtime - (let ((base clang-runtime-13)) + (let ((base clang-runtime-16)) (package/inherit base (name "clang-cling-runtime") (version (package-version llvm-cling)) @@ -2316,9 +2318,6 @@ (define clang-cling-runtime (substitute-keyword-arguments (package-arguments base) ((#:phases phases '%standard-phases) #~(modify-phases #$phases - (add-after 'unpack 'change-directory - (lambda _ - (chdir "compiler-rt"))) (add-after 'install 'delete-static-libraries ;; This reduces the size from 22 MiB to 4 MiB. (lambda _ @@ -2327,22 +2326,11 @@ (define clang-cling-runtime (replace "llvm" llvm-cling)))))) (define clang-cling - (let ((base clang-13)) + (let ((base clang-16)) (package/inherit base (name "clang-cling") (version (package-version llvm-cling)) (source (package-source llvm-cling)) - (arguments - (substitute-keyword-arguments (package-arguments base) - ((#:phases phases '%standard-phases) - #~(modify-phases #$phases - (add-after 'unpack 'change-directory - (lambda _ - (chdir "clang"))) - (add-after 'install 'delete-static-libraries - ;; This reduces the size by half, from 220 MiB to 112 MiB. - (lambda _ - (for-each delete-file (find-files #$output "\\.a$")))))))) (propagated-inputs (modify-inputs (package-propagated-inputs base) (replace "llvm" llvm-cling) @@ -2351,7 +2339,7 @@ (define clang-cling (define-public cling (package (name "cling") - (version "1.0") + (version "1.1") (source (origin (method git-fetch) (uri (git-reference @@ -2360,15 +2348,14 @@ (define-public cling (file-name (git-file-name name version)) (sha256 (base32 - "17n66wf5yg1xjc94d6yb8g2gydjz0b8cj4a2pn6xrygdvhh09vv1")) - ;; Patch submitted upstream here: - ;; https://github.com/root-project/cling/pull/433. - (patches (search-patches "cling-use-shared-library.patch")))) + "13ghbqjppvbmkhjgfk9xggxh17xpmx18ghdqgkkg9a3mh19hf69h")))) (build-system cmake-build-system) (arguments (list #:build-type "Release" ;keep the build as lean as possible - #:tests? #f ;FIXME: 78 tests fail (out of ~200) + ;; FIXME: 79 tests fail, out of ~200 (see: + ;; https://github.com/root-project/cling/issues/534) + #:tests? #f #:test-target "check-cling" #:configure-flags #~(list (string-append "-DCLING_CXX_PATH=" @@ -2405,7 +2392,7 @@ (define-public cling #$(first (take (string-split (package-version clang-cling) #\-) - 1)) ".0.0" ;e.g. 13.0.0 + 1)) ;e.g. 16.0.6 -> 16 "\");"))) ;; Check for the 'lit' command for the tests, not 'lit.py' ;; (see: https://github.com/root-project/cling/issues/432). @@ -2418,6 +2405,12 @@ (define-public cling (substitute* "test/lit.cfg" (("config.llvm_tools_dir \\+ '") "config.cling_obj_root + '/bin")))) + (add-before 'check 'set-CLANG + (lambda* (#:key native-inputs inputs #:allow-other-keys) + ;; Otherwise, lit fails with "fatal: couldn't find 'clang' + ;; program, try setting CLANG in your environment". + (setenv "CLANG" (search-input-file (or native-inputs inputs) + "bin/clang")))) (add-after 'install 'delete-static-libraries ;; This reduces the size from 17 MiB to 5.4 MiB. (lambda _ @@ -2441,7 +2434,7 @@ (define-public cling (substitute* (string-append #$output "/bin/cling") (("\"\\$0\"") "\"${0##*/}\""))))))) - (native-inputs (list python python-lit)) + (native-inputs (list clang-cling python python-lit)) (inputs (list clang-cling (force gcc-toolchain*) llvm-cling libxcrypt)) (home-page "https://root.cern/cling/") (synopsis "Interactive C++ interpreter") diff --git a/gnu/packages/patches/clang-cling-13-libc-search-path.patch b/gnu/packages/patches/clang-cling-13-libc-search-path.patch deleted file mode 100644 index c7d22eaaa3..0000000000 --- a/gnu/packages/patches/clang-cling-13-libc-search-path.patch +++ /dev/null @@ -1,96 +0,0 @@ -Clang attempts to guess file names based on the OS and distro (yes!), -but unfortunately, that doesn't work for us. - -This patch makes it easy to insert libc's $libdir so that Clang passes the -correct absolute file name of crt1.o etc. to 'ld'. It also disables all -the distro-specific stuff and removes the hard-coded FHS directory names -to make sure Clang also works on foreign distros. - -diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp -index ee4fe841..f0313bbe 100644 ---- a/clang/lib/Driver/Distro.cpp -+++ b/clang/lib/Driver/Distro.cpp -@@ -93,6 +93,10 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) { - } - - static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) { -+ // The compiler should always behave the same, even when used via Guix on a -+ // foreign distro. -+ return Distro::UnknownDistro; -+ - Distro::DistroType Version = Distro::UnknownDistro; - - // Newer freedesktop.org's compilant systemd-based systems -diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp b/clang/lib/Driver/ToolChains/Cuda.cpp -index d14776c5..88bc3ccd 100644 ---- a/clang/lib/Driver/ToolChains/Cuda.cpp -+++ b/clang/lib/Driver/ToolChains/Cuda.cpp -@@ -119,6 +119,9 @@ CudaInstallationDetector::CudaInstallationDetector( - const Driver &D, const llvm::Triple &HostTriple, - const llvm::opt::ArgList &Args) - : D(D) { -+ // Don't look for CUDA in /usr. -+ return; -+ - struct Candidate { - std::string Path; - bool StrictChecking; -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -186,6 +186,10 @@ - - Generic_GCC::PushPPaths(PPaths); - -+ // Comment out the distro-specific tweaks so that they don't bite when -+ // using Guix on a foreign distro. -+#if 0 -+ - Distro Distro(D.getVFS(), Triple); - - if (Distro.IsAlpineLinux() || Triple.isAndroid()) { -@@ -251,6 +255,7 @@ - - if (IsAndroid || Distro.IsOpenSUSE()) - ExtraOpts.push_back("--enable-new-dtags"); -+#endif - - // The selection of paths to try here is designed to match the patterns which - // the GCC driver itself uses, as this is part of the GCC-compatible driver. -@@ -264,6 +269,7 @@ - - Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths); - -+#if 0 - addPathIfExists(D, SysRoot + "/lib/" + MultiarchTriple, Paths); - addPathIfExists(D, SysRoot + "/lib/../" + OSLibDir, Paths); - -@@ -295,9 +301,11 @@ - addPathIfExists(D, SysRoot + "/" + OSLibDir + "/" + ABIName, Paths); - addPathIfExists(D, SysRoot + "/usr/" + OSLibDir + "/" + ABIName, Paths); - } -+#endif - - Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths); - -+#if 0 - // Similar to the logic for GCC above, if we are currently running Clang - // inside of the requested system root, add its parent library path to those - // searched. -@@ -305,9 +313,14 @@ - // directory ('Dir' below) or the ResourceDir. - if (StringRef(D.Dir).startswith(SysRoot)) - addPathIfExists(D, D.Dir + "/../lib", Paths); -+#endif -+ -+ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o, -+ // and friends can be found. -+ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths); - -- addPathIfExists(D, SysRoot + "/lib", Paths); -- addPathIfExists(D, SysRoot + "/usr/lib", Paths); -+ // Add GCC's lib/ directory so libstdc++.so can be found. -+ addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths); - } - - ToolChain::RuntimeLibType Linux::GetDefaultRuntimeLibType() const { diff --git a/gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch b/gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch deleted file mode 100644 index 23de47bb18..0000000000 --- a/gnu/packages/patches/clang-cling-13-remove-crypt-interceptors.patch +++ /dev/null @@ -1,214 +0,0 @@ -From d7bead833631486e337e541e692d9b4a1ca14edd Mon Sep 17 00:00:00 2001 -From: Fangrui Song -Date: Fri, 28 Apr 2023 09:59:17 -0700 -Subject: [PATCH] [sanitizer] Remove crypt and crypt_r interceptors - -From Florian Weimer's D144073 - -> On GNU/Linux (glibc), the crypt and crypt_r functions are not part of the main shared object (libc.so.6), but libcrypt (with multiple possible sonames). The sanitizer libraries do not depend on libcrypt, so it can happen that during sanitizer library initialization, no real implementation will be found because the crypt, crypt_r functions are not present in the process image (yet). If its interceptors are called nevertheless, this results in a call through a null pointer when the sanitizer library attempts to forward the call to the real implementation. -> -> Many distributions have already switched to libxcrypt, a library that is separate from glibc and that can be build with sanitizers directly (avoiding the need for interceptors). This patch disables building the interceptor for glibc targets. - -Let's remove crypt and crypt_r interceptors (D68431) to fix issues with -newer glibc. - -For older glibc, msan will not know that an uninstrumented crypt_r call -initializes `data`, so there is a risk for false positives. However, with some -codebase survey, I think crypt_r uses are very few and the call sites typically -have a `memset(&data, 0, sizeof(data));` anyway. - -Fix https://github.com/google/sanitizers/issues/1365 -Related: https://bugzilla.redhat.com/show_bug.cgi?id=2169432 - -Reviewed By: #sanitizers, fweimer, thesamesam, vitalybuka - -Differential Revision: https://reviews.llvm.org/D149403 ---- - .../sanitizer_common_interceptors.inc | 37 ------------------- - .../sanitizer_platform_interceptors.h | 2 - - .../sanitizer_platform_limits_posix.cpp | 8 ---- - .../sanitizer_platform_limits_posix.h | 1 - - .../TestCases/Linux/crypt_r.cpp | 36 ------------------ - .../TestCases/Posix/crypt.cpp | 32 ---------------- - 6 files changed, 116 deletions(-) - delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/Linux/crypt_r.cpp - delete mode 100644 compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc -index b30c91f06cfeb0..490a8b12d8b17d 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc -@@ -10086,41 +10086,6 @@ INTERCEPTOR(SSIZE_T, getrandom, void *buf, SIZE_T buflen, unsigned int flags) { - #define INIT_GETRANDOM - #endif - --#if SANITIZER_INTERCEPT_CRYPT --INTERCEPTOR(char *, crypt, char *key, char *salt) { -- void *ctx; -- COMMON_INTERCEPTOR_ENTER(ctx, crypt, key, salt); -- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1); -- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1); -- char *res = REAL(crypt)(key, salt); -- if (res != nullptr) -- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1); -- return res; --} --#define INIT_CRYPT COMMON_INTERCEPT_FUNCTION(crypt); --#else --#define INIT_CRYPT --#endif -- --#if SANITIZER_INTERCEPT_CRYPT_R --INTERCEPTOR(char *, crypt_r, char *key, char *salt, void *data) { -- void *ctx; -- COMMON_INTERCEPTOR_ENTER(ctx, crypt_r, key, salt, data); -- COMMON_INTERCEPTOR_READ_RANGE(ctx, key, internal_strlen(key) + 1); -- COMMON_INTERCEPTOR_READ_RANGE(ctx, salt, internal_strlen(salt) + 1); -- char *res = REAL(crypt_r)(key, salt, data); -- if (res != nullptr) { -- COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, -- __sanitizer::struct_crypt_data_sz); -- COMMON_INTERCEPTOR_INITIALIZE_RANGE(res, internal_strlen(res) + 1); -- } -- return res; --} --#define INIT_CRYPT_R COMMON_INTERCEPT_FUNCTION(crypt_r); --#else --#define INIT_CRYPT_R --#endif -- - #if SANITIZER_INTERCEPT_GETENTROPY - INTERCEPTOR(int, getentropy, void *buf, SIZE_T buflen) { - void *ctx; -@@ -10698,8 +10663,6 @@ static void InitializeCommonInterceptors() { - INIT_GETUSERSHELL; - INIT_SL_INIT; - INIT_GETRANDOM; -- INIT_CRYPT; -- INIT_CRYPT_R; - INIT_GETENTROPY; - INIT_QSORT; - INIT_QSORT_R; -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h -index eb39fabfd59839..c82ab5c2105621 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h -@@ -569,8 +569,6 @@ - #define SANITIZER_INTERCEPT_FDEVNAME SI_FREEBSD - #define SANITIZER_INTERCEPT_GETUSERSHELL (SI_POSIX && !SI_ANDROID) - #define SANITIZER_INTERCEPT_SL_INIT (SI_FREEBSD || SI_NETBSD) --#define SANITIZER_INTERCEPT_CRYPT (SI_POSIX && !SI_ANDROID) --#define SANITIZER_INTERCEPT_CRYPT_R (SI_LINUX && !SI_ANDROID) - - #define SANITIZER_INTERCEPT_GETRANDOM \ - ((SI_LINUX && __GLIBC_PREREQ(2, 25)) || SI_FREEBSD) -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -index a04eed7aa5a6e..6d61d276d77e3 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -@@ -142,5 +142,4 @@ - #include - #include - #include --#include - #endif // SANITIZER_ANDROID -@@ -243,7 +244,6 @@ - unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; - unsigned struct_rlimit64_sz = sizeof(struct rlimit64); - unsigned struct_statvfs64_sz = sizeof(struct statvfs64); -- unsigned struct_crypt_data_sz = sizeof(struct crypt_data); - #endif // SANITIZER_LINUX && !SANITIZER_ANDROID - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -index e6f298c26e1fb6..58244c9944a03a 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h -@@ -309,7 +309,6 @@ extern unsigned struct_msqid_ds_sz; - extern unsigned struct_mq_attr_sz; - extern unsigned struct_timex_sz; - extern unsigned struct_statvfs_sz; --extern unsigned struct_crypt_data_sz; - #endif // SANITIZER_LINUX && !SANITIZER_ANDROID - - struct __sanitizer_iovec { -diff --git a/test/sanitizer_common/TestCases/Linux/crypt_r.cpp b/test/sanitizer_common/TestCases/Linux/crypt_r.cpp -deleted file mode 100644 -index 69bfb46aa5f171..00000000000000 ---- a/compiler-rt/test/sanitizer_common/TestCases/Linux/crypt_r.cpp -+++ /dev/null -@@ -1,36 +0,0 @@ --// RUN: %clangxx -O0 -g %s -lcrypt -o %t && %run %t -- --// crypt.h is missing from Android. --// UNSUPPORTED: android -- --#include --#include --#include --#include -- --int main(int argc, char **argv) { -- { -- crypt_data cd; -- cd.initialized = 0; -- char *p = crypt_r("abcdef", "xz", &cd); -- volatile size_t z = strlen(p); -- } -- { -- crypt_data cd; -- cd.initialized = 0; -- char *p = crypt_r("abcdef", "$1$", &cd); -- volatile size_t z = strlen(p); -- } -- { -- crypt_data cd; -- cd.initialized = 0; -- char *p = crypt_r("abcdef", "$5$", &cd); -- volatile size_t z = strlen(p); -- } -- { -- crypt_data cd; -- cd.initialized = 0; -- char *p = crypt_r("abcdef", "$6$", &cd); -- volatile size_t z = strlen(p); -- } --} -diff --git a/test/sanitizer_common/TestCases/Posix/crypt.cpp b/test/sanitizer_common/TestCases/Posix/crypt.cpp -deleted file mode 100644 -index 3a8faaa1ae7682..00000000000000 ---- a/compiler-rt/test/sanitizer_common/TestCases/Posix/crypt.cpp -+++ /dev/null -@@ -1,32 +0,0 @@ --// RUN: %clangxx -O0 -g %s -o %t -lcrypt && %run %t -- --// crypt() is missing from Android and -lcrypt from darwin. --// UNSUPPORTED: android, darwin -- --#include --#include --#include --#if __has_include() --#include --#endif -- --int --main (int argc, char** argv) --{ -- { -- char *p = crypt("abcdef", "xz"); -- volatile size_t z = strlen(p); -- } -- { -- char *p = crypt("abcdef", "$1$"); -- volatile size_t z = strlen(p); -- } -- { -- char *p = crypt("abcdef", "$5$"); -- volatile size_t z = strlen(p); -- } -- { -- char *p = crypt("abcdef", "$6$"); -- volatile size_t z = strlen(p); -- } --} diff --git a/gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch b/gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch deleted file mode 100644 index 79b36f1383..0000000000 --- a/gnu/packages/patches/clang-cling-runtime-13-glibc-2.36-compat.patch +++ /dev/null @@ -1,50 +0,0 @@ -This commit is from upstream and is included in the llvm-15 release - -commit b379129c4beb3f26223288627a1291739f33af02 -Author: Fangrui Song -Date: Mon Jul 11 11:38:28 2022 -0700 - - [sanitizer] Remove #include to resolve fsconfig_command/mount_attr conflict with glibc 2.36 - - It is generally not a good idea to mix usage of glibc headers and Linux UAPI - headers (https://sourceware.org/glibc/wiki/Synchronizing_Headers). In glibc - since 7eae6a91e9b1670330c9f15730082c91c0b1d570 (milestone: 2.36), sys/mount.h - defines `fsconfig_command` which conflicts with linux/mount.h: - - .../usr/include/linux/mount.h:95:6: error: redeclaration of ‘enum fsconfig_command’ - - Remove #include which pulls in linux/mount.h. Expand its 4 macros manually. - - Fix https://github.com/llvm/llvm-project/issues/56421 - - Reviewed By: #sanitizers, vitalybuka, zatrazz - - Differential Revision: https://reviews.llvm.org/D129471 - -diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -index 4bd425435d56..81740bf4ab39 100644 ---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp -@@ -73,7 +73,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -876,10 +875,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); - unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; - unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; - #endif -- unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; -- unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; -- unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; -- unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; -+ unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long); -+ unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long); -+ unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long); -+ unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long); - unsigned IOCTL_GIO_CMAP = GIO_CMAP; - unsigned IOCTL_GIO_FONT = GIO_FONT; - unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP; diff --git a/gnu/packages/patches/cling-use-shared-library.patch b/gnu/packages/patches/cling-use-shared-library.patch deleted file mode 100644 index 415f542add..0000000000 --- a/gnu/packages/patches/cling-use-shared-library.patch +++ /dev/null @@ -1,107 +0,0 @@ -Upstream status: https://github.com/root-project/root/pull/15563 - -diff --git a/interpreter/cling/CMakeLists.txt b/interpreter/cling/CMakeLists.txt -index 9775b07f10..7028042096 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -13,81 +13,22 @@ endif(WIN32) - if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - project(Cling) - -- # Rely on llvm-config. -- set(CONFIG_OUTPUT) -- find_program(LLVM_CONFIG "llvm-config") -- if(LLVM_CONFIG) -- message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}") -- set(CONFIG_COMMAND ${LLVM_CONFIG} -- "--assertion-mode" -- "--bindir" -- "--libdir" -- "--includedir" -- "--prefix") -- execute_process( -- COMMAND ${CONFIG_COMMAND} -- RESULT_VARIABLE HAD_ERROR -- OUTPUT_VARIABLE CONFIG_OUTPUT -- ) -- if(NOT HAD_ERROR) -- string(REGEX REPLACE -- "[ \t]*[\r\n]+[ \t]*" ";" -- CONFIG_OUTPUT ${CONFIG_OUTPUT}) -- else() -- string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}") -- message(STATUS "${CONFIG_COMMAND_STR}") -- message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}") -- endif() -- else() -- message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}") -- endif() -+ # See . -+ find_package(LLVM REQUIRED CONFIG) -+ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") -+ message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") - -- list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS) -- list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR) -- list(GET CONFIG_OUTPUT 2 LIBRARY_DIR) -- list(GET CONFIG_OUTPUT 3 INCLUDE_DIR) -- list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT) -- -- if(NOT MSVC_IDE) -- set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS} -- CACHE BOOL "Enable assertions") -- # Assertions should follow llvm-config's. -- mark_as_advanced(LLVM_ENABLE_ASSERTIONS) -- endif() -+ separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS}) -+ add_definitions(${LLVM_DEFINITIONS_LIST}) - -- set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin") -- set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib") -- set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include") -- set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree") -+ find_package(Clang REQUIRED CONFIG) -+ message(STATUS "Found supported version: Clang ${CLANG_PACKAGE_VERSION}") -+ message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}") - - find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} - NO_DEFAULT_PATH) - -- set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") -- set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake") -- if(EXISTS ${LLVMCONFIG_FILE}) -- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}") -- include(${LLVMCONFIG_FILE}) -- else() -- message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}") -- endif() -- -- # They are used as destination of target generators. -- set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) -- set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) -- if(WIN32 OR CYGWIN) -- # DLL platform -- put DLLs into bin. -- set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR}) -- else() -- set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) -- endif() -- -- option(LLVM_INSTALL_TOOLCHAIN_ONLY -- "Only include toolchain files in the 'install' target." OFF) -- -- option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN -- "Set to ON to force using an old, unsupported host toolchain." OFF) -- -+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}") - include(AddLLVM) - include(TableGen) - include(HandleLLVMOptions) -@@ -99,7 +40,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - set(LLVM_INCLUDE_TESTS ON) - endif() - -- include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}") -+ include_directories("${LLVM_INCLUDE_DIRS}") - link_directories("${LLVM_LIBRARY_DIR}") - - set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 21 12:36:44 2024 Received: (at 73413) by debbugs.gnu.org; 21 Sep 2024 16:36:44 +0000 Received: from localhost ([127.0.0.1]:40265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss36C-0001yk-BD for submit@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:44 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:42035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ss369-0001yA-6p for 73413@debbugs.gnu.org; Sat, 21 Sep 2024 12:36:41 -0400 Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2db85775c43so2132243a91.0 for <73413@debbugs.gnu.org>; Sat, 21 Sep 2024 09:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726936514; x=1727541314; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/HldK2TGdr2u3KVrakRcvM33v/stW5TQcvkJ2zeNzwM=; b=VKU78mmPyHNEdfcjtokiiLXHNtm/in8trBR2xW5n5hEnC12hy3yByKBJQ3pVfq3/+q p2bBkp5QRZwpltYWLJ1usW2CV6iVB1EkV06WwcGw/TMXUDTSBFBlsO80c4uk/x2YM0M+ IqRkqG5AU2NUVyngOmKKQ8umB++/g7bysv3fmWHV9jtZ7GwsfEYhsqpkSl8RqBPzR4eU 9mAl3fmG6AFFk9izibGogB1UJ1HxcqK8G2qcIMFBky7ZTqN+cM8H5hczdO6XIAg0NHYU Zm5Dr8E65UBSwddvSYjdkn09fuLavbvihQMRbKIVp7Pr07TqZAo+TH2K49xUbfwicj77 ENdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726936514; x=1727541314; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/HldK2TGdr2u3KVrakRcvM33v/stW5TQcvkJ2zeNzwM=; b=sj1GE4GytnEXImWji97hVVNES4QSlgG37/gzi0RqBkN+ZVn1/wv/6BD3IZdxghHzbv h+6gc3T6+ZmqLyjP7PAcylJ+Pw+3BxOUc/VECwPseO+GC622WHxbY4REtAtTTpVNSL+H XJy5hfMVntccAIUjdFqZ/Qfgs7GmwecsVQugpCwuOOsRcb3d2JxmkFTtbrenDmb168oT M3VoTV0huzXNsCGzgSzxqGSADpxkEw5W/bpdmF33AO3RLo05SkVWUfXYf2KPgxOtJ/U/ yFFxIKGQPTB5T7pJ1HHnkIOJUuExa2orOcp42lI91J+Usg72MeCOqGzNmC+vWMe5MDlt slrg== X-Gm-Message-State: AOJu0YzXVFpYtL2fGhEOewd6wVGEsCkJQfjSiBUOJA5vyWJiIwQwORto f+mWWAYj6O8OuP8KCRMq4WfW2P9lhI60ZEEsqsV0H7uRuXAq1ukYUO0Mjg== X-Google-Smtp-Source: AGHT+IEuuWUYMvGBfhLrmeO6vqpklLOncV9GuDo8syjWIEMPb/XubSFQRRpzBM7cs5kHf3yug6v04g== X-Received: by 2002:a17:90a:b012:b0:2d8:719d:98a2 with SMTP id 98e67ed59e1d1-2dd7ecfe713mr9802430a91.7.1726936514084; Sat, 21 Sep 2024 09:35:14 -0700 (PDT) Received: from hurd.lan ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef3c64fsm6235289a91.38.2024.09.21.09.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2024 09:35:13 -0700 (PDT) From: Maxim Cournoyer To: 73413@debbugs.gnu.org Subject: [PATCH 3/3] gnu: cling: Reduce closure by 236 MiB. Date: Sun, 22 Sep 2024 01:32:27 +0900 Message-ID: <3ec7cbd413a763246fbde7e6a42e1a4425922acd.1726935737.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 73413 Cc: Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is accomplished by building LLVM only for the host target. * gnu/packages/llvm.scm (llvm-cling) [configure-flags]: Add '-DLLVM_TARGETS_TO_BUILD=host;NVPTX'. Change-Id: Ib24d3b692070e6de9ad4aa558918786d9e25379d --- gnu/packages/llvm.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index bdd805c59f..2e8d4e46dd 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -2306,7 +2306,14 @@ (define llvm-cling (file-name (git-file-name "llvm-cling" version)) (sha256 (base32 - "05libb4mc385n8sq0bilalvidwzzrcyiqsfkn7j179kkx66a8rzy"))))))) + "05libb4mc385n8sq0bilalvidwzzrcyiqsfkn7j179kkx66a8rzy")))) + (arguments + ;; This reduces the package size on disk from 547 MiB to 311 MiB. + ;; Cling is intended to be used as a REPL on the host machine, not as a + ;; cross-compiling toolchain. + (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags cf ''()) + #~(cons* "-DLLVM_TARGETS_TO_BUILD=host;NVPTX" #$cf))))))) (define clang-cling-runtime (let ((base clang-runtime-16)) -- 2.46.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 06 12:25:35 2024 Received: (at control) by debbugs.gnu.org; 6 Oct 2024 16:25:35 +0000 Received: from localhost ([127.0.0.1]:42117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxU4d-0002gA-5G for submit@debbugs.gnu.org; Sun, 06 Oct 2024 12:25:35 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:60918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxU4a-0002g1-QQ for control@debbugs.gnu.org; Sun, 06 Oct 2024 12:25:33 -0400 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20b9b35c7c7so25669655ad.1 for ; Sun, 06 Oct 2024 09:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728231865; x=1728836665; darn=debbugs.gnu.org; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=ywc7ehqycLQ7aBUOHOOVOrTC5STjnPTEtkuGd1xv98E=; b=C988AxHLQfmJmVGf3w9xf4JaupSie8sKMRWJ0HZkjMA0MVsbbblbWzP6B3nCvB4U7L DPGW8O/L1AOcIPFHd2VTx+6ZhO4GmJ648Y7I0Hyd31tWAhJjJtm9AU4/duYQZX7yRzUO b0BaYWFihPS+QNutlpFC0fB4BW561LfO8zQD8vIlYpy/NAyvSGBlarOO5qOt+JoCahm2 qrVBcfK6FbN4YPYiKrk889YUC5aYmaTBAKlw65G6iGLtG1u/hA0evhMGu20ZhElACsoz o/bccSv1b3A6zfqsmO3lhiZPVKf9Cl/zI6ozGjpNR+vW3jbku1AdET+Fi8lcvXPa8kGK uyVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728231865; x=1728836665; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ywc7ehqycLQ7aBUOHOOVOrTC5STjnPTEtkuGd1xv98E=; b=FKXdJMk0bTLTEfa5f3BIIWYNRZrjrH2PgFHaD2eDa0FaZcNU5Ow7cw+1ucC9l/6Wws x8s1d+gALmSK/5KAdHRELeF6M5icql9o7NiV7SVc7NPgd0CN9q03rw1d3wzdhZqtYjXW /EQ5UE/iBqnozmWqYdLYHe+zzzzuU2Q41mVvhn6IHzaWJ/jAVbXqRd+amCW24gVKxmSm L5R7gt4X2X2Pr7EscDtFdqTlDQMdyh7YB0J0PUd5we7gsjvFzKp3FpPpq4RLht2459eY PbAuiTY44yxwmr2kipetl2YjWHCPXw9foOvzP7Kg4wieBwcGuES6i5rbe7X9Ta53btWf 9jDw== X-Gm-Message-State: AOJu0YyySVYfkUiukcpsjW0rX8dzTsPx0y+mapDUzGuMM/rxHolZu+SL 2icE86SXeK68AX7euULM7f35FdPQEQ3dfE3I+d/nX0owRLV7QOVAOO5Fug== X-Google-Smtp-Source: AGHT+IE7+g3rbI/XMu+dom4enoxtKh780hKTkt6jOKx26kYFGJoB8x32hQo8jBDASU+4pulUV+jzLQ== X-Received: by 2002:a17:902:cf10:b0:20b:af36:ea5 with SMTP id d9443c01a7336-20bfdfaf7bdmr143006525ad.18.1728231865547; Sun, 06 Oct 2024 09:24:25 -0700 (PDT) Received: from hurd ([2405:6586:be0:0:c8ff:1707:9b9:af89]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c1396d995sm26750105ad.230.2024.10.06.09.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2024 09:24:24 -0700 (PDT) Date: Mon, 07 Oct 2024 01:24:21 +0900 Message-Id: <87frp9ci8a.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #73413 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 73413 quit From unknown Sat Jun 21 04:59:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 04 Nov 2024 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator