diff options
Diffstat (limited to 'sys-devel/mold')
-rw-r--r-- | sys-devel/mold/Manifest | 4 | ||||
-rw-r--r-- | sys-devel/mold/files/mold-2.34.1-linux-6.11.patch | 22 | ||||
-rw-r--r-- | sys-devel/mold/mold-2.34.1-r1.ebuild | 107 | ||||
-rw-r--r-- | sys-devel/mold/mold-9999.ebuild | 4 |
4 files changed, 136 insertions, 1 deletions
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index d71e3f769b92..b5ee68a49cd5 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,5 +1,6 @@ AUX mold-2.32.1-libdl.patch 632 BLAKE2B db9a5911f5587c33d27a38347a027c3d93cbca41a0328e6a290760c32a4738db4a7241eb3b041d81c1ebb6e20bd9b752573d4e13e1812925adf07dcda2fe5d4f SHA512 6fd38910d1d7cd1126579b15c7442ceccc8c06ba1c439d647334316b035e2dc7b073239b27d29ae94b7dd83b2b8ba7c6e19377d905530fa9118fcb463985b2d3 AUX mold-2.33.0-icf.patch 1618 BLAKE2B 3c1953a854874218b532fa6db91b20a0625bb71d4ed154a0b7f86a19691d99257db6bd28ab174452830749b66ad0dcdddcc8f7292ce4de2fa9553d67ea21ec88 SHA512 86d74a1e00789552606493d469e7fae7ca8b2022bfb3542aecf8478a7ebf49dcf123b57e8e536dfe4e3004a2b42ece7ee3a7b73170db8585fb0012112313d407 +AUX mold-2.34.1-linux-6.11.patch 940 BLAKE2B b089023c689323046456d7484d89f6577feabf90f4695ee512cadccd6fc07869b2c0aad5854cca2c67eb0dc0d7b2f0f5437c7e5c870348042dd0038ff4466d22 SHA512 6d67d779a10ea82aab807f76b2314e152e65c9d8a0daa5f565bd91a13eb8f90fd4f86b2c45f3c87249871ecd17fe0642e93430e3d86989b65a719658ee2c0163 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 @@ -10,6 +11,7 @@ EBUILD mold-2.32.1.ebuild 2448 BLAKE2B 88d6d168b5de620f787abf540531759dcba0be483 EBUILD mold-2.33.0-r1.ebuild 2519 BLAKE2B 0160432fa8384e06d2c518b6735ea56cfbfe834066d56e13910b3c4fe901f986700ed2635ae484c821b1960daf6df4cecf190da92d1313f52d13ce0ee4135975 SHA512 82b65306d43e513a7df2d863a40b453e2028133c8321569c7b1abfb2495f2ea466cf27b15716e3d4608845c10d9d8507abcf7e81ca88dce3d9d0a30c2323825a EBUILD mold-2.33.0.ebuild 2409 BLAKE2B 770982e41dec11dd488e13a581c75744239897bacc5f8742491f19d4fefe6718971e54ef274ce61e6cff9f83df0b97320a15aac26a6d970c11f1d6953ecce4bf SHA512 7f8968d75136cf5c763e5127a5f26cd60ab4bce97dc5048292393053788de2b17858738b67c43fffe9920f28b9694a7f54fc17da95bc6efd30c477b5ae6260f6 EBUILD mold-2.34.0.ebuild 2550 BLAKE2B 3f43cd81dd5f9332926d3271c24bfc32f0851dd92dfe6e5424a69bd61d964f38adf2f4094538939b14ce392132ef44dff0c4d97e749b6cf1dcf1c7049a22c5ed SHA512 9e04c92b9a3f7bfb33006c90642abd30fad9b96b8dd8d493dfd0ab83375e2cfb7c7fc6c2b8d9b50ae0ba4294bad84672236ca043eceb98e3e6e676369418c86a +EBUILD mold-2.34.1-r1.ebuild 2608 BLAKE2B 673c5c6932d2e553b3cbb6f07916d446d0074c37f0959d45225d10f6890bacee9ec00933a6b93b0f74b7ce4c779d382318b2d0caede4c4de20db775e40a3ed28 SHA512 1cddebf1ceed28c01d795cf7dfe3aad011c08c79cbea5e4dcd415441f6a8323551a8a86518beda95345b8b324580374f8815aaa42415494005f49ed90f9d5926 EBUILD mold-2.34.1.ebuild 2550 BLAKE2B 3f43cd81dd5f9332926d3271c24bfc32f0851dd92dfe6e5424a69bd61d964f38adf2f4094538939b14ce392132ef44dff0c4d97e749b6cf1dcf1c7049a22c5ed SHA512 9e04c92b9a3f7bfb33006c90642abd30fad9b96b8dd8d493dfd0ab83375e2cfb7c7fc6c2b8d9b50ae0ba4294bad84672236ca043eceb98e3e6e676369418c86a -EBUILD mold-9999.ebuild 2550 BLAKE2B 3f43cd81dd5f9332926d3271c24bfc32f0851dd92dfe6e5424a69bd61d964f38adf2f4094538939b14ce392132ef44dff0c4d97e749b6cf1dcf1c7049a22c5ed SHA512 9e04c92b9a3f7bfb33006c90642abd30fad9b96b8dd8d493dfd0ab83375e2cfb7c7fc6c2b8d9b50ae0ba4294bad84672236ca043eceb98e3e6e676369418c86a +EBUILD mold-9999.ebuild 2608 BLAKE2B 673c5c6932d2e553b3cbb6f07916d446d0074c37f0959d45225d10f6890bacee9ec00933a6b93b0f74b7ce4c779d382318b2d0caede4c4de20db775e40a3ed28 SHA512 1cddebf1ceed28c01d795cf7dfe3aad011c08c79cbea5e4dcd415441f6a8323551a8a86518beda95345b8b324580374f8815aaa42415494005f49ed90f9d5926 MISC metadata.xml 424 BLAKE2B a1c0cbdcb86c323fa1e6143c9665ec548f7713e74002a25b2fc26c51b60dae00922d3448a5aaecd5027a8cb026a681386ca7dea90657a3e10b25fb194dafc0d3 SHA512 1adc934e78ca0210743a1aa7479ebc4b5ea0b66a348c4408423460f02b404b885d3a8eca6e89ea8ac53ac9c76e85116965f1eef79e3f3e1f0451c8cf5ce0dfd6 diff --git a/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch b/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch new file mode 100644 index 000000000000..8540ec0cb246 --- /dev/null +++ b/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch @@ -0,0 +1,22 @@ +https://lore.kernel.org/stable/CACKH++YAtEMYu2nTLUyfmxZoGO37fqogKMDkBpddmNaz5HE6ng@mail.gmail.com/T/#u +https://github.com/rui314/mold/issues/1361 +https://bugs.gentoo.org/941070 +--- a/src/output-file-unix.cc ++++ b/src/output-file-unix.cc +@@ -19,16 +19,6 @@ template <typename E> + static int + open_or_create_file(Context<E> &ctx, std::string path, std::string tmpfile, + int perm) { +- // Reuse an existing file if exists and writable because on Linux, +- // writing to an existing file is much faster than creating a fresh +- // file and writing to it. +- if (ctx.overwrite_output_file && rename(path.c_str(), tmpfile.c_str()) == 0) { +- i64 fd = ::open(tmpfile.c_str(), O_RDWR | O_CREAT, perm); +- if (fd != -1) +- return fd; +- unlink(tmpfile.c_str()); +- } +- + i64 fd = ::open(tmpfile.c_str(), O_RDWR | O_CREAT, perm); + if (fd == -1) + Fatal(ctx) << "cannot open " << tmpfile << ": " << errno_string(); diff --git a/sys-devel/mold/mold-2.34.1-r1.ebuild b/sys-devel/mold/mold-2.34.1-r1.ebuild new file mode 100644 index 000000000000..e9cd29a7fe47 --- /dev/null +++ b/sys-devel/mold/mold-2.34.1-r1.ebuild @@ -0,0 +1,107 @@ +# 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}" + +PATCHES=( + "${FILESDIR}"/${PN}-2.34.1-linux-6.11.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 + + # 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-9999.ebuild b/sys-devel/mold/mold-9999.ebuild index 456f654912e4..e9cd29a7fe47 100644 --- a/sys-devel/mold/mold-9999.ebuild +++ b/sys-devel/mold/mold-9999.ebuild @@ -34,6 +34,10 @@ RDEPEND=" " DEPEND="${RDEPEND}" +PATCHES=( + "${FILESDIR}"/${PN}-2.34.1-linux-6.11.patch +) + pkg_pretend() { # Requires a c++20 compiler, see #831473 if [[ ${MERGE_TYPE} != binary ]]; then |