diff options
author | Matthew Smith <matthew@gentoo.org> | 2022-08-19 18:50:30 +0100 |
---|---|---|
committer | Matthew Smith <matthew@gentoo.org> | 2022-08-19 18:55:13 +0100 |
commit | 8c985cde69b8ea7384e1aead73a21230ec6345d4 (patch) | |
tree | 7721ef2a1b3622569a669f8e12b10eef71dc7389 /sys-devel | |
parent | app-editors/emacs: Stabilize 28.1-r2 ppc64, #865817 (diff) | |
download | gentoo-8c985cde69b8ea7384e1aead73a21230ec6345d4.tar.gz gentoo-8c985cde69b8ea7384e1aead73a21230ec6345d4.tar.bz2 gentoo-8c985cde69b8ea7384e1aead73a21230ec6345d4.zip |
sys-devel/mold: add 1.4.1
Also switch to new CMake build system, and add a (currently masked)
USE-flag to switch between vendored and system tbb.
Signed-off-by: Matthew Smith <matthew@gentoo.org>
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/mold/Manifest | 1 | ||||
-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 |
4 files changed, 403 insertions, 0 deletions
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest index 180c8cf53493..de469cd16390 100644 --- a/sys-devel/mold/Manifest +++ b/sys-devel/mold/Manifest @@ -1,2 +1,3 @@ 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 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 +} |