summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Smith <matthew@gentoo.org>2022-11-15 20:18:30 +0000
committerMatthew Smith <matthew@gentoo.org>2022-11-15 20:19:24 +0000
commit59e6911a2f1ca165d67ecb98242782f6fae6bb0f (patch)
tree09d633fe62c6f17b9b0d4f87edf79b91ecc8bb40 /sys-devel/mold
parentdev-libs/mimalloc: add 2.0.7 (diff)
downloadgentoo-59e6911a2f1ca165d67ecb98242782f6fae6bb0f.tar.gz
gentoo-59e6911a2f1ca165d67ecb98242782f6fae6bb0f.tar.bz2
gentoo-59e6911a2f1ca165d67ecb98242782f6fae6bb0f.zip
sys-devel/mold: add 1.7.0
Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'sys-devel/mold')
-rw-r--r--sys-devel/mold/Manifest1
-rw-r--r--sys-devel/mold/mold-1.7.0.ebuild89
2 files changed, 90 insertions, 0 deletions
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 0b65d670e82d..7e3b567a1fa1 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1 +1,2 @@
DIST mold-1.6.0.tar.gz 8270834 BLAKE2B e9da062ab9871db35322cd516197e6e8172bee3a146ba32cde65976da2fb4cff0090ad62f06e25da9baed146c6defbd93d8704bd2156dcfb581ec247c45a2e12 SHA512 dcb498da95ee02a08b175861ae24f3793705671670f6f3487eebd3aab2487fd2163fc1747c9ca2fd1c3570a5f1f0bcfd7d4d91bf6a904a1ba098be6cbbe8c857
+DIST mold-1.7.0.tar.gz 8381327 BLAKE2B 16da7dcdb6196a8ce014d37f8578e920c38bf63cc805211b2af3a2e75dbae5aa7c5c9fcc6b9ccc188716a5705aa25066517a52fc4fc91cf679e630dec018ab56 SHA512 9af87b85cc5dc6f46cec9b74effaee55332c789f0673c4e93367e8f6be3fbf3aaca5d9f5be6e4e47294e10cb1f7321a5a4fa28500bc7da7531bbe7424c9d8799
diff --git a/sys-devel/mold/mold-1.7.0.ebuild b/sys-devel/mold/mold-1.7.0.ebuild
new file mode 100644
index 000000000000..82b43f78b777
--- /dev/null
+++ b/sys-devel/mold/mold-1.7.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake 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"
+ KEYWORDS="~amd64 ~riscv ~x86"
+fi
+
+# mold (AGPL-3)
+# - xxhash (BSD-2)
+LICENSE="AGPL-3 BSD-2"
+SLOT="0"
+
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ dev-libs/openssl:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+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/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/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/elf/{,ifunc-}static-pie.sh || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -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 ../../../usr/bin/${PN} /usr/libexec/${PN}/ld
+}