diff options
Diffstat (limited to 'sys-devel/mold')
-rw-r--r-- | sys-devel/mold/Manifest | 7 | ||||
-rw-r--r-- | sys-devel/mold/files/mold-1.4.1-glob-tests.patch | 296 | ||||
-rw-r--r-- | sys-devel/mold/metadata.xml | 3 | ||||
-rw-r--r-- | sys-devel/mold/mold-1.4.1.ebuild | 103 | ||||
-rw-r--r-- | sys-devel/mold/mold-9999.ebuild | 76 |
5 files changed, 445 insertions, 40 deletions
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index a7448ca46c5e..2393d61aa249 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,10 +1,13 @@ AUX mold-1.2.1-install-nopython.patch 1178 BLAKE2B 62092d363291f640567e334a7d16e90640b5e98a972729340527eb1a10f7febd77b6ae6a71e82c93c4d8c3ea04812893b1a42cd7404b3d6aba6bd35ede308567 SHA512 c22cd13018472ecf84fbd9a192c7072e4d7cd263e9bb19a94b1997014b110790266c7ae62977ce716aedb659a5d40be4bc95e8c0dbb2b8b5cf8e1d799fff4887 AUX mold-1.3.0-openssl-pkgconfig.patch 887 BLAKE2B c014be11c2e18b8df12f156ac8a40468afdf1b0b600c9af73a7373063b1e3658dd199b5ef3bd538641720bfbe10c602d96b0066420c321affb5d2f432fbbda57 SHA512 072f311bdbde5b556bcf1916d5586124007d0d47642c3555cd76c96d19fc1b77ef2f260937bcdc9014201c2a702ce5b4d9612cfdfab1e7b5d80882db2332329a AUX mold-1.3.1-fix-riscv-set32.patch 831 BLAKE2B 103fa9944f16993842b941b607b7e157b8fa31064fd7a115c8f1da4b617b98939b55caae98b246047e6ec0fa136d2b175001ab4dd18df5817cb282fd4e3aad9c SHA512 03b1ae4708826df19d7a879b985f7e81ad283abace64e306b982800ba633136d8f01b00221b3d9ca57fe3b21eb2796af33b0c3fbee4d94e6bb9e84043828fe01 +AUX mold-1.4.1-glob-tests.patch 5512 BLAKE2B bade33580bb63e58541dc1bafe4dc0fd0592e752e6f6003e67e210899ac3f4ee31490d40ee00c8af6ffd222744c56f74c677ba9e4aec2f3c2f4a9fc117846287 SHA512 712c878a649c13808509454fd65c10810777f1ca655365aa7fd3cf25e79247b88367ab454e6508e13f3f932ccc71ae25e4459fb6d3d107efcbe30e943e2f4bfa DIST mold-1.3.1.tar.gz 4692379 BLAKE2B e34e9416cfc65d2097c4659ddc205a0c4492e50a1c6e4560006757e5c371d27410e38131f353cd0ee60b124e5fe42b0a1c50cdc3a7bed9f666596e608340e4fd SHA512 f576d2fcfee5cb3bade5ba24dcdd3020a16131ce7d4c3a00c3f92b94785ed86f3f040a6f5814b9c975c4c3d90a2b8c36a8101d5fbf1bc0a4be316f4a4a6dcefa DIST mold-1.4.0.tar.gz 4722082 BLAKE2B 65ac52724018f5df82ca40b287a5f3b2c3e4b6b313ef2573bfd0ed6d03054d92b9e1e52cbdad1930406cff232c4b952c33a16979968502c439b860bd782726a9 SHA512 7b7c4a7bac6bbc6e22372d93d94a6cb804c7017eba16b90e9bbc42b9608108c724ef55337aabdd9ce2f5244b94c8fd64311e70e18b5f8cf5f68533c2639e550d +DIST mold-1.4.1.tar.gz 6280266 BLAKE2B 60d0a876e0bcc8f644e4b6fffe0de14299bf2bd6e382869c87761d725dca6efa874cac37aaf94ad85038c5a24521ed3582782be943236ab81c2e4b66e6002f5e SHA512 304caf4e9d9b24170a9442a84036790407bd02609a5d07c31e5f0f6285128099cbc962571804636a5da55afda59b447c12218f9e4d402fbfa55ebc354814bdda EBUILD mold-1.3.1-r1.ebuild 2264 BLAKE2B 5353e5967cae7cbfcf4d768d42c23701ecbc0016c6b5e177d655ca2a6c578df202b7598850af9c9cf527ea5361c6ffbedf18d39b8a1adfbfdf3ab7036cae2802 SHA512 44bb07f58b481536ad247da9576dc9ab510b2e4148dc2a4c94cf6c356409344a21319b1a59ee576f6ec41422631158cc6d540aa4fc4105dcc81b8d071952b611 EBUILD mold-1.3.1.ebuild 2200 BLAKE2B 7e8a4f95b4edfe6642f6409cd41ef8bf9938ac5c688d0942d74c074b0cc0f1de0b1cf491f876685c59c04934d882cf8e728820b7ea9064a5d0700058ea0842fd SHA512 e962c064be2f8fe1699838fe93ead8b5864dcc64f0f4b10b052522d6099cdeb3d2096fee74b6951d0aa18e2f09ad99d595c1f0e5f4666788eebb80fcd03a6000 EBUILD mold-1.4.0.ebuild 2200 BLAKE2B 7e8a4f95b4edfe6642f6409cd41ef8bf9938ac5c688d0942d74c074b0cc0f1de0b1cf491f876685c59c04934d882cf8e728820b7ea9064a5d0700058ea0842fd SHA512 e962c064be2f8fe1699838fe93ead8b5864dcc64f0f4b10b052522d6099cdeb3d2096fee74b6951d0aa18e2f09ad99d595c1f0e5f4666788eebb80fcd03a6000 -EBUILD mold-9999.ebuild 2193 BLAKE2B 12b3d1d0a480392843605f906051bc8e83c988cb2e9717c5b1ae2dcd0d4f5503487c5245e24fd32e9dceaa4083b05e0862582a6e78078be7b9646d416aac7172 SHA512 7562327a3f6c95dec206df868bc4f8c1cf59b2962249811068bd106ad480c4a5769aa1194b88ee8e20e3477b67ec51a068d3049f7ab786ab5fa3c1b8f539b1b5 -MISC metadata.xml 424 BLAKE2B a1c0cbdcb86c323fa1e6143c9665ec548f7713e74002a25b2fc26c51b60dae00922d3448a5aaecd5027a8cb026a681386ca7dea90657a3e10b25fb194dafc0d3 SHA512 1adc934e78ca0210743a1aa7479ebc4b5ea0b66a348c4408423460f02b404b885d3a8eca6e89ea8ac53ac9c76e85116965f1eef79e3f3e1f0451c8cf5ce0dfd6 +EBUILD mold-1.4.1.ebuild 2523 BLAKE2B 918cacb29b353bffe93f6b8164608aad604c8677b266c208913578daec2ee2ce95d619611b7601cd37f5db7e16f84d2929cd759f13c9ccec151243802fc40faa SHA512 a5d56159205814b4148faf68a9945d1915386472b2c42c4c2041a0ca3f78146a8ca3649a0a565af5d05d30d9d1fdb76aa6b6db60e2b0bd1a071255d60c6956a3 +EBUILD mold-9999.ebuild 2390 BLAKE2B 4ec131858d22054500485e7b534f571cc313b2ad8f223825508939c74f075e47e278ab5e5b5f01c42d33a1a784a087bbc35439d768004ee0a661174648ad94da SHA512 e85c79d6670bc86f20448e389c7fb60d59fa0e0ef24bb5bc740bde50ba7f9999e70352cbe1017d3b26f0b69a95f679603e2fccf3230c957314d29cd0018af498 +MISC metadata.xml 521 BLAKE2B beb00b6a0cf0b062e5ca97aaf42cc39dfd35459159b9b84c894909dd19ecf5e7bf22aea234de31b9deddbeb26b8b64e0cef306f606a78b279b915c0c20cb4e33 SHA512 ca5c1bd9e7fbb02b79607133e28a00b44e4dbebd815b6a4f4c6e96514c43e744eee4a8485d6aaa5a34438dcc928a9082bfa07c392caf4fe1290a584ec69efa58 diff --git a/sys-devel/mold/files/mold-1.4.1-glob-tests.patch b/sys-devel/mold/files/mold-1.4.1-glob-tests.patch new file mode 100644 index 000000000000..ad9dda565323 --- /dev/null +++ b/sys-devel/mold/files/mold-1.4.1-glob-tests.patch @@ -0,0 +1,296 @@ +From 60070e0c1352a1cc6b02a0d1a30c657368a033c3 Mon Sep 17 00:00:00 2001 +From: Rui Ueyama <ruiu@bluewhale.systems> +Date: Fri, 19 Aug 2022 20:05:26 +0800 +Subject: [PATCH] Simplify + +--- + test/elf/CMakeLists.txt | 265 +------------------------------------- + test/macho/CMakeLists.txt | 100 +------------- + 2 files changed, 6 insertions(+), 359 deletions(-) + +diff --git a/test/elf/CMakeLists.txt b/test/elf/CMakeLists.txt +index 5d15d6cb..138e8205 100644 +--- a/test/elf/CMakeLists.txt ++++ b/test/elf/CMakeLists.txt +@@ -1,269 +1,12 @@ +-set(MOLD_ELF_TESTS +- absolute-symbols +- allow-multiple-definition +- ar-alignment +- arm32-thumb-interwork +- as-needed +- as-needed-weak +- as-needed2 +- auxiliary +- basic +- bno-symbolic +- bsymbolic +- bsymbolic-functions +- bug178 +- build-id +- canonical-plt +- cmdline +- color-diagnostics +- comment +- common +- common-archive +- common-ref +- compress-debug-sections +- compressed-debug-info +- compressed-debug-info-gnu +- copyrel +- copyrel-protected +- copyrel-relro +- dead-debug-sections +- debug-macro-section +- default-symver +- defsym +- defsym2 +- demangle +- demangle-rust +- dependency-file +- disable-new-dtags +- discard +- dso-undef +- dt-init +- dt-needed +- duplicate-error +- dynamic +- dynamic-dt-debug +- dynamic-linker +- dynamic-list +- dynamic-list2 +- dynamic-list3 +- emit-relocs +- empty-file +- empty-input +- empty-version +- emulation-deduction +- entry +- exception +- exception-mcmodel-large +- exclude-libs +- exclude-libs2 +- exclude-libs3 +- execstack +- execstack-if-needed +- export-dynamic +- export-from-exe +- fatal-warnings +- filler +- filter +- func-addr +- gc-sections +- gdb-index-compress-output +- gdb-index-dwarf2 +- gdb-index-dwarf3 +- gdb-index-dwarf4 +- gdb-index-dwarf5 +- gdb-index-empty +- glibc-2.22-bug +- gnu-hash +- gnu-linkonce +- gnu-retain +- gnu-unique +- gnu-warning +- hello-dynamic +- hello-static +- help +- hidden-undef +- icf +- icf-small +- ifunc-dso +- ifunc-dynamic +- ifunc-export +- ifunc-static +- ifunc-static-pie +- image-base +- incompatible-libs +- incompatible-libs2 +- incompatible-obj +- init +- init-array +- init-array-priorities +- init-array-readonly +- init-in-dso +- initfirst +- interpose +- invalid-version-script +- large-alignment +- large-alignment-dso +- link-order +- linker-script +- linker-script-defsym +- linker-script2 +- linker-script3 +- linker-script4 +- lto-archive +- lto-dso +- lto-gcc +- lto-llvm +- lto-version-script +- many-sections +- mergeable-records +- mergeable-strings +- missing-but-ok +- missing-error +- mold-wrapper +- mold-wrapper2 +- no-quick-exit +- nocopyreloc +- noinhibit-exec +- non-canonical-plt +- nostdlib +- note +- note-property +- note2 +- now +- oformat-binary +- omagic +- pack-dyn-relocs-relr +- package-metadata +- pie +- plt +- plt-dso +- pltgot +- preinit-array +- print-dependencies +- protected +- protected-dynsym +- push-pop-state +- relax +- reloc +- reloc-overflow +- reloc-rodata +- reloc-zero +- relocatable +- relocatable-archive +- relro +- repro +- require-defined +- response-file +- retain-symbols-file +- reverse-sections +- rodata-name +- rosegment +- rpath +- run +- run-clang +- section-alignment +- section-name +- section-start +- shared +- shuffle-sections +- shuffle-sections-seed +- soname +- start-lib +- start-stop-symbol +- static-archive +- static-pie +- stdout +- strip +- symbol-rank +- symbol-version +- symbol-version2 +- symbol-version3 +- symtab +- symtab-dso +- symtab-section-symbols +- synthetic-symbols +- sysroot +- sysroot-linker-script +- sysroot2 +- thin-archive +- thread-count +- tls-common +- tls-dso +- tls-gd +- tls-gd-mcmodel-large +- tls-gd-noplt +- tls-gd2 +- tls-ie +- tls-large-tbss +- tls-ld +- tls-ld-mcmodel-large +- tls-ld-noplt +- tls-le +- tls-module-base +- tls-nopic +- tls-pic +- tlsdesc +- tlsdesc-import +- tlsdesc-static +- trace +- trace-symbol +- undefined +- unique +- unresolved-symbols +- verbose +- version +- version-script +- version-script10 +- version-script11 +- version-script12 +- version-script13 +- version-script14 +- version-script15 +- version-script16 +- version-script17 +- version-script2 +- version-script3 +- version-script4 +- version-script5 +- version-script6 +- version-script7 +- version-script8 +- version-script9 +- versioned-undef +- visibility +- warn-common +- warn-execstack +- warn-once +- warn-shared-textrel +- warn-textrel +- warn-unresolved-symbols +- weak-export-dso +- weak-export-exe +- weak-undef +- whole-archive +- wrap +- z-cet-report +- z-defs +- z-ibt +- z-ibtplt +- z-max-page-size +- z-nodefaultlib +- z-nodump +- z-now +- z-origin +- z-separate-code +- z-shstk +- z-text +- z-unknown +- ) +- + option(MOLD_ENABLE_QEMU_TESTS "Enable tests for other targets" OFF) + ++file(GLOB MOLD_ELF_TESTS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.sh") ++ + function(mold_add_arch_test NAME TRIPLE MACHINE) + if(NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL ${MACHINE}) + set(TEST_NAME "${MACHINE}-${NAME}") + add_test(NAME ${TEST_NAME} +- COMMAND bash -x ${CMAKE_CURRENT_LIST_DIR}/${NAME}.sh ++ COMMAND bash -x ${CMAKE_CURRENT_LIST_DIR}/${NAME} + WORKING_DIRECTORY ${mold_BINARY_DIR}) + + set(TEST_ENV +@@ -280,7 +23,7 @@ endfunction() + + foreach(TEST IN LISTS MOLD_ELF_TESTS) + add_test(NAME "${CMAKE_HOST_SYSTEM_PROCESSOR}-${TEST}" +- COMMAND bash -x ${CMAKE_CURRENT_LIST_DIR}/${TEST}.sh ++ COMMAND bash -x ${CMAKE_CURRENT_LIST_DIR}/${TEST} + WORKING_DIRECTORY ${mold_BINARY_DIR}) + + if(MOLD_ENABLE_QEMU_TESTS) diff --git a/sys-devel/mold/metadata.xml b/sys-devel/mold/metadata.xml index f8a85299d5bb..20ae5863a76b 100644 --- a/sys-devel/mold/metadata.xml +++ b/sys-devel/mold/metadata.xml @@ -12,4 +12,7 @@ <upstream> <remote-id type="github">rui314/mold</remote-id> </upstream> + <use> + <flag name="system-tbb">Use dev-cpp/tbb package instead of vendored copy</flag> + </use> </pkgmetadata> diff --git a/sys-devel/mold/mold-1.4.1.ebuild b/sys-devel/mold/mold-1.4.1.ebuild new file mode 100644 index 000000000000..1aac8ca1098e --- /dev/null +++ b/sys-devel/mold/mold-1.4.1.ebuild @@ -0,0 +1,103 @@ +# Copyright 2021-2022 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 ~riscv" +fi + +# mold (AGPL-3) +# - xxhash (BSD-2) +# - tbb (Apache-2.0) +LICENSE="AGPL-3 Apache-2.0 BSD-2" +SLOT="0" +IUSE="system-tbb" + +RDEPEND=" + sys-libs/zlib + system-tbb? ( >=dev-cpp/tbb-2021.4.0:= ) + !kernel_Darwin? ( + >=dev-libs/mimalloc-2:= + dev-libs/openssl:= + ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + # Allows us to rm the tests as before. Will be included in next + # release. + "${FILESDIR}"/mold-1.4.1-glob-tests.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 + + # Don't require python + sed -i '/find_package(Python3/d' CMakeLists.txt || die + sed -i '/add_dependencies/d' CMakeLists.txt || die + cat <<EOF>git-hash.cc +#include <string> +namespace mold { +std::string mold_git_hash = "gentoo-${PVR}"; +} +EOF +} + +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=$(usex system-tbb) + ) + cmake_src_configure +} + +src_install() { + dobin "${BUILD_DIR}"/${PN} + dolib.so "${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-9999.ebuild b/sys-devel/mold/mold-9999.ebuild index 2a7faac5052d..b170b570b827 100644 --- a/sys-devel/mold/mold-9999.ebuild +++ b/sys-devel/mold/mold-9999.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit toolchain-funcs +inherit cmake toolchain-funcs DESCRIPTION="A Modern Linker" HOMEPAGE="https://github.com/rui314/mold" @@ -12,28 +12,26 @@ if [[ ${PV} == 9999 ]] ; then inherit git-r3 else SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64" + KEYWORDS="~amd64 ~riscv" fi -LICENSE="AGPL-3" +# mold (AGPL-3) +# - xxhash (BSD-2) +# - tbb (Apache-2.0) +LICENSE="AGPL-3 Apache-2.0 BSD-2" SLOT="0" +IUSE="system-tbb" -RDEPEND=">=dev-cpp/tbb-2021.4.0:= +RDEPEND=" sys-libs/zlib + system-tbb? ( >=dev-cpp/tbb-2021.4.0:= ) !kernel_Darwin? ( >=dev-libs/mimalloc-2:= dev-libs/openssl:= - )" -# As of 1.1, xxhash is now a header-only dep, but it's now bundled :( -# TODO: restore SYSTEM_XXHASH upstream? + ) +" DEPEND="${RDEPEND}" -PATCHES=( - # Bug #841575 - "${FILESDIR}"/${PN}-1.2.1-install-nopython.patch - "${FILESDIR}"/${PN}-1.3.0-openssl-pkgconfig.patch -) - pkg_pretend() { # Requires a c++20 compiler, see #831473 if [[ ${MERGE_TYPE} != binary ]]; then @@ -46,7 +44,7 @@ pkg_pretend() { } src_prepare() { - default + cmake_src_prepare # Needs unpackaged dwarfdump rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die @@ -64,34 +62,36 @@ src_prepare() { if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then rm test/elf/{,ifunc-}static-pie.sh || die fi -} - -src_compile() { - tc-export CC CXX - emake \ - CFLAGS="${CFLAGS}" \ - CXXFLAGS="${CXXFLAGS}" \ - SYSTEM_TBB=1 \ - SYSTEM_MIMALLOC=1 \ - STRIP="true" \ - LIBDIR="${EPREFIX}/usr/$(get_libdir)" + # Don't require python + sed -i '/find_package(Python3/d' CMakeLists.txt || die + sed -i '/add_dependencies/d' CMakeLists.txt || die + cat <<EOF>git-hash.cc +#include <string> +namespace mold { +std::string mold_git_hash = "gentoo-${PVR}"; +} +EOF } -src_test() { - emake \ - SYSTEM_TBB=1 \ - SYSTEM_MIMALLOC=1 \ - check +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=$(usex system-tbb) + ) + cmake_src_configure } src_install() { - emake \ - SYSTEM_TBB=1 \ - SYSTEM_MIMALLOC=1 \ - DESTDIR="${D}" \ - PREFIX="${EPREFIX}/usr" \ - LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ - STRIP="true" \ - install + dobin "${BUILD_DIR}"/${PN} + dolib.so "${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 } |