From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qFDEBsZUDGToJgEASxT56A (envelope-from ) for ; Sat, 11 Mar 2023 11:15:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id ULD0BcZUDGQQiwAAG6o9tA (envelope-from ) for ; Sat, 11 Mar 2023 11:15:34 +0100 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 D8298F2F4 for ; Sat, 11 Mar 2023 11:15:33 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="G/7GlQ03"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); 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=1678529733; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=QsT6aHeqqmc0YgierkEaet3mLrXwqIhHnwFYFj7RzFk=; b=tQyocjn5j0Xfuc8uxH6qLJOpUXsoG56Y2iUXKraMMHLyCxGYTKscs0LCOVWDBGDZ5MBubS yF+VjIBunnOBDMI2wfpSW7Sa2r1nWOg6JdyroTOWlsLbwdAA7+mE/rxaLwukhH26JzmaQQ lWvX75UF35m/KcDZhGEXw+3ZZfJtV4GNmyLp0dJMhdlEtvya/xJx0C7N2WVrnuyzAl6asc 2BacGG0zLqnElOKp7m1LWl0AQPhaBDaT+8zq1JLMG6NuqXHhR/aiBNvqwwvWKSiM33yVNU iewbE9Va2aykStWNOhZ/chO/XED3pKuNMEUNCUtwRePOWF0HsVfvlbh2qch2ZQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="G/7GlQ03"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); 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-Seal: i=1; s=key1; d=yhetil.org; t=1678529733; a=rsa-sha256; cv=none; b=bJIg+4A9m104zf8uHH3f1lzKMwFLGxkhr+RgYsC6jVSU7YqsZFOlLsa8//TOnsPo+bw1m0 l8L3b+Um7pBHN39M74/BNJYYrnFo6qtxSTYpVz2hJkOY+pCj8AsQvUv37jIcguoiEC/cd7 M2zVyl9FeDy+0EAnYDKETRkyaSe5+wmM/YePznbVuHsLehheeDhXbR83P9wn3WrldeiSO4 3/BIJjdIHtcWpAXr5r4uuFiB/LdN3z20nt/42EGupwoQYzp1jOEzQJSgrZJUmAsxSkr0kj 2UXg/Klm+59fB9YpRzmqUcw9YGpifAC7ArUrbBwHhFRKFliQmOR1dzbGTzt3uw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pawFp-0007EP-2x; Sat, 11 Mar 2023 05:15:09 -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 1pawFj-0007Dy-M4 for guix-patches@gnu.org; Sat, 11 Mar 2023 05:15:03 -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 1pawFj-00032L-7d for guix-patches@gnu.org; Sat, 11 Mar 2023 05:15:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pawFi-0000Tt-Tk for guix-patches@gnu.org; Sat, 11 Mar 2023 05:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62105] [PATCH] gnu: zig: make zig build for a baseline cpu Resent-From: pukkamustard Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 Mar 2023 10:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62105 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ekaitz Zarraga Cc: 62105@debbugs.gnu.org Received: via spool by 62105-submit@debbugs.gnu.org id=B62105.16785296841776 (code B ref 62105); Sat, 11 Mar 2023 10:15:02 +0000 Received: (at 62105) by debbugs.gnu.org; 11 Mar 2023 10:14:44 +0000 Received: from localhost ([127.0.0.1]:56618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pawFP-0000Sa-Sa for submit@debbugs.gnu.org; Sat, 11 Mar 2023 05:14:44 -0500 Received: from mout01.posteo.de ([185.67.36.65]:51087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pawFN-0000SG-Pc for 62105@debbugs.gnu.org; Sat, 11 Mar 2023 05:14:42 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0AF0024028F for <62105@debbugs.gnu.org>; Sat, 11 Mar 2023 11:14:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1678529675; bh=Cgo75JbdQdwUbdGNzcsemQG2TH5Tz+xGwmd7QhGu83E=; h=From:To:Cc:Subject:Date:From; b=G/7GlQ03VAixc8IB+QomXgQBmIePtjjAIoG8F8HS9w1j0dwW1WZSIvQqNRf1yL10Z aGXS5O2XVAjo4EakChBXd6joTxOOtHi4O7UMLzw3ragmbGrc0QI9wmb4Gh/a+y8k8s BBAJPXv8moqkufTH45a+1ZmKwFlSkOYX5DfkYTue4LaQTL0UhlCIDNaOP/MuVatfi2 q85rBlMtzU5BqnQ0qQDhtFH6MA5njnBYMRXB8D7w4eeZK6XE6t9jRcA3vSELbXhDlm 254IcjtRpgZrEVwpcUNg1NnylH17pEm9h/FuTYM00pBWERyjFFQ5zSQHOe1WLs87X4 +Nz9rS7DnCI2w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PYf0m01Lxz6tqk; Sat, 11 Mar 2023 11:14:29 +0100 (CET) References: From: pukkamustard Date: Sat, 11 Mar 2023 10:10:42 +0000 In-reply-to: Message-ID: <865yb7k325.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain 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: X-Migadu-Queue-Id: D8298F2F4 X-Spam-Score: -3.10 X-Migadu-Spam-Score: -3.10 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , 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 X-TUID: US+1ub/XWSJs I managed to build Zig with your patch applied. From what I understand this is a good fix to the issue. lgtm and thanks! -pukkamustard Ekaitz Zarraga writes: > This patch fixes a `Illegal instruction` issue when running Zig. > It happens because Zig compiles with optimizations for the current > machine, which may add instructions that are not compatible with > some target machines. This flag makes it build for a baseline cpu. > > Tested with: > > qemu-x86_64 -cpu Broadwell-v2 /gnu/store/zzi23y4mab8zl58hdd740xz3814vy24w-zig-0.10.1/bin/zig build > > And: > qemu-x86_64 -cpu Broadwell-v4 /gnu/store/zzi23y4mab8zl58hdd740xz3814vy24w-zig-0.10.1/bin/zig build > > It worked. > It follows what Arch does: > https://github.com/archlinux/svntogit-community/blob/31055e6750a5672ebbd85114fe7a93163f8af575/trunk/PKGBUILD#L30 > And NixOS: > https://github.com/NixOS/nixpkgs/pull/215994/commits/26b9a2f4a1a53e6763aa83590aad0fce5013a458 > > Hope this helps. > Best, > Ekaitz > > > --- > > From 8dbb801ba7df6cc64c003e8f1739117c8dda6a75 Mon Sep 17 00:00:00 2001 > From: Ekaitz Zarraga > Date: Fri, 10 Mar 2023 22:52:19 +0100 > Subject: [PATCH] gnu: zig: make zig build for a baseline cpu > > * gnu/packages/zig.scm(zig-0.10): Add -DZIG_TARGET_MCPU=baseline > configure flag. > --- > gnu/packages/zig.scm | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm > index 5414b5ba6e..2c89343cb1 100644 > --- a/gnu/packages/zig.scm > +++ b/gnu/packages/zig.scm > @@ -56,6 +56,7 @@ (define-public zig-0.10 > '(string-append "-DZIG_TARGET_TRIPLE=" > (%current-target-system)) > '()) > + (string-append "-DZIG_TARGET_MCPU=baseline") > (string-append "-DZIG_LIB_DIR=" (assoc-ref %outputs "out") > "/lib/zig")) > #:validate-runpath? #f ; TODO: zig binary can't find ld-linux.