#!/bin/bash -x # This is a shell script to build a statically-linked mold # executable using Docker, so that it is easy to build mold # on non-Ubuntu 20.04 machines. # # A docker image used for building mold is persistent. # Run `docker image rm mold-build-ubuntu20` to remove the image # from disk. set -e # If the existing file is not statically-linked, remove it. [ -f mold ] && ! ldd mold 2>&1 | grep -q 'not a dynamic executable' && \ rm mold cat <