summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/Manifest.gzbin10489 -> 10498 bytes
-rw-r--r--sys-devel/mold/Manifest2
-rw-r--r--sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch58
-rw-r--r--sys-devel/mold/mold-2.0.0-r1.ebuild93
4 files changed, 153 insertions, 0 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz
index 46454e0d75bf..471abff648c5 100644
--- a/sys-devel/Manifest.gz
+++ b/sys-devel/Manifest.gz
Binary files differ
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 741b74e084bc..b4f9cd2a1810 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,8 +1,10 @@
+AUX mold-2.0.0-reloc-test-fix.patch 1468 BLAKE2B 197e9876667f4f066d801ff304216498aa4eb718d98badcb1a2eb951ae70984728171f5d1f9945201d7ca316d65a3ee1e3438b3e397246e0bdbc821f109bae59 SHA512 a912f06938d8acac52b673bad8a02ac70f13b47db232a51713d80e33dde93c45c7519b6db24451a072b799d6d7a839aabdb577786758d17535284ebe5b7bb055
DIST mold-1.10.1.tar.gz 8173701 BLAKE2B 142b4ec6297f1d4eb7576d16603a214244216592df7320639da3fce32890fc3d13e681dcb79ed23e4c0c7dba1f97eb10c622052c67787b6699925ae67ddb1d15 SHA512 b9df5ddc3a3a022523506638309373c3440128f3c702a7db69c44c180177148e92fbf73347be0c4e0e890395cfb2a5b12d2650ee267f9f58212ccfa981519bbf
DIST mold-1.11.0.tar.gz 8210923 BLAKE2B b3854a14a956dd568625fc28c96636e7cadf81b9a93954601b03e249db0aedf726a5a1f24c0758c8189a936501ebb778b472ee6e958fe9f43cb3c3093b2dda2a SHA512 a9068600dd2db757552cce027f358c0b9e6af0941b92f81c1e99e2dde674bd06cc3533d432258e42a2197d9b3f8e7bb263de281928357a79e4fb17fb19719bc0
DIST mold-2.0.0.tar.gz 9205927 BLAKE2B f80c72c58f4618a74390417fdf90f816810350baf1ac74d21294f5ffba7ee263807175be531c9db77209bd05a31ad11fd84d4aeb03fb057cefac7575f71612d6 SHA512 11c3d1e07fe4fcc28cff58b8e432526e4604aa55b49fa47c9495e439206fb9f6a1686b1c5bd2dc907ffd7fe62ac1c72317619fc8a5d7caaa5c327de585f16827
EBUILD mold-1.10.1.ebuild 2161 BLAKE2B 3ac1e9728556c58694e7ff460a49f5a6c3eaaf792c03aee0e4daa85ab74e4680550fa1c3253634c254a31e76a77792e0be7c1c4910533825f06bc719a1b9bbda SHA512 4d88a364d1e4c78bdb875861b1bdea5a848370199af5ecf05e2f8474433ee72d3f75e16f10445f5d17b994a45efd9e3a7860d5bda96ae5f938d575be0faec60d
EBUILD mold-1.11.0.ebuild 2168 BLAKE2B e6da026cd317d9bce59fb0c802f11571107df36310b4c69c9a1e01386bd989c7c0c785b23eaddee62447ac1aa472096b63156e07640ec7f978c49f08b1c8f765 SHA512 ac3d33eaa80eee576bb4151664bad21647d6517f97a30ac3448a4294f1f92b86a48dd82af340d499510dbca9b84d1960874223ce0c3e229c34efdeacfc4659dd
+EBUILD mold-2.0.0-r1.ebuild 2217 BLAKE2B c98fe92a85afc075ff6cb2664b060c0b39ef0d69707e363760c62871376bf82f6effd4402716108e3c6cdae49f8734c821c675a244cbec96f092aeb681ef924a SHA512 0144da3fd4bed3cd338b18c6700db4c1787911546fbc8e999b456856770a118561a21fa9b882ce441246ec7705e06590c7f52a8ff263a5fe3cf1026b73d1cdc4
EBUILD mold-2.0.0.ebuild 2163 BLAKE2B 7b745d3286acc49ab2a716ae1ed507d730e772003e4a6707d8d26eb926da1baecf79ef464a0129cf02c1b99df04efbfc68812541bda16acfff0a94dfa01788a8 SHA512 88f9147e3e84e9cf722b99e1f92959e0c7867e590211c27708346517de89aa179b25d166de084d6aec74228dd7e216fec86f3e6532b8887e3705c3896ec9f771
EBUILD mold-9999.ebuild 2163 BLAKE2B 7b745d3286acc49ab2a716ae1ed507d730e772003e4a6707d8d26eb926da1baecf79ef464a0129cf02c1b99df04efbfc68812541bda16acfff0a94dfa01788a8 SHA512 88f9147e3e84e9cf722b99e1f92959e0c7867e590211c27708346517de89aa179b25d166de084d6aec74228dd7e216fec86f3e6532b8887e3705c3896ec9f771
MISC metadata.xml 424 BLAKE2B a1c0cbdcb86c323fa1e6143c9665ec548f7713e74002a25b2fc26c51b60dae00922d3448a5aaecd5027a8cb026a681386ca7dea90657a3e10b25fb194dafc0d3 SHA512 1adc934e78ca0210743a1aa7479ebc4b5ea0b66a348c4408423460f02b404b885d3a8eca6e89ea8ac53ac9c76e85116965f1eef79e3f3e1f0451c8cf5ce0dfd6
diff --git a/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch b/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch
new file mode 100644
index 000000000000..8e6e04f5d535
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch
@@ -0,0 +1,58 @@
+https://github.com/rui314/mold/issues/1067
+https://github.com/rui314/mold/commit/1582b720d58df61bc4c0ae39fa269e3b250b94df
+
+From 1582b720d58df61bc4c0ae39fa269e3b250b94df Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@bluewhale.systems>
+Date: Fri, 28 Jul 2023 14:58:57 +0900
+Subject: [PATCH] Weak undefs should not keep DSOs alive
+
+Fixes https://github.com/rui314/mold/issues/1067
+--- a/elf/input-files.cc
++++ b/elf/input-files.cc
+@@ -1396,7 +1396,8 @@ SharedFile<E>::mark_live_objects(Context<E> &ctx,
+ if (sym.is_traced)
+ print_trace_symbol(ctx, *this, esym, sym);
+
+- if (esym.is_undef() && sym.file && !sym.file->is_alive.test_and_set()) {
++ if (esym.is_undef() && !esym.is_weak() && sym.file &&
++ !sym.file->is_alive.test_and_set()) {
+ feeder(sym.file);
+
+ if (sym.is_traced)
+--- /dev/null
++++ b/test/elf/as-needed-dso2.sh
+@@ -0,0 +1,33 @@
++#!/bin/bash
++. $(dirname $0)/common.inc
++
++cat <<EOF | $CC -c -fPIC -o $t/a.o -xc -
++int foo() {
++ return 0;
++}
++EOF
++
++cat <<EOF | $CC -c -fPIC -o $t/b.o -xc -
++__attribute__((weak)) int foo();
++
++int bar() {
++ if (foo) return foo();
++ return 0;
++}
++EOF
++
++cat <<EOF | $CC -xc -c -o $t/c.o -
++int bar();
++
++int main() {
++ return bar();
++}
++EOF
++
++$CC -B. -shared -o $t/libfoo.so $t/a.o
++$CC -B. -shared -o $t/libbar.so $t/b.o
++$CC -B. -o $t/exe $t/c.o -L$t -Wl,--as-needed -lfoo -lbar
++
++readelf --dynamic $t/exe > $t/log
++! grep libfoo.so $t/log || false
++grep -q libbar.so $t/log
+
diff --git a/sys-devel/mold/mold-2.0.0-r1.ebuild b/sys-devel/mold/mold-2.0.0-r1.ebuild
new file mode 100644
index 000000000000..6d863f669627
--- /dev/null
+++ b/sys-devel/mold/mold-2.0.0-r1.ebuild
@@ -0,0 +1,93 @@
+# 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 ~ppc64 ~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:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ dev-libs/openssl:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-reloc-test-fix.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_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
+}