From patchwork Thu Jan 12 14:22:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhu Zihao X-Patchwork-Id: 46068 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 5838927BBE9; Thu, 12 Jan 2023 14:39:22 +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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,URIBL_BLOCKED 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 6EE6027BBEB for ; Thu, 12 Jan 2023 14:39:20 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFyUG-0005fn-Sc; Thu, 12 Jan 2023 09:23:25 -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 1pFyTu-0005TB-Vl for guix-patches@gnu.org; Thu, 12 Jan 2023 09:23:06 -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 1pFyTu-00015y-FE for guix-patches@gnu.org; Thu, 12 Jan 2023 09:23:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFyTu-0002pc-AY for guix-patches@gnu.org; Thu, 12 Jan 2023 09:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60754] [PATCH 1/2] gnu: Add mold. References: <20230112141830.28179-1-all_but_last@163.com> In-Reply-To: <20230112141830.28179-1-all_but_last@163.com> Resent-From: Zhu Zihao Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 12 Jan 2023 14:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60754 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60754@debbugs.gnu.org Cc: Zhu Zihao Received: via spool by 60754-submit@debbugs.gnu.org id=B60754.167353337410855 (code B ref 60754); Thu, 12 Jan 2023 14:23:02 +0000 Received: (at 60754) by debbugs.gnu.org; 12 Jan 2023 14:22:54 +0000 Received: from localhost ([127.0.0.1]:45069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFyTl-0002p0-KH for submit@debbugs.gnu.org; Thu, 12 Jan 2023 09:22:54 -0500 Received: from m12.mail.163.com ([220.181.12.214]:52896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFyTi-0002ol-Rl for 60754@debbugs.gnu.org; Thu, 12 Jan 2023 09:22:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version: Content-Type; bh=z8E8qf15a1bUusQLWJ/Rim0Uj1BjQ33A656R1PCxap0=; b=d6yArPfeeY2KpuKPPU0Pu3N7qYgY+ZwdCOT10E5S1V92tfWSCsLaEya7xs6CTD e97SEoUb9Sev5It3LaXDyT53ZXEvnz0bGMx6eW+PI/1vAtEE3vozzsWpTbUgJePs CqJ6MSFeZJNVMXe1zXHnqVutcRw7QsLiKH/ivStJIZZew= Received: from localhost.localdomain (unknown [113.100.122.236]) by zwqz-smtp-mta-g2-1 (Coremail) with SMTP id _____wBXPSqmF8Bj6CyHAA--.39263S2; Thu, 12 Jan 2023 22:22:40 +0800 (CST) From: Zhu Zihao Date: Thu, 12 Jan 2023 22:22:28 +0800 Message-Id: <20230112142228.28575-1-all_but_last@163.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CM-TRANSID: _____wBXPSqmF8Bj6CyHAA--.39263S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxZrWUZryfXrWUuF18AFyDGFg_yoWrXw4Upr 1fCr1avw1kGF13Jw4fWF47Wr13uFZ3AF4UKas3uanrtwsI9348CFW7tay5Aan7JF17Aa13 u3yIgay3GFykArJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0JUvhFcUUUUU= X-Originating-IP: [113.100.122.236] X-CM-SenderInfo: pdoosuxxwbztlvw6il2tof0z/xtbBaxL0r1et7dhbzQAAs7 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/local.mk (GNU_SYSTEM_MODULES): Add new file. * gnu/packages/mold.scm: New file. * gnu/packages/mold.scm (mold): New variable. --- gnu/local.mk | 1 + gnu/packages/mold.scm | 82 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 gnu/packages/mold.scm diff --git a/gnu/local.mk b/gnu/local.mk index 184f43e753..1e80dab53f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -426,6 +426,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/mingw.scm \ %D%/packages/microcom.scm \ %D%/packages/moe.scm \ + %D%/packages/mold.scm \ %D%/packages/motti.scm \ %D%/packages/monitoring.scm \ %D%/packages/moreutils.scm \ diff --git a/gnu/packages/mold.scm b/gnu/packages/mold.scm new file mode 100644 index 0000000000..9338499b2b --- /dev/null +++ b/gnu/packages/mold.scm @@ -0,0 +1,82 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Zhu Zihao +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages mold) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) + #:use-module (gnu packages c) + #:use-module (gnu packages digest) + #:use-module (gnu packages tbb) + #:use-module (gnu packages tls) + #:use-module (gnu packages compression) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public mold + (package + (name "mold") + (version "1.9.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rui314/mold") + (commit (string-append "v" version)))) + (sha256 + (base32 "03qkl9qw5l5kg1awij40hcrfxq6jj70mvq4iscdy9dsn8qw8r3wb")) + (modules '((guix build utils))) + (snippet + #~(begin + (for-each + (lambda (x) + (delete-file-recursively (string-append "third-party/" x))) + '("mimalloc" "tbb" "xxhash" "zlib" "zstd")))))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags #~(list "-DMOLD_USE_SYSTEM_MIMALLOC=ON" + "-DMOLD_USE_SYSTEM_TBB=ON") + #:phases + #~(modify-phases %standard-phases + (add-before 'configure 'force-system-xxhash + (lambda _ + (substitute* "mold.h" + (("#include \"third-party/xxhash/xxhash.h\"") + "#include ")))) + (add-before 'configure 'fix-compiler-name-in-test + (lambda _ + (substitute* "test/elf/common.inc" + (("CC=\"\\$\\{TEST_CC:-cc\\}\"") "CC=gcc") + (("CXX=\"\\$\\{TEST_CXX:-c\\+\\+\\}\"") + "CXX=g++")))) + (add-before 'configure 'disable-rpath-test + (lambda _ + ;; This test fails because mold expect the RUNPATH as-is, + ;; but compiler in Guix will insert the path of gcc-lib and + ;; glibc into the output binary. + (delete-file "test/elf/rpath.sh")))))) + (inputs (list mimalloc openssl tbb xxhash zlib `(,zstd "lib"))) + (home-page "https://github.com/rui314/mold") + (synopsis "Faster drop-in replacement for Unix linkers") + (description + "Mold is a faster drop-in replacement for existing Unix linkers. +It is designed to increase developer productivity by reducing build time, +especially in rapid debug-edit-rebuild cycles.") + (license license:agpl3+)))