From 6e9fa3a4a14685a33fc9182895e5529c293bae2e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 9 Aug 2023 09:29:40 +0100 Subject: gentoo auto-resync : 09:08:2023 - 09:29:39 --- sys-devel/Manifest.gz | Bin 10497 -> 10507 bytes sys-devel/binutils/Manifest | 2 +- sys-devel/binutils/binutils-2.40-r8.ebuild | 2 +- sys-devel/mold/Manifest | 5 +- .../mold/files/mold-2.0.0-DT_RELR-dependency.patch | 161 +++++++++++++++++++++ sys-devel/mold/mold-1.10.1.ebuild | 89 ------------ sys-devel/mold/mold-2.0.0-r2.ebuild | 94 ++++++++++++ sys-devel/mold/mold-2.0.0.ebuild | 89 ------------ 8 files changed, 259 insertions(+), 183 deletions(-) create mode 100644 sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch delete mode 100644 sys-devel/mold/mold-1.10.1.ebuild create mode 100644 sys-devel/mold/mold-2.0.0-r2.ebuild delete mode 100644 sys-devel/mold/mold-2.0.0.ebuild (limited to 'sys-devel') diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz index 560210800309..f564a4f996cb 100644 Binary files a/sys-devel/Manifest.gz and b/sys-devel/Manifest.gz differ diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest index 01fbba914a8f..3de9980e9d55 100644 --- a/sys-devel/binutils/Manifest +++ b/sys-devel/binutils/Manifest @@ -39,7 +39,7 @@ EBUILD binutils-2.39-r5.ebuild 14198 BLAKE2B 509de3eac65a306d0430ed50ee4c734a8f8 EBUILD binutils-2.40-r5.ebuild 14499 BLAKE2B 7cd15027992e9d9a9541903044eb3e8be9c4a42e0e40e7c058713a548e38275e7328e866b407eb77c2bdf1d20bc32b0634ff365501a3de9961d5244450c30345 SHA512 b972d5eddc2d0c3c905505cc3c660af2c40fd28174cabf37f13388b2f472a3941d79d93ea585a52874636d2e72a99c2d45b820337746c4dd8526c6a298757763 EBUILD binutils-2.40-r6.ebuild 14463 BLAKE2B 7cb15b48dee4fac6c52e4fd9ec823317fc271531ee2b124c22d6c4aa419f4eab5b5718c6fbdf0a3cc144d06d9427c1f245dcda7ad2ed45210662ef8bf87918c1 SHA512 3552a0dda275d071abd33a5f2b51889b05d1e0f6fe51dffd9542f29fb1e9858f5ff64f359cc5eac8c72afa2c00b1aa957b6d43b6c87662ee17241e7fbc0c6e2a EBUILD binutils-2.40-r7.ebuild 14463 BLAKE2B 2c498c5db7ff038959bdd23eaf9453bf6187642165e50d2f2fc37098f5be190af0d25f165c1a833d267cd7790b603e30ea4671a062bf942d9ae99712bf0038ba SHA512 7a5d067be65b89a4daa67a13f2ea882c5acbb558c14d537dddf7b44cd1708b8f0d0b0d8303415911de34ae9369a8c73fb3d2f6b11fc4c327adc68c57bddf7ca6 -EBUILD binutils-2.40-r8.ebuild 14656 BLAKE2B 3b9096a02e6b8a7336d61015e93c7e7ec3cfc1826a8dfa53e6e50c0df44a196f1610fbd689ece2e6d0c374092fdf4f7f94bcb755a3e95e087a44d9d80fe45d8f SHA512 7df7e927b1ed1d57f53c58b46c8e9035879bcd73c56148fadb67ebfb1a470c210abdc1d8113c9f3b3428f1c184843c2e1b93b3dbf06b97ee32635f1b8b12fd95 +EBUILD binutils-2.40-r8.ebuild 14655 BLAKE2B 787d3651accae7dcaa1087531c4ab33f84d39c2805bf3c43b684fcc11126b44bd5f9a5a2a3d8ddf352deb9a284567c7430c37513e00022ee3e783df7ba271631 SHA512 f514491d9d7da809e5dfee390af8be1977d680ec3c8331e01de2feaf25ab9c70f9a1cc563a57d819a4bf9aa0b7351c6c9c2aa12b61a57902a2b23b3a42850768 EBUILD binutils-2.41-r1.ebuild 14985 BLAKE2B 2a0bc6b83f5d6cd939dffe24930bda9521627335b5d8cad88ab0e1b5e34619634bc304fb33883421e36fcfc5a76afe81bd94e7d39c96d8784217aaf8899ebd28 SHA512 8adb901fcd2a56fb8061e7fc207a00a1fb359e9fce700f9608269e541fb77b382a7ac92bb7e79f807b2f67c670de758b1389af7a5804beab6cba2e7e2363ad45 EBUILD binutils-2.41.ebuild 14985 BLAKE2B 23dea5b34212deeaa8335e1be61b56357f678a76add7fc2f89c6a99a81863f17f5364f959209348d80b360a7d7b7eb0df5bd65a1a11a8bc24765ae9a2a572a73 SHA512 6ed2705f5e184a2bf5d1f9d29b05df410602a3fefdf46db81974f0b6a1e04e9fb0362c037617a4cf97331121822e7a8f11907265509f52033e5f16e1bb4504a2 EBUILD binutils-9999.ebuild 14986 BLAKE2B b9c60b13ff366fe5e6440d1d5c720139a0ca4c9312b6d3d1cb24daed5d25c3054b1673bf359a89dc89518e50d2358ce4e58a3528205ad3580643f08e55fb05f7 SHA512 3c90553e49991331820df8cd55c3c1b56786386f08668522f00aa42a10caec550da17d4eb4b086415ab904b67b0e5736bc3db92369c67d4cece7ff4057ff2325 diff --git a/sys-devel/binutils/binutils-2.40-r8.ebuild b/sys-devel/binutils/binutils-2.40-r8.ebuild index 929f9a3c643a..789ad23b059c 100644 --- a/sys-devel/binutils/binutils-2.40-r8.ebuild +++ b/sys-devel/binutils/binutils-2.40-r8.ebuild @@ -32,7 +32,7 @@ else [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI} https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz" SLOT=$(ver_cut 1-2) - #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" fi # diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index b4f9cd2a1810..c25ca6efbfcd 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,10 +1,9 @@ +AUX mold-2.0.0-DT_RELR-dependency.patch 5826 BLAKE2B f728523f8fe758d5f61768b4466e36a5fe44fc019f5c31fa41bf2310ef83db6c7eebfa585f776f0145d6b5727a68a686c0a624702af8ae54624ad2571472c977 SHA512 8ccca7ce514b2dd75a62613554237ef60cb527e892516aba35a6ac62a1a1851d217c5da98c821480a120d83ce071bf01fab390d0e80860d2d65b9ac54a8f03e3 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-2.0.0-r2.ebuild 2262 BLAKE2B 36664776ccff03553da6d71885104666f3b91be07ab8f4f62c96fc7b116d0499172c9cc43f3b05f5fb2bd6b24f80af93ce0e916ceb7ff6dcefb952c4496cfc16 SHA512 48284ddd900756dcf17cb6e8d7729f7fc45a5019d6760522afcfc6c9e6738df37cafd5e68566569f9465e3288de8f6b4854a9d85d2fc48a0b106a4e3a994e5b0 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-DT_RELR-dependency.patch b/sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch new file mode 100644 index 000000000000..267afde230d2 --- /dev/null +++ b/sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch @@ -0,0 +1,161 @@ +https://bugs.gentoo.org/911591 +https://bugzilla.mozilla.org/show_bug.cgi?id=1847697 +https://github.com/rui314/mold/issues/653#event-10041847648 +https://github.com/rui314/mold/commit/f467ad1add2ab6e381e0e458f026df197e63d487 + +From f467ad1add2ab6e381e0e458f026df197e63d487 Mon Sep 17 00:00:00 2001 +From: Rui Ueyama +Date: Wed, 9 Aug 2023 11:40:09 +0900 +Subject: [PATCH] Create a symbol version dependency to GLIBC_ABI_DT_RELR + +Fixes https://github.com/rui314/mold/issues/653 +--- + elf/cmdline.cc | 2 ++ + elf/mold.h | 1 + + elf/output-chunks.cc | 44 +++++++++++++++++++++++++----- + test/elf/z-pack-relative-relocs.sh | 16 +++++++++++ + 4 files changed, 56 insertions(+), 7 deletions(-) + create mode 100755 test/elf/z-pack-relative-relocs.sh + +diff --git a/elf/cmdline.cc b/elf/cmdline.cc +index c568ce086..82a0e6869 100644 +--- a/elf/cmdline.cc ++++ b/elf/cmdline.cc +@@ -875,8 +875,10 @@ std::vector parse_nonpositional_args(Context &ctx) { + ctx.arg.z_nodefaultlib = true; + } else if (read_z_flag("pack-relative-relocs")) { + ctx.arg.pack_dyn_relocs_relr = true; ++ ctx.arg.z_pack_relative_relocs = true; + } else if (read_z_flag("nopack-relative-relocs")) { + ctx.arg.pack_dyn_relocs_relr = false; ++ ctx.arg.z_pack_relative_relocs = false; + } else if (read_z_flag("separate-loadable-segments")) { + z_separate_code = SEPARATE_LOADABLE_SEGMENTS; + } else if (read_z_flag("separate-code")) { +diff --git a/elf/mold.h b/elf/mold.h +index e5532211c..3a027f1e9 100644 +--- a/elf/mold.h ++++ b/elf/mold.h +@@ -1831,6 +1831,7 @@ struct Context { + bool z_nodefaultlib = false; + bool z_now = false; + bool z_origin = false; ++ bool z_pack_relative_relocs = false; + bool z_relro = true; + bool z_sectionheader = true; + bool z_shstk = false; +diff --git a/elf/output-chunks.cc b/elf/output-chunks.cc +index 726a4da2b..3896a2991 100644 +--- a/elf/output-chunks.cc ++++ b/elf/output-chunks.cc +@@ -2373,12 +2373,13 @@ void VerneedSection::construct(Context &ctx) { + std::tuple(((SharedFile *)b->file)->soname, b->ver_idx); + }); + +- // Resize of .gnu.version ++ // Resize .gnu.version + ctx.versym->contents.resize(ctx.dynsym->symbols.size(), 1); + ctx.versym->contents[0] = 0; + + // Allocate a large enough buffer for .gnu.version_r. +- contents.resize((sizeof(ElfVerneed) + sizeof(ElfVernaux)) * syms.size()); ++ contents.resize((sizeof(ElfVerneed) + sizeof(ElfVernaux)) * ++ (syms.size() + 1)); + + // Fill .gnu.version_r. + u8 *buf = (u8 *)&contents[0]; +@@ -2394,14 +2395,14 @@ void VerneedSection::construct(Context &ctx) { + verneed->vn_next = ptr - (u8 *)verneed; + + verneed = (ElfVerneed *)ptr; +- ptr += sizeof(*verneed); ++ ptr += sizeof(ElfVerneed); + verneed->vn_version = 1; + verneed->vn_file = ctx.dynstr->find_string(((SharedFile *)file)->soname); + verneed->vn_aux = sizeof(ElfVerneed); + aux = nullptr; + }; + +- auto add_entry = [&](Symbol *sym) { ++ auto add_entry = [&](std::string_view verstr) { + verneed->vn_cnt++; + + if (aux) +@@ -2409,23 +2410,52 @@ void VerneedSection::construct(Context &ctx) { + aux = (ElfVernaux *)ptr; + ptr += sizeof(*aux); + +- std::string_view verstr = sym->get_version(); + aux->vna_hash = elf_hash(verstr); + aux->vna_other = ++veridx; + aux->vna_name = ctx.dynstr->add_string(verstr); + }; + ++ // Create version entries. + for (i64 i = 0; i < syms.size(); i++) { + if (i == 0 || syms[i - 1]->file != syms[i]->file) { + start_group(syms[i]->file); +- add_entry(syms[i]); ++ add_entry(syms[i]->get_version()); + } else if (syms[i - 1]->ver_idx != syms[i]->ver_idx) { +- add_entry(syms[i]); ++ add_entry(syms[i]->get_version()); + } + + ctx.versym->contents[syms[i]->get_dynsym_idx(ctx)] = veridx; + } + ++ if (ctx.arg.z_pack_relative_relocs) { ++ // If `-z pack-relative-relocs` is specified, we'll create a .relr.dyn ++ // section and store base relocation records to that section instead of ++ // to the usual .rela.dyn section. ++ // ++ // .relr.dyn is relatively new feature and not supported by glibc until ++ // 2.38 which was released in 2022. Executables built with `-z ++ // pack-relative-relocs` don't work and usually crash immediately on ++ // startup if libc doesn't support it. ++ // ++ // In the following code, we'll add a dependency to a dummy version name ++ // "GLIBC_ABI_DT_RELR" so that executables built with the option failed ++ // with a more friendly "version `GLIBC_ABI_DT_RELR' not found" error ++ // message. glibc 2.38 or later knows about this dummy version name and ++ // simply ignores it. ++ auto find_glibc2 = [&]() -> InputFile * { ++ for (Symbol *sym : syms) ++ if (((SharedFile *)sym->file)->soname.starts_with("libc.so.") && ++ sym->get_version().starts_with("GLIBC_2.")) ++ return sym->file; ++ return nullptr; ++ }; ++ ++ if (InputFile *file = find_glibc2()) { ++ start_group(file); ++ add_entry("GLIBC_ABI_DT_RELR"); ++ } ++ } ++ + // Resize .gnu.version_r to fit to its contents. + contents.resize(ptr - buf); + } +diff --git a/test/elf/z-pack-relative-relocs.sh b/test/elf/z-pack-relative-relocs.sh +new file mode 100755 +index 000000000..e09d441e7 +--- /dev/null ++++ b/test/elf/z-pack-relative-relocs.sh +@@ -0,0 +1,16 @@ ++#!/bin/bash ++. $(dirname $0)/common.inc ++ ++cat < ++int main() { ++ printf("Hello world\n"); ++} ++EOF ++ ++$CC -B. -o $t/exe $t/a.o -pie -Wl,-z,pack-relative-relocs ++ ++readelf -W -V $t/exe > $t/log ++grep -Fq GLIBC_2. $t/log || skip ++ ++grep -q GLIBC_ABI_DT_RELR $t/log diff --git a/sys-devel/mold/mold-1.10.1.ebuild b/sys-devel/mold/mold-1.10.1.ebuild deleted file mode 100644 index a574dbeb3b3a..000000000000 --- a/sys-devel/mold/mold-1.10.1.ebuild +++ /dev/null @@ -1,89 +0,0 @@ -# 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 ~ppc64 ~riscv ~x86" -fi - -# mold (AGPL-3) -# - xxhash (BSD-2) -LICENSE="AGPL-3 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}" - -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 -} diff --git a/sys-devel/mold/mold-2.0.0-r2.ebuild b/sys-devel/mold/mold-2.0.0-r2.ebuild new file mode 100644 index 000000000000..72bb46594d66 --- /dev/null +++ b/sys-devel/mold/mold-2.0.0-r2.ebuild @@ -0,0 +1,94 @@ +# 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 + "${FILESDIR}"/${P}-DT_RELR-dependency.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 +} diff --git a/sys-devel/mold/mold-2.0.0.ebuild b/sys-devel/mold/mold-2.0.0.ebuild deleted file mode 100644 index b355518cedf4..000000000000 --- a/sys-devel/mold/mold-2.0.0.ebuild +++ /dev/null @@ -1,89 +0,0 @@ -# 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}" - -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 -} -- cgit v1.2.3