mold
mold copied to clipboard
Manual: compile mold on Ubuntu 18.04
It took a while to get this right. Maybe someone else wants to compile mold on Ubuntu 18.04, if so, this seems to work on a fresh Ubuntu 18.04 docker
apt update
apt install -y --no-install-recommends software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt install -y --no-install-recommends build-essential git clang-10 cmake libstdc++-10-dev libssl-dev libxxhash-dev zlib1g-dev
ln -s /usr/bin/clang-10 /usr/bin/clang
ln -s /usr/bin/clang++-10 /usr/bin/clang++
git clone https://github.com/rui314/mold.git
cd mold
git checkout v1.0.0
make -j$(nproc)
make install
Thanks! I'm not sure if I can recommend this to everybody because it adds a new apt repo to the system, though.
Didn't my ./build-static.sh script work for you?
The script worked, but I wanted to run this within a docker based on 18.04 and avoid docker-in-docker.
Regarding ./build-static.sh
script: you could shed some docker build time (170s ->100s) and weight (1Gb -> 650Mb) by:
- not installing git
- using
--no-install-recommends
in the apt install calls - using
apt clean
beforerm -rf /var/lib/apt/lists/*
I installed additionally xxhsum
and libxxhash-dev
probably only the last was missing. (got an xxh3.h not found error)
@roelofvandijk Thank you for the suggestion. I made a commit as you suggested in 358464d5adb4c382d7441e49c57c7a93fa4688fa.