mirror of
https://codeberg.org/kiss-community/repo
synced 2024-08-27 16:26:18 +00:00
25 lines
751 B
Bash
Executable File
25 lines
751 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
# Force a static build so shared library breakage does not also break the
|
|
# linker (and therefore the ability to recover from the issue).
|
|
# XXX: Static linking prevents mold from using dlopen() which is required
|
|
# for performing LTO.
|
|
# export LDFLAGS="$LDFLAGS -static"
|
|
|
|
patch -p1 < elf_amd64_only.patch
|
|
|
|
cmake -B build \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_LIBDIR=lib
|
|
|
|
cmake --build build
|
|
cmake --install build
|
|
|
|
# Create a symbolic link so users can use mold as the linker system-wide
|
|
# (without need for special CFLAGS/CXXFLAGS).
|
|
ln -s mold "$1/usr/bin/ld"
|
|
|
|
# To tell GCC to use mold we must put a symlink to it in a directory and set it
|
|
# to search for the linker within.
|
|
ln -s ../../bin/mold "$1/usr/lib/mold/ld"
|