From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2IvCAbnGQ2S8IQEASxT56A (envelope-from ) for ; Sat, 22 Apr 2023 13:36:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KGHAAbnGQ2TIcwEA9RJhRA (envelope-from ) for ; Sat, 22 Apr 2023 13:36:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A2D9356D6 for ; Sat, 22 Apr 2023 13:36:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqBXB-0002Mz-O1; Sat, 22 Apr 2023 07:36:05 -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 1pqBX9-0002L3-4t for guix-patches@gnu.org; Sat, 22 Apr 2023 07:36:03 -0400 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 1pqBX8-0004kW-HY for guix-patches@gnu.org; Sat, 22 Apr 2023 07:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pqBX8-0007g0-DC for guix-patches@gnu.org; Sat, 22 Apr 2023 07:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63012] [PATCH core-updates] gnu: zig: Fix build. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Apr 2023 11:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63012 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63012@debbugs.gnu.org Cc: Josselin Poiret X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168216331529450 (code B ref -1); Sat, 22 Apr 2023 11:36:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Apr 2023 11:35:15 +0000 Received: from localhost ([127.0.0.1]:41987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqBWM-0007ev-Oh for submit@debbugs.gnu.org; Sat, 22 Apr 2023 07:35:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:35328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqBWK-0007eh-RV for submit@debbugs.gnu.org; Sat, 22 Apr 2023 07:35:13 -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 1pqBWD-00020Q-Vd for guix-patches@gnu.org; Sat, 22 Apr 2023 07:35:06 -0400 Received: from jpoiret.xyz ([206.189.101.64]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqBWB-0004LF-VI for guix-patches@gnu.org; Sat, 22 Apr 2023 07:35:05 -0400 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 2728E1851DF; Sat, 22 Apr 2023 11:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1682163300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=OkcbzR5JgQp7JKbEF8FRcuDit0swKfMlUifWbuIllTc=; b=Gn2EMKjAmcyoN24uyyc7cYQNkcfw8nT7CPfn5hGhZ/JsZQrwA5tqsJe8Htlq5zboMVyh1S w+p2QegIexXFmnN7vUoQeDpWB3p6sqxt6Elx7aL1Y0lzAEFd6E1sHvmJ9dcQMKODOkulXW DjeCNNzruVU16StEU9EIhuQeUWcVnatpMLzaGGadSFFT8SkWGGgvW/iko0Ywyr3OAff6io KZEXJR+B72vQ8LmpxJg6cDKRTVs3i1/zqtlR/IqWaKXqbXMETTxOkgV4bE43OlEiuMHbSJ OuIpj5M3QZtlDBdcTIEe4SqMa9/OCvYPZ/Ecu0e21suehjmozEoeo1ktY+/8sw== Date: Sat, 22 Apr 2023 13:34:56 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ++++ Received-SPF: pass client-ip=206.189.101.64; envelope-from=dev@jpoiret.xyz; helo=jpoiret.xyz 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682163384; a=rsa-sha256; cv=none; b=uxNkVshdlLRl+WkSi3vPjg8Qxlkq9LgyMqhZSD2KwoTn5mrmB7Fhh6pgCOoPIbb7SaDRVR Z77ff0Qeqs0KNqMC2a1VChclfEmscGphuL6TM089QoBtyG3Voel8N+5QI+iIApAQzCaR6u fiYVbR2UKnKmgJJYvbgS2HitGW+vfaVX5Pp18bLXKe9rwXwi6TnreaSWuatAzBkvo7vOYq 4p7bmQd/dwNB/IbF+2UXR+ggsGP+6VcEMMdOA/nghOrcTWRPKFt9QOmWWWiM2TPw0U0p74 AJBwNTM+mLMnKPV8SpNyho3yEqUxAyOhxrpUJxPtEbc//se3wynE3zeYzRR6IQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=Gn2EMKjA; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682163384; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=OkcbzR5JgQp7JKbEF8FRcuDit0swKfMlUifWbuIllTc=; b=t679nZMf8FezWhYIJZ/IsYn9i7YLl8UFB7+avnXU1Gn38OGTkM13voklf6+M/mdtP1qQSw syhQbgbgTowhr10yChROmkuvmsoO49TGHIMZ9YlnkPE2oOWzhQcz8DFJnZcXQJ6Yqy8++U fJVQLf9zDeBT3nP6fBv8OI6wGMTzk5P3+6amVDuP+N6bKCjBFhul3NK3J3gweVoHBQCSoe PoSt8MTImApRcTnKL2LCNSIkqqUla0q/B+R9Ip5cN0Jyzy6YeYoAtYh7ISGkz4Qv3HFWAs PiLHBlwgCZH73GQx9S0CLsaC1LJdCbNbN2wO+yWH4qM7kK+LSQCckOOJE/zNMg== X-Migadu-Spam-Score: -4.31 X-Spam-Score: -4.31 X-Migadu-Queue-Id: A2D9356D6 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=Gn2EMKjA; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-TUID: yV8iHF1KH2gs * gnu/packages/patches/zig-do-not-link-against-librt.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/zig.scm (zig-0.10): Use it. Also force LLVM to be dynamically linked, and setup the CC env variable. (zig-0.9): Also use the above patch. --- gnu/local.mk | 1 + .../patches/zig-do-not-link-against-librt.patch | 10 ++++++++++ gnu/packages/zig.scm | 15 +++++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/zig-do-not-link-against-librt.patch diff --git a/gnu/local.mk b/gnu/local.mk index b7af7726e8..9c2b5bbb33 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2054,6 +2054,7 @@ dist_patch_DATA = \ %D%/packages/patches/xterm-370-explicit-xcursor.patch \ %D%/packages/patches/xygrib-fix-finding-data.patch \ %D%/packages/patches/yggdrasil-extra-config.patch \ + %D%/packages/patches/zig-do-not-link-against-librt.patch \ %D%/packages/patches/zig-use-system-paths.patch \ %D%/packages/patches/zsh-egrep-failing-test.patch diff --git a/gnu/packages/patches/zig-do-not-link-against-librt.patch b/gnu/packages/patches/zig-do-not-link-against-librt.patch new file mode 100644 index 0000000000..3239efbdd4 --- /dev/null +++ b/gnu/packages/patches/zig-do-not-link-against-librt.patch @@ -0,0 +1,10 @@ +--- a/src/target.zig 2023-04-22 11:44:47.917416658 +0200 ++++ b/src/target.zig 2023-04-22 11:45:04.577465352 +0200 +@@ -478,7 +478,6 @@ + "-lpthread", + "-lc", + "-ldl", +- "-lrt", + "-lutil", + }, + }, diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm index 6d6b7ec4b4..c2f92e04e7 100644 --- a/gnu/packages/zig.scm +++ b/gnu/packages/zig.scm @@ -21,6 +21,7 @@ (define-module (gnu packages zig) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system cmake) @@ -40,7 +41,8 @@ (define-public zig-0.10 (commit version))) (file-name (git-file-name name version)) (sha256 - (base32 "1sh5xjsksl52i4cfv1qj36sz5h0ln7cq4pdhgs3960mk8a90im7b")))) + (base32 "1sh5xjsksl52i4cfv1qj36sz5h0ln7cq4pdhgs3960mk8a90im7b")) + (patches (search-patches "zig-do-not-link-against-librt.patch")))) (build-system cmake-build-system) (inputs (list clang-15 ; Clang propagates llvm. @@ -57,14 +59,18 @@ (define-public zig-0.10 (%current-target-system)) '()) (string-append "-DZIG_TARGET_MCPU=baseline") + "-DZIG_SHARED_LLVM=ON" (string-append "-DZIG_LIB_DIR=" (assoc-ref %outputs "out") "/lib/zig")) #:validate-runpath? #f ; TODO: zig binary can't find ld-linux. #:out-of-source? #f ; for tests #:phases (modify-phases %standard-phases - (add-after 'configure 'set-cache-dir - (lambda _ + (add-after 'unpack 'set-env-variables + (lambda* (#:key inputs native-inputs #:allow-other-keys) + ;; Set CC, since the stage 2 zig relies on it to find the libc + ;; installation, and otherwise silently links against its own. + (setenv "CC" ,(cc-for-target)) ;; Set cache dir, otherwise Zig looks for `$HOME/.cache'. (setenv "ZIG_GLOBAL_CACHE_DIR" (string-append (getcwd) "/zig-cache")))) @@ -130,7 +136,8 @@ (define-public zig-0.9 (file-name (git-file-name name version)) (sha256 (base32 "0nfvgg23sw50ksy0z0ml6lkdsvmd0278mq29m23dbb2jsirkhry7")) - (patches (search-patches "zig-use-system-paths.patch")))) + (patches (search-patches "zig-use-system-paths.patch" + "zig-do-not-link-against-librt.patch")))) (inputs (list clang-13 ; Clang propagates llvm. lld-13)) base-commit: 3f7ae420d8a54d4e2ab7f349c40d8930fe9e0771 -- 2.39.2