• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3set -ex
4
5# When changing this file, you need to bump the following
6# .gitlab-ci/image-tags.yml tags:
7# ALPINE_X86_64_BUILD_TAG
8# DEBIAN_BASE_TAG
9# DEBIAN_BUILD_TAG
10# FEDORA_X86_64_BUILD_TAG
11# KERNEL_ROOTFS_TAG
12
13uncollapsed_section_start mold "Building mold"
14
15MOLD_VERSION="2.32.0"
16
17git clone -b v"$MOLD_VERSION" --single-branch --depth 1 https://github.com/rui314/mold.git
18pushd mold
19
20cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_TESTING=OFF -D MOLD_LTO=ON
21cmake --build . --parallel "${FDO_CI_CONCURRENT:-4}"
22cmake --install . --strip
23
24# Always use mold from now on
25find /usr/bin \( -name '*-ld' -o -name 'ld' \) \
26  -exec ln -sf /usr/local/bin/ld.mold {} \; \
27  -exec ls -l {} +
28
29popd
30rm -rf mold
31
32section_end mold
33