1 |
commit: 3fb7f7dc46c8c7703439aacf1be18eca8f99d44e |
2 |
Author: Matthew Smith <matthew <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 9 09:02:07 2022 +0000 |
4 |
Commit: Matthew Smith <matthew <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 9 09:47:00 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3fb7f7dc |
7 |
|
8 |
sys-devel/mold: add 1.4.2 |
9 |
|
10 |
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org> |
11 |
|
12 |
sys-devel/mold/Manifest | 1 + |
13 |
sys-devel/mold/mold-1.4.2.ebuild | 92 ++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 93 insertions(+) |
15 |
|
16 |
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest |
17 |
index bcde82ba97a1..f0d576a1e727 100644 |
18 |
--- a/sys-devel/mold/Manifest |
19 |
+++ b/sys-devel/mold/Manifest |
20 |
@@ -1 +1,2 @@ |
21 |
DIST mold-1.4.1.tar.gz 6280266 BLAKE2B 60d0a876e0bcc8f644e4b6fffe0de14299bf2bd6e382869c87761d725dca6efa874cac37aaf94ad85038c5a24521ed3582782be943236ab81c2e4b66e6002f5e SHA512 304caf4e9d9b24170a9442a84036790407bd02609a5d07c31e5f0f6285128099cbc962571804636a5da55afda59b447c12218f9e4d402fbfa55ebc354814bdda |
22 |
+DIST mold-1.4.2.tar.gz 6287845 BLAKE2B ec429f70b92c4af5be83761893028f2324fe2086fea0e9b64f1d89884c6bc8dd34e5615178ef28ff19c36d01dafc834e6f6b9a8d701d62e360ef4e0be2f065bd SHA512 17f543969e53737818b0be563aee39feac672f93e0fd712827523232b64eccb4629f3994c5a90de50b5f761886669e0946a8d463663725e774eb7d352de1ced1 |
23 |
|
24 |
diff --git a/sys-devel/mold/mold-1.4.2.ebuild b/sys-devel/mold/mold-1.4.2.ebuild |
25 |
new file mode 100644 |
26 |
index 000000000000..1a83cf4d004e |
27 |
--- /dev/null |
28 |
+++ b/sys-devel/mold/mold-1.4.2.ebuild |
29 |
@@ -0,0 +1,92 @@ |
30 |
+# Copyright 2021-2022 Gentoo Authors |
31 |
+# Distributed under the terms of the GNU General Public License v2 |
32 |
+ |
33 |
+EAPI=8 |
34 |
+ |
35 |
+inherit cmake toolchain-funcs |
36 |
+ |
37 |
+DESCRIPTION="A Modern Linker" |
38 |
+HOMEPAGE="https://github.com/rui314/mold" |
39 |
+if [[ ${PV} == 9999 ]] ; then |
40 |
+ EGIT_REPO_URI="https://github.com/rui314/mold.git" |
41 |
+ inherit git-r3 |
42 |
+else |
43 |
+ SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" |
44 |
+ KEYWORDS="~amd64 ~riscv" |
45 |
+fi |
46 |
+ |
47 |
+# mold (AGPL-3) |
48 |
+# - xxhash (BSD-2) |
49 |
+# - tbb (Apache-2.0) |
50 |
+LICENSE="AGPL-3 Apache-2.0 BSD-2" |
51 |
+SLOT="0" |
52 |
+IUSE="system-tbb" |
53 |
+ |
54 |
+RDEPEND=" |
55 |
+ sys-libs/zlib |
56 |
+ system-tbb? ( >=dev-cpp/tbb-2021.4.0:= ) |
57 |
+ !kernel_Darwin? ( |
58 |
+ >=dev-libs/mimalloc-2:= |
59 |
+ dev-libs/openssl:= |
60 |
+ ) |
61 |
+" |
62 |
+DEPEND="${RDEPEND}" |
63 |
+ |
64 |
+PATCHES=( |
65 |
+ # https://bugs.gentoo.org/865837 |
66 |
+ "${FILESDIR}"/mold-1.4.1-tbb-flags-stripping.patch |
67 |
+) |
68 |
+ |
69 |
+pkg_pretend() { |
70 |
+ # Requires a c++20 compiler, see #831473 |
71 |
+ if [[ ${MERGE_TYPE} != binary ]]; then |
72 |
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then |
73 |
+ die "${PN} needs at least gcc 10" |
74 |
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then |
75 |
+ die "${PN} needs at least clang 12" |
76 |
+ fi |
77 |
+ fi |
78 |
+} |
79 |
+ |
80 |
+src_prepare() { |
81 |
+ cmake_src_prepare |
82 |
+ |
83 |
+ # Needs unpackaged dwarfdump |
84 |
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die |
85 |
+ |
86 |
+ # Heavy tests, need qemu |
87 |
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die |
88 |
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die |
89 |
+ |
90 |
+ # Sandbox sadness |
91 |
+ rm test/elf/run.sh || die |
92 |
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \ |
93 |
+ test/elf/mold-wrapper{,2}.sh || die |
94 |
+ |
95 |
+ # static-pie tests require glibc built with static-pie support |
96 |
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then |
97 |
+ rm test/elf/{,ifunc-}static-pie.sh || die |
98 |
+ fi |
99 |
+} |
100 |
+ |
101 |
+src_configure() { |
102 |
+ local mycmakeargs=( |
103 |
+ -DMOLD_ENABLE_QEMU_TESTS=OFF |
104 |
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS. |
105 |
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON |
106 |
+ -DMOLD_USE_SYSTEM_TBB=$(usex system-tbb) |
107 |
+ ) |
108 |
+ cmake_src_configure |
109 |
+} |
110 |
+ |
111 |
+src_install() { |
112 |
+ dobin "${BUILD_DIR}"/${PN} |
113 |
+ dolib.so "${BUILD_DIR}"/${PN}-wrapper.so |
114 |
+ |
115 |
+ dodoc docs/{design,execstack}.md |
116 |
+ doman docs/${PN}.1 |
117 |
+ |
118 |
+ dosym ${PN} /usr/bin/ld.${PN} |
119 |
+ dosym ${PN} /usr/bin/ld64.${PN} |
120 |
+ dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld |
121 |
+} |