sys-devel/mold: add 2.35.0

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2024-12-08 23:43:09 +00:00
parent d1ef411b6e
commit 3f91e3a7c4
2 changed files with 108 additions and 0 deletions

View File

@@ -3,3 +3,4 @@ DIST mold-2.32.1.tar.gz 10010384 BLAKE2B b020d57df25d91fac9b6ef994e9f7f73b6736d1
DIST mold-2.33.0.tar.gz 10061838 BLAKE2B 65c460035f3bdbc101120a27e30b70982d549a4222cf4beb1b7228c0c961afd3eb8928cacde5be20734a80a80765eb60e6d961bd5cb001ecaef1aba1152730b9 SHA512 67c41ae33f8a229f32aabf32ffb8bcb261eff047dedd189b8751e5de43ef12a2dbd05f45632c8baeac2ceff99c40256256d7d5c790cc12e4fecf1dc3cfebeb11
DIST mold-2.34.0.tar.gz 10056591 BLAKE2B 88ee86c7f78b05cc79d67152a2f5cad7c88e2155f47674f2fe5aca5ef66c7cad607154f4a52cbd97e720a24e1b25ecf8452a88e626e9cf1c4d3f76401df5644d SHA512 b252f873f6fd4aa2e63344017c57e0bcff3fda5db86e4db2587b29ac1e44ee34a1a36c3b96b08bf607909dc5e877fa59617c32f7399ebe09591f84dd833c5bb5
DIST mold-2.34.1.tar.gz 10057683 BLAKE2B 9a9b166e64c4e5d48631147e781ce0d58acf76420f172bdee31fe5c44f37a8e2b098ae5696b52b668255f9a5967b0fb567a51d9fb8b26cddba0e14ed5a3e3464 SHA512 6ddfda8b81b710555272ee67eac7f2b3088a7a78f308843caa1730c1b631fc7031b8f5eac33379b9926c9f000d7b27864c12bb62ea75051d2f1caf9f9d2946ab
DIST mold-2.35.0.tar.gz 10056856 BLAKE2B 9b039031047263aa959aa6f2bf296d11d51bf02d0a66afa76e08200d4547ee5d66cf522497b86fce7fd8cbd43559b8d19ad0264c749833988592cf7291fd55fe SHA512 6f7be924cb6ea38c0089f0c34beec9ef51160daea3510dac4ed68c519efefe4496739271b35c271f7384c9e436bd8a0636ce47e0847aa2b4daf227accecc7314

View File

@@ -0,0 +1,107 @@
# Copyright 2021-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake flag-o-matic toolchain-funcs
DESCRIPTION="A Modern Linker"
HOMEPAGE="https://github.com/rui314/mold"
if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://github.com/rui314/mold.git"
inherit git-r3
else
SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
# -alpha: https://github.com/rui314/mold/commit/3711ddb95e23c12991f6b8c7bfeba4f1421d19d4
KEYWORDS="-alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~riscv ~sparc ~x86"
fi
# mold (MIT)
# - xxhash (BSD-2)
# - siphash ( MIT CC0-1.0 )
LICENSE="MIT BSD-2 CC0-1.0"
SLOT="0"
IUSE="debug"
RDEPEND="
app-arch/zstd:=
>=dev-cpp/tbb-2021.7.0-r1:=
dev-libs/blake3:=
sys-libs/zlib
!kernel_Darwin? (
>=dev-libs/mimalloc-2:=
)
"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-2.34.1-linux-6.11.patch
)
pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then
if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
die "${PN} needs at least gcc 10"
elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
die "${PN} needs at least clang 12"
fi
fi
}
src_prepare() {
cmake_src_prepare
# Needs unpackaged dwarfdump
rm test/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
# Heavy tests, need qemu
rm test/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
rm test/lto-{archive,dso,gcc,llvm,version-script}.sh || die
# Sandbox sadness
rm test/run.sh || die
sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
test/mold-wrapper{,2}.sh || die
# static-pie tests require glibc built with static-pie support
if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
rm test/{,ifunc-}static-pie.sh || die
fi
}
src_configure() {
use debug || append-cppflags "-DNDEBUG"
local mycmakeargs=(
-DMOLD_ENABLE_QEMU_TESTS=OFF
-DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
-DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
-DMOLD_USE_SYSTEM_MIMALLOC=ON
-DMOLD_USE_SYSTEM_TBB=ON
)
cmake_src_configure
}
src_install() {
dobin "${BUILD_DIR}"/${PN}
# https://bugs.gentoo.org/872773
insinto /usr/$(get_libdir)/mold
doins "${BUILD_DIR}"/${PN}-wrapper.so
dodoc docs/{design,execstack}.md
doman docs/${PN}.1
dosym ${PN} /usr/bin/ld.${PN}
dosym ${PN} /usr/bin/ld64.${PN}
dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld
}
src_test() {
export TEST_CC="$(tc-getCC)" \
TEST_GCC="$(tc-getCC)" \
TEST_CXX="$(tc-getCXX)" \
TEST_GXX="$(tc-getCXX)"
cmake_src_test
}