diff options
author | Sam James <sam@gentoo.org> | 2024-12-09 05:53:49 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-12-09 05:53:49 +0000 |
commit | 89a031befe0411419ce9bac565be1ee69220967b (patch) | |
tree | c28a846a53eb9ac51ca13fd037389d462db4e95c /sys-devel | |
parent | sys-libs/pkgcraft: build w/ -std=gnu17, sync live (diff) | |
download | gentoo-89a031befe0411419ce9bac565be1ee69220967b.tar.gz gentoo-89a031befe0411419ce9bac565be1ee69220967b.tar.bz2 gentoo-89a031befe0411419ce9bac565be1ee69220967b.zip |
sys-devel/mold: drop 2.32.1, 2.33.0, 2.33.0-r1, 2.34.0, 2.34.1
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/mold/Manifest | 3 | ||||
-rw-r--r-- | sys-devel/mold/files/mold-2.32.1-libdl.patch | 20 | ||||
-rw-r--r-- | sys-devel/mold/files/mold-2.33.0-icf.patch | 41 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.32.1.ebuild | 103 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.33.0-r1.ebuild | 106 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.33.0.ebuild | 99 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.34.0.ebuild | 103 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.34.1.ebuild | 103 |
8 files changed, 0 insertions, 578 deletions
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index 2d7be66ba802..fffe115e7813 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,6 +1,3 @@ DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2 -DIST mold-2.32.1.tar.gz 10010384 BLAKE2B b020d57df25d91fac9b6ef994e9f7f73b6736d18a73be3caebe03a851a1db1986abe395b5481a1e30e01f38362c3705cb5903251b7201c0003c745dee37a5148 SHA512 d38b12faf81ba8015fc0cdb52944ac94366877c3033871a92610087e036d75b3d072baf9bbf107a9029495521e067fb36c0809b5138f90976492547b39c33085 -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 diff --git a/sys-devel/mold/files/mold-2.32.1-libdl.patch b/sys-devel/mold/files/mold-2.32.1-libdl.patch deleted file mode 100644 index 994137938b68..000000000000 --- a/sys-devel/mold/files/mold-2.32.1-libdl.patch +++ /dev/null @@ -1,20 +0,0 @@ -https://github.com/rui314/mold/commit/091395df335d577adc2a09e854a129f02081c576 - -From 091395df335d577adc2a09e854a129f02081c576 Mon Sep 17 00:00:00 2001 -From: Rui Ueyama <ruiu@cs.stanford.edu> -Date: Fri, 28 Jun 2024 11:00:36 +0900 -Subject: [PATCH] Link with `-ldl` for dlopen() - -Fixes https://github.com/rui314/mold/issues/1293 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -61,6 +61,8 @@ target_compile_features(mold PRIVATE cxx_std_20) - - if(MINGW) - target_link_libraries(mold PRIVATE dl) -+else() -+ target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS}) - endif() - - if(NOT "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") - diff --git a/sys-devel/mold/files/mold-2.33.0-icf.patch b/sys-devel/mold/files/mold-2.33.0-icf.patch deleted file mode 100644 index e5b90fbfd9e3..000000000000 --- a/sys-devel/mold/files/mold-2.33.0-icf.patch +++ /dev/null @@ -1,41 +0,0 @@ -https://bugs.gentoo.org/938009 -https://github.com/rui314/mold/issues/1326 -https://github.com/rui314/mold/commit/5a9919b43344b4fb92ea701f0b32a7e20857b9ca - -From 5a9919b43344b4fb92ea701f0b32a7e20857b9ca Mon Sep 17 00:00:00 2001 -From: Rui Ueyama <ruiu@cs.stanford.edu> -Date: Fri, 9 Aug 2024 12:08:03 +0900 -Subject: [PATCH] Fix a crash bug - -Fixes https://github.com/rui314/mold/issues/1326 ---- a/elf/output-chunks.cc -+++ b/elf/output-chunks.cc -@@ -1730,21 +1730,18 @@ ElfSym<E> to_output_esym(Context<E> &ctx, Symbol<E> &sym, u32 st_name, - esym.st_type = STT_FUNC; - esym.st_visibility = sym.visibility; - esym.st_value = sym.get_plt_addr(ctx); -- } else if (!isec->output_section) { -+ } else if ((isec->shdr().sh_flags & SHF_MERGE) && -+ !(isec->shdr().sh_flags & SHF_ALLOC)) { - // Symbol in a mergeable non-SHF_ALLOC section, such as .debug_str -- assert(!(isec->shdr().sh_flags & SHF_ALLOC)); -- assert(isec->shdr().sh_flags & SHF_MERGE); -- assert(!sym.file->is_dso); -- - ObjectFile<E> *file = (ObjectFile<E> *)sym.file; -- MergeableSection<E> *m = -- file->mergeable_sections[file->get_shndx(sym.esym())].get(); -+ MergeableSection<E> &m = -+ *file->mergeable_sections[file->get_shndx(sym.esym())]; - - SectionFragment<E> *frag; - i64 frag_addend; -- std::tie(frag, frag_addend) = m->get_fragment(sym.esym().st_value); -+ std::tie(frag, frag_addend) = m.get_fragment(sym.esym().st_value); - -- shndx = m->parent.shndx; -+ shndx = m.parent.shndx; - esym.st_visibility = sym.visibility; - esym.st_value = frag->get_addr(ctx) + frag_addend; - } else { - diff --git a/sys-devel/mold/mold-2.32.1.ebuild b/sys-devel/mold/mold-2.32.1.ebuild deleted file mode 100644 index 8a4c59535484..000000000000 --- a/sys-devel/mold/mold-2.32.1.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2021-2024 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86" -fi - -# mold (MIT) -# - xxhash (BSD-2) -# - siphash ( MIT CC0-1.0 ) -LICENSE="MIT BSD-2 CC0-1.0" -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}"/${P}-libdl.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=( - -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 -} diff --git a/sys-devel/mold/mold-2.33.0-r1.ebuild b/sys-devel/mold/mold-2.33.0-r1.ebuild deleted file mode 100644 index 27b583561b71..000000000000 --- a/sys-devel/mold/mold-2.33.0-r1.ebuild +++ /dev/null @@ -1,106 +0,0 @@ -# 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" - KEYWORDS="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}"/${P}-icf.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() { - 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 -} diff --git a/sys-devel/mold/mold-2.33.0.ebuild b/sys-devel/mold/mold-2.33.0.ebuild deleted file mode 100644 index c125e91b311b..000000000000 --- a/sys-devel/mold/mold-2.33.0.ebuild +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2021-2024 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 ~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" - -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}" - -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_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 -} diff --git a/sys-devel/mold/mold-2.34.0.ebuild b/sys-devel/mold/mold-2.34.0.ebuild deleted file mode 100644 index 456f654912e4..000000000000 --- a/sys-devel/mold/mold-2.34.0.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# 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}" - -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 -} diff --git a/sys-devel/mold/mold-2.34.1.ebuild b/sys-devel/mold/mold-2.34.1.ebuild deleted file mode 100644 index a0350478640f..000000000000 --- a/sys-devel/mold/mold-2.34.1.ebuild +++ /dev/null @@ -1,103 +0,0 @@ -# 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}" - -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 -} |