commit: 010938f892c24469874f7e149482efd95dab7fa4 Author: Brett A C Sheffield <bacs <AT> librecast <DOT> net> AuthorDate: Wed Mar 4 19:03:37 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sun Mar 8 04:16:28 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=010938f8
sys-devel/mold: drop 2.39.1-r1 Signed-off-by: Brett A C Sheffield <bacs <AT> librecast.net> Part-of: https://codeberg.org/gentoo/gentoo/pulls/219 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-devel/mold/Manifest | 1 - .../mold/files/mold-2.39.1-systemd-crash.patch | 85 --------------- sys-devel/mold/mold-2.39.1-r1.ebuild | 121 --------------------- 3 files changed, 207 deletions(-) diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index 0b71d8509297..12c86998e73c 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,2 +1 @@ -DIST mold-2.39.1.tar.gz 10224022 BLAKE2B 417e3f4f505b62e309d59e00646ddb9a90a6c073e3ec2b507d31f2c8ca58c2d1356acfea56fd57e2769c7bbec6eb308038f1f6d28b39bb79e1f21001a370ffe8 SHA512 2d6d3d892d0dc6b256fbb2a1bbe7519948c2cd683549d23727da9cbccf1dad80a3af2826bf96b9d02ed56a765fa46ffc8fcd23168bb5624a1fa4b9dd21606005 DIST mold-2.40.4.tar.gz 11039370 BLAKE2B 73686ad57eb5a17a1a617792c65eddddf070211b9c1592359760cd94f463b1ad8267b83bd4edd0897d6846e46072b787b8d3a8733eff9fcf68aa4919e7d6fca8 SHA512 d28501d827eca861179218566521c14b0f76cecc501145b34b3fbf7739b125e4ccd411358c8871e788ddbd8b4c7229cb8839018dc671db76db1aaa8defae0abe diff --git a/sys-devel/mold/files/mold-2.39.1-systemd-crash.patch b/sys-devel/mold/files/mold-2.39.1-systemd-crash.patch deleted file mode 100644 index 714983178fc6..000000000000 --- a/sys-devel/mold/files/mold-2.39.1-systemd-crash.patch +++ /dev/null @@ -1,85 +0,0 @@ -https://bugs.gentoo.org/955406 -https://github.com/rui314/mold/issues/1463#issuecomment-2907548327 -https://github.com/rui314/mold/commit/53c175850350ba24e264ffc3ac7979892b22bf4c - -From 53c175850350ba24e264ffc3ac7979892b22bf4c Mon Sep 17 00:00:00 2001 -From: Rui Ueyama <[email protected]> -Date: Fri, 16 May 2025 10:45:29 +0900 -Subject: [PATCH] Align TLS segment correctly - -This effectively reverts 5249edc57f8cfbf5c9a3821f82c71c9713f47cdf. ---- - src/passes.cc | 21 ++++++++++++++++++++- - test/tls-large-alignment.sh | 6 +++--- - 2 files changed, 23 insertions(+), 4 deletions(-) - -diff --git a/src/passes.cc b/src/passes.cc -index 6c41a2abbd..b916f88fab 100644 ---- a/src/passes.cc -+++ b/src/passes.cc -@@ -2411,6 +2411,15 @@ void sort_output_sections(Context<E> &ctx) { - sort_output_sections_by_order(ctx); - } - -+template <typename E> -+static i64 get_tls_segment_alignment(Context<E> &ctx) { -+ i64 val = 1; -+ for (Chunk<E> *chunk : ctx.chunks) -+ if (chunk->shdr.sh_flags & SHF_TLS) -+ val = std::max<i64>(val, chunk->shdr.sh_addralign); -+ return val; -+} -+ - // This function assigns virtual addresses to output sections. Assigning - // addresses is a bit tricky because we want to pack sections as tightly - // as possible while not violating the constraints imposed by the hardware -@@ -2455,8 +2464,12 @@ static void set_virtual_addresses_regular(Context<E> &ctx) { - std::vector<Chunk<E> *> &chunks = ctx.chunks; - u64 addr = ctx.arg.image_base; - -+ auto is_tls = [](Chunk<E> *chunk) { -+ return chunk->shdr.sh_flags & SHF_TLS; -+ }; -+ - auto is_tbss = [](Chunk<E> *chunk) { -- return (chunk->shdr.sh_type == SHT_NOBITS) && (chunk->shdr.sh_flags & SHF_TLS); -+ return (chunk->shdr.sh_flags & SHF_TLS) && (chunk->shdr.sh_type == SHT_NOBITS); - }; - - for (i64 i = 0; i < chunks.size(); i++) { -@@ -2513,6 +2526,12 @@ static void set_virtual_addresses_regular(Context<E> &ctx) { - } - } - -+ // TLS sections are included only in PT_LOAD but also in PT_TLS. -+ // We align the first TLS section so that the PT_TLS segment starts -+ // at an address that meets the segment's alignment requirement. -+ if (is_tls(chunks[i]) && (i == 0 || !is_tls(chunks[i - 1]))) -+ addr = align_to(addr, get_tls_segment_alignment(ctx)); -+ - // TLS BSS sections are laid out so that they overlap with the - // subsequent non-tbss sections. Overlapping is fine because a STT_TLS - // segment contains an initialization image for newly-created threads, -diff --git a/test/tls-large-alignment.sh b/test/tls-large-alignment.sh -index a88ac32da1..afbd777e2f 100755 ---- a/test/tls-large-alignment.sh -+++ b/test/tls-large-alignment.sh -@@ -18,14 +18,14 @@ extern _Thread_local int x; - extern _Thread_local int y[]; - - int main() { -- printf("%d %d %d %d\n", x, y[0], y[1], y[2]); -+ printf("%lu %d %d %d %d\n", (unsigned long)&x % 256, x, y[0], y[1], y[2]); - } - EOF - - $CC -B. -shared -o $t/d.so $t/a.o $t/b.o - - $CC -B. -o $t/exe1 $t/a.o $t/b.o $t/c.o --$QEMU $t/exe1 | grep '^42 1 2 3$' -+$QEMU $t/exe1 | grep '^0 42 1 2 3$' - - $CC -B. -o $t/exe2 $t/c.o $t/d.so --$QEMU $t/exe2 | grep '^42 1 2 3$' -+$QEMU $t/exe2 | grep '^0 42 1 2 3$' - diff --git a/sys-devel/mold/mold-2.39.1-r1.ebuild b/sys-devel/mold/mold-2.39.1-r1.ebuild deleted file mode 100644 index ce36af62f0d0..000000000000 --- a/sys-devel/mold/mold-2.39.1-r1.ebuild +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2021-2025 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 test" -RESTRICT="!test? ( test )" - -RDEPEND=" - app-arch/zstd:= - >=dev-cpp/tbb-2021.7.0-r1:= - dev-libs/blake3:= - virtual/zlib:= - !kernel_Darwin? ( - >=dev-libs/mimalloc-2:= - ) -" -DEPEND="${RDEPEND}" - -PATCHES=( - "${FILESDIR}"/${PN}-2.39.1-systemd-crash.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 - - # Fails if binutils errors out on textrels by default - rm test/textrel.sh test/textrel2.sh || die - - # Fails with (sometimes, maybe dependent on sys-devel/clang default - # linker): - # "/usr/bin/x86_64-pc-linux-gnu-ld.bfd: unrecognised emulation mode: llvm" - rm test/lto-llvm2.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=( - -DBUILD_TESTING=$(usex test) - -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 - ) - - if use test ; then - mycmakeargs+=( - -DMOLD_ENABLE_QEMU_TESTS=OFF - ) - fi - - cmake_src_configure -} - -src_test() { - export TEST_CC="$(tc-getCC)" TEST_GCC="$(tc-getCC)" \ - TEST_CXX="$(tc-getCXX)" TEST_GXX="$(tc-getCXX)" - cmake_src_test -} - -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 -}
