aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/mold.scm
blob: 4e261f1a4350f3ef0713fd478400280f6b946357 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023 Zhu Zihao <all_but_last@163.com>
;;; Copyright © 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2024 Ashish SHUKLA <ashish.is@lostca.se>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(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 (guix build-system trivial)
  #:use-module (gnu packages base)
  #: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 "2.34.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rui314/mold")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0s5mlnchw8sz3mafifiwhjswp91j5ja6ds946w21qws5sbwx15y7"))
       (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
      ;; Mold only uses mimalloc on 64-bit systems, even with the
      ;; configure flag set, saying it is unstable on 32-bit systems.
      #:configure-flags #~(list #$@(if (target-64bit?)
                                       '("-DMOLD_USE_SYSTEM_MIMALLOC=ON")
                                       '("-DMOLD_USE_MIMALLOC=OFF"))
                                "-DMOLD_USE_SYSTEM_TBB=ON"
                                "-DBUILD_TESTING=ON")
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'configure 'force-system-xxhash
            (lambda _
              (substitute* "lib/common.h"
                (("#include \"../third-party/xxhash/xxhash.h\"")
                 "#include <xxhash.h>"))))
          (add-before 'configure 'fix-compiler-name-in-test
            (lambda _
              (substitute* "test/common.inc"
                (("CC=\"\\$\\{TEST_CC:-cc\\}\"") "CC=gcc")
                (("CXX=\"\\$\\{TEST_CXX:-c\\+\\+\\}\"")
                 "CXX=g++"))))
          (add-before 'configure 'skip-tbb-lto-test
            (lambda _
              ;; This test needs tbb 2021.9.0 or newer
              (delete-file "test/lto-version-script.sh")))
          (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/rpath.sh"))))))
    (inputs
     (append
       (if (target-64bit?)
           (list mimalloc)
           '())
       (list tbb xxhash zlib `(,zstd "lib"))))
    (home-page "https://github.com/rui314/mold")
    (synopsis "Fast linker")
    (description
     "Mold is a faster drop-in replacement for existing linkers.
It is designed to increase developer productivity by reducing build time,
especially in rapid debug-edit-rebuild cycles.")
    (license license:agpl3)))

(define* (make-mold-wrapper mold #:key mold-as-ld?)
  "Return a MOLD wrapper.  When MOLD-AS-LD? is true, create a 'ld' symlink that
points to 'mold'."
  (package
    (inherit mold)
    (name (if mold-as-ld? "mold-as-ld-wrapper" "mold-wrapper"))
    (source #f)
    (native-inputs '())
    (inputs (list (make-ld-wrapper "ld.mold-wrapper" #:binutils mold
                                   #:linker "ld.mold")
                  (make-ld-wrapper "mold-wrapper" #:binutils mold #:linker
                                   "mold")))
    (propagated-inputs '())
    (build-system trivial-build-system)
    (arguments
     (list #:builder
           #~(let ((ld.mold (string-append #$(this-package-input
                                              "ld.mold-wrapper")
                                           "/bin/ld.mold"))
                   (mold (string-append #$(this-package-input "mold-wrapper")
                                        "/bin/mold")))
               (mkdir #$output)
               (mkdir (string-append #$output "/bin"))
               (symlink ld.mold (string-append #$output "/bin/ld.mold"))
               (symlink mold (string-append #$output "/bin/mold"))
               (when #$mold-as-ld?
                 (symlink ld.mold (string-append #$output "/bin/ld"))))))
    (synopsis "Mold linker wrapper")
    (description "This is a linker wrapper for Mold; like @code{ld-wrapper}, it
wraps the linker to add any missing @code{-rpath} flags, and to detect any
misuse of libraries outside of the store.")))

(define-public mold-wrapper
  (make-mold-wrapper mold))

(define-public mold-as-ld-wrapper
  (make-mold-wrapper mold #:mold-as-ld? #t))
tle='2024-08-06 13:55:54 -0400'>2024-08-06gnu: icecat: Update to 115.14.0-guix1 [security fixes]....Includes fixes for CVE-2024-7519, CVE-2024-7521, CVE-2024-7522, CVE-2024-7524, CVE-2024-7525, CVE-2024-7526, CVE-2024-7527, CVE-2024-7529, and CVE-2024-7531. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-07-09gnu: icecat: Update to 115.13.0-guix1 [security fixes]....Includes fixes for CVE-2024-6600, CVE-2024-6601, CVE-2024-6602, CVE-2024-6603, and CVE-2024-6604. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (%icecat-version): Change suffix from "-guix0-preview1" to "-guix1". (icecat-source): Update gnuzilla commit, base version, and hashes. (icecat-minimal)[description]: Remove the vague warning about IceCat being a preview release. Mark H Weaver 2024-06-11gnu: icecat: Update to 115.12.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2024-5688, CVE-2024-5690, CVE-2024-5691, CVE-2024-5692, CVE-2024-5693, CVE-2024-5696, CVE-2024-5700, and CVE-2024-5702. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-05-31gnu: all-mozilla-locales: Add Santali locale; make public....* gnu/packages/gnuzilla.scm (all-mozilla-locales): Adds the Santali locale, and makes all-mozilla-locales public, so it can be used with LibreWolf. Change-Id: Ice49c9b37f8896b8fa963146a754ab28b8571b68 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Ian Eure 2024-05-30gnu: mozjs: Fix build on riscv64-linux....* gnu/packages/gnuzilla.scm (mozjs)[arguments]: When building for riscv64-linux adjust the 'adjust-tests phase to skip 2 more tests skipped by upstream. Change-Id: Ia5fbe6782e3d1d8e1904cdf49a35e0666837b277 Efraim Flashner 2024-05-14gnu: icecat: Update to 115.11.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2024-4367, CVE-2024-4767, CVE-2024-4768, CVE-2024-4769, CVE-2024-4770, and CVE-2024-4777. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-05-01gnu: firefox-decrypt: Update to 1.1.1....* gnu/packages/gnuzilla.scm (firefox-decrypt)[version]: Update to 1.1.1. [arguments]<#:builder>: Update patch shebang substitute. Change-Id: Iceabe4883b103e2cde9eac808316986db97b760c Oleg Pykhalov 2024-04-16gnu: icecat: Update to 115.10.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2024-2609, CVE-2024-3302, CVE-2024-3852, CVE-2024-3854, CVE-2024-3857, CVE-2024-3859, CVE-2024-3861, CVE-2024-3863, and CVE-2024-3864. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-03-30Merge branch 'gnome-team'Liliana Marie Prikler 2024-03-23gnu: icecat: Update to 115.9.1-guix0-preview1 [fixes CVE-2024-29944]....* gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-03-20Merge remote-tracking branch 'savannah/master' into gnome-team...Change-Id: Iec8e15b79c6fde516294c2bfcaf8ee3575b1f745 Christopher Baines 2024-03-19gnu: icecat: Update to 115.9.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2023-5388, CVE-2024-0743, CVE-2024-2605, CVE-2024-2607, CVE-2024-2608, CVE-2024-2610, CVE-2024-2611, CVE-2024-2612, CVE-2024-2614, and CVE-2024-2616. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-03-16Merge remote-tracking branch 'savannah/master' into gnome-team...Change-Id: I775274c2693536e2efa36c9abca4c54c5c458e26 Christopher Baines 2024-03-12gnu: icedove-minimal: Build with newest rust-cbindgen....* gnu/packages/gnuzilla.scm (icedove-minimal)[inputs]: Replace rust-cbindgen-0.23 with rust-cbindgen. Change-Id: I7e8f1edca86a5faf5a148e34a1ff20b85f16e039 Efraim Flashner 2024-03-12gnu: icecat: Build with latest rust-cbindgen....* gnu/packages/gnuzilla.scm (icecat-minimal)[inputs]: Replace rust-cbindgen-0.24 with rust-cbindgen. Change-Id: I147c6facf297f19f24c12b908a8a43793fa6c153 Efraim Flashner 2024-02-25Merge branch 'master' into gnome-teamLiliana Marie Prikler 2024-02-20gnu: icecat: Update to 115.8.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2024-1546, CVE-2024-1547, CVE-2024-1548, CVE-2024-1549, CVE-2024-1550, CVE-2024-1551, CVE-2024-1552, and CVE-2024-1553. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-02-16gnu: icu4c-73: Move it from gnuzilla.scm to icu4c.scm....* gnu/packages/gnuzilla.scm (icu4c-73-promise): Delete variable. (icecat-minimal)[inputs]: Use ‘icu4c-73’ instead of the promise. * gnu/packages/icu4c.scm (icu4c-73): New variable. (make-torbrowser)[inputs]: Use ‘icu4c-73’ instead of the promise. Change-Id: I017e1416b70ecb94313aeb71aa4a0cafdfe0e9ab Signed-off-by: Clément Lassieur <clement@lassieur.org> Ian Eure 2024-02-03Merge branch 'master' into gnome-teamLiliana Marie Prikler 2024-01-26gnu: torbrowser: Update to 13.0.9....* gnu/packages/gnuzilla.scm: Stop exporting ‘all-mozilla-locales’. * gnu/packages/tor.scm (mozilla-locale): New procedure copied from gnuzilla.scm. (mozilla-locales): New macro adapted from gnuzilla.scm. (%torbrowser-locales): Add sha256 and changeset for each locale and update them all. (%moz-build-date): Update to 20240123154553. (%torbrowser-version): Update to 13.0.9. (%torbrowser-firefox-version): Update to 115.7.0esr-13.0-1-build1. (translation-base-browser): Update to cbd9b6c. (translation-tor-browser): Update to 767ab51. (torbrowser)[arguments]: Adapt to new ‘%torbrowser-locales’ format. Change-Id: I774db714f3df53adc5be37109126bde5fab1a9a6 Clément Lassieur 2024-01-23gnu: icecat: Update to 115.7.0-guix0-preview1 [security fixes]....Includes fixes for CVE-2024-0741, CVE-2024-0742, CVE-2024-0746, CVE-2024-0747, CVE-2024-0749, CVE-2024-0750, CVE-2024-0751, CVE-2024-0753, and CVE-2024-0755. * gnu/packages/gnuzilla.scm (%icecat-base-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Mark H Weaver 2024-01-21gnu: torbrowser: Add support for language localisation....* gnu/packages/gnuzilla.scm (all-mozilla-locales): Export it. * gnu/packages/tor.scm (%torbrowser-locales, translation-base-browser, translation-tor-browser): New variables. (torbrowser)[arguments]: In ‘setenv’ phase, set MOZ_CHROME_MULTILOCALE. Add ‘copy-firefox-locales’, ‘copy-basebrowser-locales’, ‘copy-torbrowser-locales’ and ‘build-locales’ phases. Change-Id: Ia5b28fa5d885f24140893dc270e57e83b0250c67 Clément Lassieur 2024-01-14Merge branch 'master' into gnome-teamLiliana Marie Prikler 2024-01-12gnu: icedove/wayland: Wrap quotes around ‘$@’ in the executable....Fixes <https://issues.guix.gnu.org/66643>. * gnu/packages/gnuzilla (icedove/wayland)[arguments]: Wrap quotes around ‘$@’ in the executable script. Signed-off-by: Clément Lassieur <clement@lassieur.org> Aleksandr Vityazev 2024-01-07Merge branch 'master' into gnome-teamLiliana Marie Prikler 2024-01-04gnu: icecat-minimal: Fix WM Class....* gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Set the MOZ_APP_REMOTINGNAME environment variable and replace "Navigator" with "Icecat" in icecat.desktop. The WM Class should be "Navigator, Icecat" instead of "Navigator, icecat-default". StartupWMClass in icecat.desktop should be "Icecat" instead of "Navigator" so that other browsers (they often have the "Navigator" class) won't be associated with Icecat. Change-Id: I57bec957938c56e8acf9cd5c955e57dbad081678 Clément Lassieur 2024-01-04gnu: icecat-minimal: Fix dependency to libcanberra....* gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Add 'libcanberra/lib/gtk-3.0/modules' to LD_LIBRARY_PATH in the 'wrap-program' phase. This fixes these messages on Icecat startup: Gtk-Message: 13:05:56.635: Failed to load module "canberra-gtk-module" Gtk-Message: 13:05:56.636: Failed to load module "canberra-gtk-module" Change-Id: I508dbf0a8133634c329c4c1ff20088752311ff91 Clément Lassieur