lld

Details
Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-cmake . /
COPY --from=stagex/core-samurai . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-python . /
COPY --from=stagex/core-py-setuptools . /
COPY --from=stagex/core-openssl . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-clang . /
COPY --from=stagex/core-llvm . /
COPY --from=stagex/core-zlib . /
COPY --from=stagex/core-libzstd . /
COPY --from=stagex/core-libffi . /
ADD fetch/lld-${VERSION}.tar.xz .
WORKDIR /llvm-project-${VERSION}.src
RUN <<-EOF
	set -eux
	CFLAGS="-O2 -DNDEBUG -g1"
	CXXFLAGS="-O2 -DNDEBUG -g1"
	CC=clang
	CXX=clang++
	cmake \
		-S lld \
		-B build \
		-G Ninja \
		-Wno-dev \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr/ \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DBUILD_SHARED_LIBS=ON \
		-DLLVM_EXTERNAL_LIT=/usr/lib/llvm18/bin/lit \
		-DLLVM_INCLUDE_TESTS=OFF \
		-DLLD_BUILT_STANDALONE=ON \
		-DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,stack-size=2097152"
	cmake --build build
	DESTDIR="/rootfs" cmake --install build
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /