commit: cd971d4f0c972d4a861607c7b919dab1433e875b Author: Leonardo Hernández Hernández <leohdz172 <AT> proton <DOT> me> AuthorDate: Sat Oct 21 16:55:58 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Oct 21 17:48:02 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd971d4f
sys-devel/mold: add 2.3.1 Signed-off-by: Leonardo Hernández Hernández <leohdz172 <AT> proton.me> Closes: https://github.com/gentoo/gentoo/pull/33445 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-devel/mold/Manifest | 1 + sys-devel/mold/mold-2.3.1.ebuild | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index 6cb0c98c07e3..dc26eba27e96 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -3,3 +3,4 @@ DIST mold-2.0.0.tar.gz 9205927 BLAKE2B f80c72c58f4618a74390417fdf90f816810350baf DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2 DIST mold-2.2.0.tar.gz 9956678 BLAKE2B 495772b5bfd238a6785676d277da87fe4f10b64513f8f0a4961893e4ae8954ad8bda3d09283de14594d7d056d6c1aeed5be591d6a64868a473eb45737d3b9340 SHA512 1692d1ff154335fdff91a4fafebb3514ed6742035c14e74ec7e552b90428a1cd5341baba9183158b44ae221fd19e86da55e7f04bde317b943a24d0afecb41002 DIST mold-2.3.0.tar.gz 9958893 BLAKE2B 86235731953902a5cd8fdba8b41d456bd60bf53b96a9e1cc89bdf991a75367b95e5522887be8e9c28f3d777b143ef5d693ff50293188ef222fc45257ce990d24 SHA512 7953cff8f2e9f775f0890aedc5f38ef07aac16118310ee9e1a2a82be8abafa1aa05459a136181978c55763737c7ff47815afdd4423e8f96db8f0237fce13e6b4 +DIST mold-2.3.1.tar.gz 9958470 BLAKE2B 917e1fd770f841dc4bf6fbbed4954762f3eccff3d01247d4a5eaee7a5dad47f0259eb8ba6a10d13f385c9f0aea4d1ac058ce40070902bf7ef366ad8225cfbd5f SHA512 ea234d0b999bcd308e0c5dae27050ff61fd23971f9c54d5eb5764bfb04064dc68c33f5defd614544762a9891ce4369125a6aac68171e68de4ed09a08d59e599e diff --git a/sys-devel/mold/mold-2.3.1.ebuild b/sys-devel/mold/mold-2.3.1.ebuild new file mode 100644 index 000000000000..f16aabe0758e --- /dev/null +++ b/sys-devel/mold/mold-2.3.1.ebuild @@ -0,0 +1,94 @@ +# Copyright 2021-2023 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 ~arm64 ~loong ~riscv ~x86" +fi + +# mold (MIT) +# - xxhash (BSD-2) +LICENSE="MIT BSD-2" +SLOT="0" + +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.3.0-no-pch.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/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=( + -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON + -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 +}