|
4 | 4 | # the `dist` directory as `mold-$version-$arch-linux.tar.gz` (e.g. |
5 | 5 | # `mold-2.40.0-x86_64-linux.tar.gz`). |
6 | 6 | # |
7 | | -# This script aims to produce reproducible outputs. That means if you run |
8 | | -# the script twice on the same git commit, it should produce bit-for-bit |
9 | | -# identical binary files. This property is crucial as a countermeasure |
10 | | -# against supply chain attacks. With it, you can verify that the binary |
11 | | -# files distributed on the GitHub release pages were created from the |
12 | | -# commit with release tags by rebuilding the binaries yourself. |
| 7 | +# This script aims to produce reproducible outputs. That means each time |
| 8 | +# it's run on the same git commit, it generates a bit-for-bit identical |
| 9 | +# binary file regardless of when or where it's executed. This property |
| 10 | +# serves as a strong safeguard against supply chain attacks. With a |
| 11 | +# reproducible build, anyone can independently verify that the binary |
| 12 | +# files published on our GitHub release page were built from the git |
| 13 | +# commit tagged for release by rebuilding the binaries themselves. |
13 | 14 | # |
14 | 15 | # Debian provides snapshot.debian.org to host all historical binary |
15 | | -# packages. We use it to construct Podman images pinned to a |
| 16 | +# packages. We use it to construct a container image pinned to a |
16 | 17 | # particular timestamp. snapshot.debian.org is known to be very slow, |
17 | 18 | # but that shouldn't be a big problem for us because we only need that |
18 | 19 | # site the first time. |
19 | 20 | # |
20 | 21 | # The mold executable created by this script is statically linked to |
21 | | -# libstdc++, but dynamically linked to libc, libm and a few other |
22 | | -# libraries, as these libraries are almost always available on any |
23 | | -# Linux system. We can't statically link libc because doing so would |
24 | | -# disable dlopen(), which is required to load the LTO linker plugin. |
| 22 | +# libstdc++, but dynamically linked to glibc, libm and a few other |
| 23 | +# libraries, as these libraries are almost always available on any Linux |
| 24 | +# system. We can't statically link glibc because doing so would disable |
| 25 | +# dlopen(), which is required to load the LTO linker plugin. |
25 | 26 | # |
26 | | -# We aim to use a reasonably old Debian version because we'll dynamically |
27 | | -# link glibc to mold, and a binary linked against a newer version of glibc |
28 | | -# won't work on a system with an older version of glibc. |
| 27 | +# We use a reasonably old Debian version for the build environment because |
| 28 | +# a binary dynamically linked against a newer version of glibc won't work |
| 29 | +# on a system with an older version of glibc. |
29 | 30 | # |
30 | 31 | # We prefer to build mold with Clang rather than GCC because mold's |
31 | 32 | # Identical Code Folding works best with the LLVM address significance |
@@ -79,14 +80,15 @@ case $arch in |
79 | 80 | x86_64) |
80 | 81 | # Debian 9 (Stretch) released in June 2017. |
81 | 82 | # |
82 | | - # We use a Google-provided mirror (gcr.io) of the official Docker hub |
83 | | - # (docker.io) because docker.io has a strict rate limit policy. |
| 83 | + # We use a Google-provided mirror (gcr.io) instead of the official Docker |
| 84 | + # Hub (docker.io) because docker.io has a strict rate limit policy. |
84 | 85 | # |
85 | 86 | # The toolchain in Debian 9 is too old to build mold, so we rebuild it |
86 | 87 | # from source. We download source archives from official sites and build |
87 | | - # them locally, rather than using pre-built binaries, to avoid relying |
88 | | - # on unverifiable third-party binary blobs. Podman caches the result of |
89 | | - # each RUN command, so rebuilding is done only once per host. |
| 88 | + # them locally, rather than downloading pre-built binaries from somewhere |
| 89 | + # else, to avoid relying on unverifiable third-party binary blobs. Podman |
| 90 | + # caches the result of each RUN command, so rebuilding is done only once |
| 91 | + # per host. |
90 | 92 | cat <<EOF | $image_build |
91 | 93 | FROM mirror.gcr.io/library/debian:stretch@sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be |
92 | 94 | ENV DEBIAN_FRONTEND=noninteractive TZ=UTC |
|
0 commit comments