[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2024-07-02 Thread Sam James
commit: bf9cbb53ac91ce4d3568f7bb51ebc6703f4ead32
Author: Sam James  gentoo  org>
AuthorDate: Wed Jul  3 01:40:29 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jul  3 01:40:29 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf9cbb53

sys-devel/mold: add 2.32.1

Signed-off-by: Sam James  gentoo.org>

 sys-devel/mold/Manifest  |   1 +
 sys-devel/mold/files/mold-2.32.1-libdl.patch |  20 ++
 sys-devel/mold/mold-2.32.1.ebuild| 103 +++
 3 files changed, 124 insertions(+)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 91d423fc5efb..168f6f751304 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -2,3 +2,4 @@ DIST mold-2.1.0.tar.gz 9278811 BLAKE2B 
b31e13f92177553adf5069cf35c8c75c7bc28f0af
 DIST mold-2.30.0.tar.gz 9957539 BLAKE2B 
f45924598029dabfb2c02298e1f89aae848cd64e2e87dd80f500de323517db92e62df798feee8a2cd81cb930eff0640c2b9957808a4080f0027884015994ce64
 SHA512 
7cfba4f0fb332799ad267d3eafb8e2f0057af4484467b3e3fbaf8044220163a2c7e26cd1786510f250844c8b57e30c15167c8dd9688af1773abc580c5605abf3
 DIST mold-2.31.0.tar.gz 10031469 BLAKE2B 
338f516efcb430c8393fb0d6861b913fa1dd0095226e3d13018255da4f0b4affa168928b1e5cfbd0b5a4efcf840612675f04579f0c1d3c0e2b3c6815d6bef4c0
 SHA512 
343c62d8c67b74988f762c46999d2d866b2e9a0c69d2b910b12384ea5abc620b30468cd1b1bacfe41474d1c97c8ce2e49d55ca70479691238fb73d83d9adc683
 DIST mold-2.32.0.tar.gz 10005686 BLAKE2B 
a277a29498f4d6b33da49ba038ce5ef1c4a1bd3ac84ea994a2aae5d36139a2ee773e08e1a3ff0a7382da4d2319ce994575e3ed1e5be8e5f7a161045aaf4e2d58
 SHA512 
66cd95ec65b31749ead7604f921eebd9f8e7faad82f6aa2cd7a179e4f4cb2bd78584ec5a8de000fbd4c37bbbfeb878e40a4e93ca909d1be557d73117e4b38f4b
+DIST mold-2.32.1.tar.gz 10010384 BLAKE2B 
b020d57df25d91fac9b6ef994e9f7f73b6736d18a73be3caebe03a851a1db1986abe395b5481a1e30e01f38362c3705cb5903251b7201c0003c745dee37a5148
 SHA512 
d38b12faf81ba8015fc0cdb52944ac94366877c3033871a92610087e036d75b3d072baf9bbf107a9029495521e067fb36c0809b5138f90976492547b39c33085

diff --git a/sys-devel/mold/files/mold-2.32.1-libdl.patch 
b/sys-devel/mold/files/mold-2.32.1-libdl.patch
new file mode 100644
index ..994137938b68
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.32.1-libdl.patch
@@ -0,0 +1,20 @@
+https://github.com/rui314/mold/commit/091395df335d577adc2a09e854a129f02081c576
+
+From 091395df335d577adc2a09e854a129f02081c576 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama 
+Date: Fri, 28 Jun 2024 11:00:36 +0900
+Subject: [PATCH] Link with `-ldl` for dlopen()
+
+Fixes https://github.com/rui314/mold/issues/1293
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -61,6 +61,8 @@ target_compile_features(mold PRIVATE cxx_std_20)
+ 
+ if(MINGW)
+   target_link_libraries(mold PRIVATE dl)
++else()
++  target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS})
+ endif()
+ 
+ if(NOT "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC")
+

diff --git a/sys-devel/mold/mold-2.32.1.ebuild 
b/sys-devel/mold/mold-2.32.1.ebuild
new file mode 100644
index ..5c267ea9c1cb
--- /dev/null
+++ b/sys-devel/mold/mold-2.32.1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 2021-2024 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} ==  ]] ; 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
+fi
+
+# mold (MIT)
+#  - xxhash (BSD-2)
+#  - siphash ( MIT CC0-1.0 )
+LICENSE="MIT BSD-2 CC0-1.0"
+SLOT="0"
+
+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}"/${P}-libdl.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 || 

[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2023-10-18 Thread Sam James
commit: 048526669f36e549fb4847126ab510a42de361a9
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct 18 15:41:14 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct 18 15:42:57 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04852666

sys-devel/mold: add 2.3.0, disable PCH

PCH is buggy and not worth it (especially for clean builds where we're not
installing any headers too...)

Signed-off-by: Sam James  gentoo.org>

 sys-devel/mold/Manifest|  1 +
 sys-devel/mold/files/mold-2.3.0-no-pch.patch   | 12 
 sys-devel/mold/{mold-.ebuild => mold-2.3.0.ebuild} |  7 ++-
 sys-devel/mold/mold-.ebuild|  7 ++-
 4 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 9c33e11ccd3f..6cb0c98c07e3 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -2,3 +2,4 @@ DIST mold-1.11.0.tar.gz 8210923 BLAKE2B 
b3854a14a956dd568625fc28c96636e7cadf81b9
 DIST mold-2.0.0.tar.gz 9205927 BLAKE2B 
f80c72c58f4618a74390417fdf90f816810350baf1ac74d21294f5ffba7ee263807175be531c9db77209bd05a31ad11fd84d4aeb03fb057cefac7575f71612d6
 SHA512 
11c3d1e07fe4fcc28cff58b8e432526e4604aa55b49fa47c9495e439206fb9f6a1686b1c5bd2dc907ffd7fe62ac1c72317619fc8a5d7caaa5c327de585f16827
 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B 
b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a
 SHA512 
f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
 DIST mold-2.2.0.tar.gz 9956678 BLAKE2B 
495772b5bfd238a6785676d277da87fe4f10b64513f8f0a4961893e4ae8954ad8bda3d09283de14594d7d056d6c1aeed5be591d6a64868a473eb45737d3b9340
 SHA512 
1692d1ff154335fdff91a4fafebb3514ed6742035c14e74ec7e552b90428a1cd5341baba9183158b44ae221fd19e86da55e7f04bde317b943a24d0afecb41002
+DIST mold-2.3.0.tar.gz 9958893 BLAKE2B 
86235731953902a5cd8fdba8b41d456bd60bf53b96a9e1cc89bdf991a75367b95e5522887be8e9c28f3d777b143ef5d693ff50293188ef222fc45257ce990d24
 SHA512 
7953cff8f2e9f775f0890aedc5f38ef07aac16118310ee9e1a2a82be8abafa1aa05459a136181978c55763737c7ff47815afdd4423e8f96db8f0237fce13e6b4

diff --git a/sys-devel/mold/files/mold-2.3.0-no-pch.patch 
b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
new file mode 100644
index ..e61b5df01f54
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
@@ -0,0 +1,12 @@
+We generally disable PCH in Gentoo because of how buggy it is.
+--- a/CMakeLists.txt
 b/CMakeLists.txt
+@@ -400,7 +400,7 @@ endif()
+ 
+ # Add frequently included header files for pre-compiling.
+ # target_precompile_headers is supported by CMake 3.16.0 or newer.
+-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
++if(FALSE)
+   if(MOLD_IS_SOLD)
+ target_precompile_headers(mold PRIVATE
+   "$<$:${CMAKE_SOURCE_DIR}/elf/mold.h>"

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-2.3.0.ebuild
similarity index 93%
copy from sys-devel/mold/mold-.ebuild
copy to sys-devel/mold/mold-2.3.0.ebuild
index 42cd25dd9155..f16aabe0758e 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-2.3.0.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} ==  ]] ; then
inherit git-r3
 else
SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
-   KEYWORDS="~amd64 ~loong"
+   KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
 fi
 
 # mold (MIT)
@@ -31,6 +31,10 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+   "${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+)
+
 pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then
@@ -65,6 +69,7 @@ src_prepare() {
 
 src_configure() {
local mycmakeargs=(
+   -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
-DMOLD_ENABLE_QEMU_TESTS=OFF
-DMOLD_LTO=OFF # Should be up to the user to decide this with 
CXXFLAGS.
-DMOLD_USE_SYSTEM_MIMALLOC=ON

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-.ebuild
index 42cd25dd9155..f16aabe0758e 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} ==  ]] ; then
inherit git-r3
 else
SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz"
-   KEYWORDS="~amd64 ~loong"
+   KEYWORDS="~amd64 ~arm64 ~loong ~riscv ~x86"
 fi
 
 # mold (MIT)
@@ -31,6 +31,10 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+   "${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+)
+
 pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then
@@ -65,6 +69,7 @@ src_prepare() {
 
 src_configure() {
local mycmakeargs=(
+   -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
-DMOLD_ENABLE_QEMU_TESTS=OFF

[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2023-08-08 Thread Sam James
commit: 0b8e1cc4c541041f00338d897d34fabe66ae87b8
Author: Sam James  gentoo  org>
AuthorDate: Wed Aug  9 03:10:49 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Aug  9 03:11:03 2023 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b8e1cc4

sys-devel/mold: backport DT_RELR fix

Bug: https://bugs.gentoo.org/911591
Signed-off-by: Sam James  gentoo.org>

 .../mold/files/mold-2.0.0-DT_RELR-dependency.patch | 161 +
 sys-devel/mold/mold-2.0.0-r2.ebuild|  94 
 2 files changed, 255 insertions(+)

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 ..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.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 ) {
+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 *)[0];
+@@ -2394,14 +2395,14 @@ void VerneedSection::construct(Context ) {
+   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 ) {
+ 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 

[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2022-08-20 Thread Matthew Smith
commit: ff754ddf643973da9cabf7778504572e6451b2e8
Author: Matthew Smith  gentoo  org>
AuthorDate: Sat Aug 20 06:35:44 2022 +
Commit: Matthew Smith  gentoo  org>
CommitDate: Sat Aug 20 06:37:32 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff754ddf

sys-devel/mold: fix build with gcc-12

Prevent overeager stripping of compiler flags by vendored
tbb CMake scripts.

No revbump as installed files are the same.

Closes: https://bugs.gentoo.org/865837
Signed-off-by: Matthew Smith  gentoo.org>

 .../files/mold-1.4.1-tbb-flags-stripping.patch | 28 ++
 sys-devel/mold/mold-1.4.1.ebuild   |  2 ++
 sys-devel/mold/mold-.ebuild|  5 
 3 files changed, 35 insertions(+)

diff --git a/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch 
b/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch
new file mode 100644
index ..58cfca04132e
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch
@@ -0,0 +1,28 @@
+https://github.com/oneapi-src/oneTBB/pull/716
+https://bugs.gentoo.org/865837
+
+From 9595b9699ae6863d1e0cf770a89728eafcaf8845 Mon Sep 17 00:00:00 2001
+From: Christoph Erhardt 
+Date: Wed, 5 Jan 2022 15:13:32 +0100
+Subject: [PATCH] Fix overeager stripping of compile flag
+
+The existing regex strips all occurrences of the given string from
+`${CMAKE_CXX_FLAGS}`, regardless of whether it is just a substring of a
+flag. For instance, `-Werror=format-security` gets truncated to
+`=format-security`.
+
+The new regex makes sure that only whole words get replaced.
+
+Signed-off-by: Christoph Erhardt 
+--- a/third-party/tbb/cmake/utils.cmake
 b/third-party/tbb/cmake/utils.cmake
+@@ -18,7 +18,7 @@ macro(tbb_remove_compile_flag flag)
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY 
COMPILE_OPTIONS ${_tbb_compile_options})
+ unset(_tbb_compile_options)
+ if (CMAKE_CXX_FLAGS)
+-string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
++string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " 
CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ endif()
+ endmacro()
+ 
+

diff --git a/sys-devel/mold/mold-1.4.1.ebuild b/sys-devel/mold/mold-1.4.1.ebuild
index 1aac8ca1098e..804483084d56 100644
--- a/sys-devel/mold/mold-1.4.1.ebuild
+++ b/sys-devel/mold/mold-1.4.1.ebuild
@@ -36,6 +36,8 @@ PATCHES=(
# Allows us to rm the tests as before. Will be included in next
# release.
"${FILESDIR}"/mold-1.4.1-glob-tests.patch
+   # https://bugs.gentoo.org/865837
+   "${FILESDIR}"/mold-1.4.1-tbb-flags-stripping.patch
 )
 
 pkg_pretend() {

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-.ebuild
index b170b570b827..735bfbb79a24 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-.ebuild
@@ -32,6 +32,11 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+   # https://bugs.gentoo.org/865837
+   "${FILESDIR}"/mold-1.4.1-tbb-flags-stripping.patch
+)
+
 pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then



[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2022-06-26 Thread Matthew Smith
commit: 78147a1e291cd661a15126c31ff4374675609a94
Author: Matthew Smith  gentoo  org>
AuthorDate: Sun Jun 26 12:46:10 2022 +
Commit: Matthew Smith  gentoo  org>
CommitDate: Sun Jun 26 12:54:19 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78147a1e

sys-devel/mold: use pkg-config to find OpenSSL

Signed-off-by: Matthew Smith  gentoo.org>

 .../mold/files/mold-1.3.0-openssl-pkgconfig.patch  | 28 ++
 sys-devel/mold/mold-.ebuild|  1 +
 2 files changed, 29 insertions(+)

diff --git a/sys-devel/mold/files/mold-1.3.0-openssl-pkgconfig.patch 
b/sys-devel/mold/files/mold-1.3.0-openssl-pkgconfig.patch
new file mode 100644
index ..d2ed0af47b41
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.3.0-openssl-pkgconfig.patch
@@ -0,0 +1,28 @@
+From a4fde946f49cddf4f7c1eceb3b86ca38375cec1d Mon Sep 17 00:00:00 2001
+From: Matthew Smith 
+Date: Sun, 26 Jun 2022 13:44:36 +0100
+Subject: [PATCH] Revert "Do not use pkg-config"
+
+This reverts commit 4ef90d4316bbba3a4b8902e38bf5f68171cc6ab7.
+--- a/Makefile
 b/Makefile
+@@ -18,6 +18,9 @@ ifeq ($(origin CXX), default)
+   CXX = c++
+ endif
+ 
++# Allow overriding pkg-config binary
++PKG_CONFIG = pkg-config
++
+ # If you want to keep symbols in the installed binary, run make with
+ # `STRIP=true` to run /bin/true instead of the strip command.
+ STRIP = strip
+@@ -100,7 +103,8 @@ ifeq ($(OS), Darwin)
+ endif
+ 
+ ifeq ($(NEEDS_LIBCRYPTO), 1)
+-  MOLD_LDFLAGS += -lcrypto
++  MOLD_CXXFLAGS += $(shell $(PKG_CONFIG) --cflags-only-I openssl)
++  MOLD_LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L openssl) -lcrypto
+ endif
+ 
+ # '-latomic' flag is needed building on riscv64 system.

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-.ebuild
index 87931221e192..d5c163c1ba90 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-.ebuild
@@ -31,6 +31,7 @@ DEPEND="${RDEPEND}"
 PATCHES=(
# Bug #841575
"${FILESDIR}"/${PN}-1.2.1-install-nopython.patch
+   "${FILESDIR}"/${PN}-1.3.0-openssl-pkgconfig.patch
 )
 
 pkg_pretend() {



[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2022-04-30 Thread Matthew Smith
commit: 135d88401a60dbbc0905c1f16391cea46b8d0cc0
Author: Matthew Smith  gentoo  org>
AuthorDate: Sat Apr 30 06:47:12 2022 +
Commit: Matthew Smith  gentoo  org>
CommitDate: Sat Apr 30 06:47:46 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=135d8840

sys-devel/mold: don't invoke python during build

Closes: https://bugs.gentoo.org/841575
Signed-off-by: Matthew Smith  gentoo.org>

 .../mold/files/mold-1.2.1-install-nopython.patch   | 34 ++
 .../{mold-1.2.1.ebuild => mold-1.2.1-r1.ebuild}|  5 
 sys-devel/mold/mold-.ebuild|  5 
 3 files changed, 44 insertions(+)

diff --git a/sys-devel/mold/files/mold-1.2.1-install-nopython.patch 
b/sys-devel/mold/files/mold-1.2.1-install-nopython.patch
new file mode 100644
index ..661d3dcf392f
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.2.1-install-nopython.patch
@@ -0,0 +1,34 @@
+From 4fb6d4208cfb20bad4a3491a18e78409b5a8183f Mon Sep 17 00:00:00 2001
+From: Matthew Smith 
+Date: Sat, 30 Apr 2022 07:42:50 +0100
+Subject: [PATCH] Don't invoke Python to create libexec/mold/ld symlink
+
+Reverts commits 8073a92614fb59f59570031badab5dd4bc3b4f7f and
+5803c3c200f301adc3abdb66df16d3d669712d70.
+
+Bug #841575
+---
+ Makefile | 7 +--
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d1abc850..10e053a9 100644
+--- a/Makefile
 b/Makefile
+@@ -204,12 +204,7 @@ install: all
+   $(STRIP) $D$(LIBDIR)/mold/mold-wrapper.so
+ 
+   $(INSTALL) -d $D$(LIBEXECDIR)/mold
+-
+-# We want to make a symblink with a relative path, so that users can
+-# move the entire directory to other place without breaking the reference.
+-# GNU ln supports `--relative` to do that, but that's not supported by
+-# non-GNU systems. So we use Python to compute a relative path.
+-  ln -sf `python3 -c "import os.path; 
print(os.path.relpath('$(BINDIR)/mold', '$(LIBEXECDIR)/mold'))"` 
$D$(LIBEXECDIR)/mold/ld
++  ln -sf $(BINDIR)/mold $D$(LIBEXECDIR)/mold/ld
+ 
+   $(INSTALL) -d $D$(MANDIR)/man1
+   $(INSTALL_DATA) docs/mold.1 $D$(MANDIR)/man1
+-- 
+2.35.3
+

diff --git a/sys-devel/mold/mold-1.2.1.ebuild 
b/sys-devel/mold/mold-1.2.1-r1.ebuild
similarity index 96%
rename from sys-devel/mold/mold-1.2.1.ebuild
rename to sys-devel/mold/mold-1.2.1-r1.ebuild
index a9e0aa6a2c2e..87931221e192 100644
--- a/sys-devel/mold/mold-1.2.1.ebuild
+++ b/sys-devel/mold/mold-1.2.1-r1.ebuild
@@ -28,6 +28,11 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
 # TODO: restore SYSTEM_XXHASH upstream?
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+   # Bug #841575
+   "${FILESDIR}"/${PN}-1.2.1-install-nopython.patch
+)
+
 pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-.ebuild
index a9e0aa6a2c2e..87931221e192 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-.ebuild
@@ -28,6 +28,11 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
 # TODO: restore SYSTEM_XXHASH upstream?
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+   # Bug #841575
+   "${FILESDIR}"/${PN}-1.2.1-install-nopython.patch
+)
+
 pkg_pretend() {
# Requires a c++20 compiler, see #831473
if [[ ${MERGE_TYPE} != binary ]]; then



[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2022-02-09 Thread Sam James
commit: a254bacec24ef5bdeb2e350fa77cab786cbe20b1
Author: Sam James  gentoo  org>
AuthorDate: Thu Feb 10 07:12:57 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Feb 10 07:50:12 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a254bace

sys-devel/mold: drop 1.0.0-r1, 1.0.1-r1, 1.0.2

Signed-off-by: Sam James  gentoo.org>

 sys-devel/mold/Manifest|  3 -
 .../mold/files/mold-1.0.1-no-gold-in-version.patch | 50 ---
 sys-devel/mold/mold-1.0.0-r1.ebuild| 67 
 sys-devel/mold/mold-1.0.1-r1.ebuild| 71 --
 sys-devel/mold/mold-1.0.2.ebuild   | 71 --
 5 files changed, 262 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 148258091bca..0c5e13683969 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,4 +1 @@
-DIST mold-1.0.0.tar.gz 3482927 BLAKE2B 
56ebc267370548a2f91a71ebeed87871cede6f564c29dc7d44a499b95fe570f6e9c8a717baf2d9e235c7057c41e735b315493bd23d3b44574d2a44b14aaf5ef8
 SHA512 
99ffd0b9e2ff7157cc8b26808675c9d3147bf88961155ae19ed9b0ac647b7ec31ee78d05062decc6d41e66d99aa0fdc398d119803929b8dbff51eb3d077c
-DIST mold-1.0.1.tar.gz 3675262 BLAKE2B 
0e40860d3c0a221d368c94b9f58c20b245ee61de6f9eb6d1454ed3b6f103933c79ddd7358049e2aacf497221232d952c2117ba2b3371cbe37fb8ad4ae42461c2
 SHA512 
cc03a7db395362b97879c28942397d4443d12b72e067b6f979b1ece4d8aab06154b4c1a0f4c57d6ac505bcd4f892bf9a355ad281d628d4d544d8f70edaf34b72
-DIST mold-1.0.2.tar.gz 4501088 BLAKE2B 
51bac4bd44a785893c04dd03ccef6119b41a036789938a354545e7a22f16852b52079b3a3e4d27db860748e13966be18bbe813bf04b15c496f35d16ecca4b22c
 SHA512 
27f6664e63c76c32a6e3ec8bfc4b204138926001f5431be94da9ce47a5d9d3b51aa634c5cd6df45be660d52ac0507f7b7eec17134e35db402db5747d2ecc3715
 DIST mold-1.0.3.tar.gz 4501162 BLAKE2B 
68db6708ae05b3a4caf19bff8b381c9a7d045b7313e15ee9c0765042ef02898404527735a8f5379a2d213a7654f656cfe24eb20497d6d4f5e9ed666988050733
 SHA512 
50b4a80c8b7a4925e6e85a35e92529867648df61ca016ee662b3fce7cf9d4a8fd717311ec0542aa594f44b49d48de34d51d7e94cae0f21bda01fdd4418990f38

diff --git a/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch 
b/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch
deleted file mode 100644
index 429e55cc51a9..
--- a/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From cea6a569afa544826c91fda7ef0f9941f50c9459 Mon Sep 17 00:00:00 2001
-From: Rui Ueyama 
-Date: Wed, 12 Jan 2022 16:31:04 +0900
-Subject: [PATCH] [ELF] Remove "GNU gold" from the --version string
-
-That substring was introduced in de7ba9014f9d9d70b9173c4bfac6c3433186ba49
-to appease Gentoo's dev-libs/jansson-2.13.1-r1 package. But I think I
-shouldn't done that from the beginning to avoid the sitaution of the
-"User-Agent" string of the web browser, which everybody claims they
-are Mozilla, AppleWebKit, Chrome and Safari simultaneously.

- main.cc | 4 ++--
- test/elf/version.sh | 6 +++---
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/main.cc b/main.cc
-index 38a41cdf..8831f7f2 100644
 a/main.cc
-+++ b/main.cc
-@@ -26,10 +26,10 @@ std::string_view errno_string() {
- 
- #ifdef GIT_HASH
- const std::string mold_version =
--  "mold " MOLD_VERSION " (" GIT_HASH "; compatible with GNU ld and GNU gold)";
-+  "mold " MOLD_VERSION " (" GIT_HASH "; compatible with GNU ld)";
- #else
- const std::string mold_version =
--  "mold " MOLD_VERSION " (compatible with GNU ld and GNU gold)";
-+  "mold " MOLD_VERSION " (compatible with GNU ld)";
- #endif
- 
- void cleanup() {
-diff --git a/test/elf/version.sh b/test/elf/version.sh
-index ae52b504..4ca576ef 100755
 a/test/elf/version.sh
-+++ b/test/elf/version.sh
-@@ -10,10 +10,10 @@ mold="$(pwd)/mold"
- t=out/test/elf/$testname
- mkdir -p $t
- 
--"$mold" -v | grep -q 'mold .*compatible with GNU ld and GNU gold'
--"$mold" --version | grep -q 'mold .*compatible with GNU ld and GNU gold'
-+"$mold" -v | grep -q 'mold .*compatible with GNU ld'
-+"$mold" --version | grep -q 'mold .*compatible with GNU ld'
- 
--"$mold" -V | grep -q 'mold .*compatible with GNU ld and GNU gold'
-+"$mold" -V | grep -q 'mold .*compatible with GNU ld'
- "$mold" -V | grep -q elf_x86_64
- "$mold" -V | grep -q elf_i386
- 

diff --git a/sys-devel/mold/mold-1.0.0-r1.ebuild 
b/sys-devel/mold/mold-1.0.0-r1.ebuild
deleted file mode 100644
index 8560f5f36a1e..
--- a/sys-devel/mold/mold-1.0.0-r1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2021-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold;
-if [[ ${PV} ==  ]] ; then
-   EGIT_REPO_URI="https://github.com/rui314/mold.git;
-   inherit git-r3
-else
-   

[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2022-01-20 Thread Michael Orlitzky
commit: 5ad0c179fe9c6c5cbfe3edde28f2759386675bb1
Author: Michael Orlitzky  gentoo  org>
AuthorDate: Thu Jan 20 14:37:42 2022 +
Commit: Michael Orlitzky  gentoo  org>
CommitDate: Thu Jan 20 14:40:30 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ad0c179

sys-devel/mold: new revision sans "GNU gold" in --version.

The new mold-1.0.1-r1 includes upstream commit cea6a569afa5 which
removes the string "GNU gold" from mold's --version string. This is
necessary on Gentoo to prevent false positives from tc-ld-is-gold() in
the toolchain-funcs eclass.

Closes: https://bugs.gentoo.org/831478
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Michael Orlitzky  gentoo.org>

 .../mold/files/mold-1.0.1-no-gold-in-version.patch | 50 ++
 .../{mold-1.0.1.ebuild => mold-1.0.1-r1.ebuild}|  4 +-
 2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch 
b/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch
new file mode 100644
index ..429e55cc51a9
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.0.1-no-gold-in-version.patch
@@ -0,0 +1,50 @@
+From cea6a569afa544826c91fda7ef0f9941f50c9459 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama 
+Date: Wed, 12 Jan 2022 16:31:04 +0900
+Subject: [PATCH] [ELF] Remove "GNU gold" from the --version string
+
+That substring was introduced in de7ba9014f9d9d70b9173c4bfac6c3433186ba49
+to appease Gentoo's dev-libs/jansson-2.13.1-r1 package. But I think I
+shouldn't done that from the beginning to avoid the sitaution of the
+"User-Agent" string of the web browser, which everybody claims they
+are Mozilla, AppleWebKit, Chrome and Safari simultaneously.
+---
+ main.cc | 4 ++--
+ test/elf/version.sh | 6 +++---
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/main.cc b/main.cc
+index 38a41cdf..8831f7f2 100644
+--- a/main.cc
 b/main.cc
+@@ -26,10 +26,10 @@ std::string_view errno_string() {
+ 
+ #ifdef GIT_HASH
+ const std::string mold_version =
+-  "mold " MOLD_VERSION " (" GIT_HASH "; compatible with GNU ld and GNU gold)";
++  "mold " MOLD_VERSION " (" GIT_HASH "; compatible with GNU ld)";
+ #else
+ const std::string mold_version =
+-  "mold " MOLD_VERSION " (compatible with GNU ld and GNU gold)";
++  "mold " MOLD_VERSION " (compatible with GNU ld)";
+ #endif
+ 
+ void cleanup() {
+diff --git a/test/elf/version.sh b/test/elf/version.sh
+index ae52b504..4ca576ef 100755
+--- a/test/elf/version.sh
 b/test/elf/version.sh
+@@ -10,10 +10,10 @@ mold="$(pwd)/mold"
+ t=out/test/elf/$testname
+ mkdir -p $t
+ 
+-"$mold" -v | grep -q 'mold .*compatible with GNU ld and GNU gold'
+-"$mold" --version | grep -q 'mold .*compatible with GNU ld and GNU gold'
++"$mold" -v | grep -q 'mold .*compatible with GNU ld'
++"$mold" --version | grep -q 'mold .*compatible with GNU ld'
+ 
+-"$mold" -V | grep -q 'mold .*compatible with GNU ld and GNU gold'
++"$mold" -V | grep -q 'mold .*compatible with GNU ld'
+ "$mold" -V | grep -q elf_x86_64
+ "$mold" -V | grep -q elf_i386
+ 

diff --git a/sys-devel/mold/mold-1.0.1.ebuild 
b/sys-devel/mold/mold-1.0.1-r1.ebuild
similarity index 93%
rename from sys-devel/mold/mold-1.0.1.ebuild
rename to sys-devel/mold/mold-1.0.1-r1.ebuild
index 9751b231a53f..e0cd2503b621 100644
--- a/sys-devel/mold/mold-1.0.1.ebuild
+++ b/sys-devel/mold/mold-1.0.1-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2021 Gentoo Authors
+# Copyright 2021-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -31,6 +31,8 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
)"
 DEPEND="${RDEPEND}"
 
+PATCHES=( "${FILESDIR}/${P}-no-gold-in-version.patch" )
+
 src_prepare() {
default
 



[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2021-12-14 Thread Sam James
commit: 17985d0258e3bf6a9c214233ea3d5a6bb84dc935
Author: Sam James  gentoo  org>
AuthorDate: Wed Dec 15 01:51:02 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Dec 15 01:58:05 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17985d02

sys-devel/mold: drop upstreamed patches

Signed-off-by: Sam James  gentoo.org>

 .../files/mold--build-respect-user-FLAGS.patch | 83 --
 .../files/mold--don-t-compress-man-page.patch  | 22 --
 sys-devel/mold/mold-.ebuild|  5 --
 3 files changed, 110 deletions(-)

diff --git a/sys-devel/mold/files/mold--build-respect-user-FLAGS.patch 
b/sys-devel/mold/files/mold--build-respect-user-FLAGS.patch
deleted file mode 100644
index ac218201b902..
--- a/sys-devel/mold/files/mold--build-respect-user-FLAGS.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-https://github.com/rui314/mold/pull/135
-
-From: Sam James 
-Date: Tue, 14 Dec 2021 10:53:44 +
-Subject: [PATCH 1/2] build: respect user *FLAGS
-
-- Respect user CXXFLAGS
-- Rename CPPFLAGS (previously used in the sense of "flags for the C++ 
compiler") -> CXXFLAGS
-- CPPFLAGS is generally used for "flags for the C(++) preprocessor.", so let's
-  use it for that
-- Respect user LDFLAGS
-  (In one instance, we were respecting LDFLAGS, but doing it too late.
-  We need to pass LDFLAGS _before_ any objects in order for -Wl,--as-needed
-  to work correctly.)
-
-Signed-off-by: Sam James 
 a/Makefile
-+++ b/Makefile
-@@ -17,10 +17,15 @@ STRIP ?= strip
- 
- OS ?= $(shell uname -s)
- 
--CPPFLAGS = -pthread -std=c++20 -fPIE -DMOLD_VERSION=\"0.9.6\" \
-- -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables \
-- -DLIBDIR="\"$(LIBDIR)\"" $(EXTRA_CPPFLAGS)
--LDFLAGS += $(EXTRA_LDFLAGS)
-+# Used for both C and C++
-+COMMON_FLAGS = -pthread -fPIE -fno-exceptions -fno-unwind-tables 
-fno-asynchronous-unwind-tables
-+
-+CFLAGS ?= -O2
-+CFLAGS += $(COMMON_FLAGS)
-+
-+CXXFLAGS ?= -O2
-+CXXFLAGS += $(COMMON_FLAGS) -std=c++20
-+CPPFLAGS += -DMOLD_VERSION=\"0.9.6\" -DLIBDIR="\"$(LIBDIR)\""
- LIBS = -pthread -lz -lxxhash -ldl -lm
- 
- SRCS=$(wildcard *.cc elf/*.cc macho/*.cc)
-@@ -38,21 +43,19 @@ ifneq ($(GIT_HASH),)
- endif
- 
- ifeq ($(DEBUG), 1)
--  CPPFLAGS += -O0 -g
--else
--  CPPFLAGS += -O2
-+  CXXFLAGS += -O0 -g
- endif
- 
- ifeq ($(LTO), 1)
--  CPPFLAGS += -flto -O3
-+  CXXFLAGS += -flto -O3
-   LDFLAGS  += -flto
- endif
- 
- ifeq ($(ASAN), 1)
--  CPPFLAGS += -fsanitize=address
-+  CXXFLAGS += -fsanitize=address
-   LDFLAGS  += -fsanitize=address
- else ifeq ($(TSAN), 1)
--  CPPFLAGS += -fsanitize=thread
-+  CXXFLAGS += -fsanitize=thread
-   LDFLAGS  += -fsanitize=thread
- else ifneq ($(OS), Darwin)
-   # By default, we want to use mimalloc as a memory allocator.
-@@ -89,15 +92,15 @@ endif
- all: mold mold-wrapper.so
- 
- mold: $(OBJS) $(MIMALLOC_LIB) $(TBB_LIB)
--  $(CXX) $(CPPFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
-+  $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
-   ln -sf mold ld
-   ln -sf mold ld64.mold
- 
- mold-wrapper.so: elf/mold-wrapper.c Makefile
--  $(CC) -fPIC -shared -o $@ $< -ldl
-+  $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $(LDFLAGS) $< -ldl
- 
- out/%.o: %.cc $(HEADERS) Makefile out/elf/.keep out/macho/.keep
--  $(CXX) $(CPPFLAGS) -c -o $@ $<
-+  $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
- 
- out/elf/.keep:
-   mkdir -p out/elf

diff --git a/sys-devel/mold/files/mold--don-t-compress-man-page.patch 
b/sys-devel/mold/files/mold--don-t-compress-man-page.patch
deleted file mode 100644
index 23dd705b553a..
--- a/sys-devel/mold/files/mold--don-t-compress-man-page.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-https://github.com/rui314/mold/pull/135
-
-From: Sam James 
-Date: Tue, 14 Dec 2021 11:01:19 +
-Subject: [PATCH 2/2] build: don't compress man page
-
-Negligible saving and downstream, distributions usually recompress or
-compress with their own specific options. Unconditionally compressing
-man pages, while well intended, usually creates more hassle there.
-
-Signed-off-by: Sam James 
 a/Makefile
-+++ b/Makefile
-@@ -140,8 +140,6 @@ install: all
- 
-   install -m 755 -d $D$(MANDIR)/man1
-   install -m 644 docs/mold.1 $D$(MANDIR)/man1
--  rm -f $D$(MANDIR)/man1/mold.1.gz
--  gzip -9 $D$(MANDIR)/man1/mold.1
- 
-   ln -sf mold $D$(BINDIR)/ld.mold
-   ln -sf mold $D$(BINDIR)/ld64.mold

diff --git a/sys-devel/mold/mold-.ebuild b/sys-devel/mold/mold-.ebuild
index 0a936b317bbc..77000266ebfe 100644
--- a/sys-devel/mold/mold-.ebuild
+++ b/sys-devel/mold/mold-.ebuild
@@ -30,11 +30,6 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
)"
 DEPEND="${RDEPEND}"
 
-PATCHES=(
-   "${FILESDIR}"/${PN}--build-respect-user-FLAGS.patch
-   "${FILESDIR}"/${PN}--don-t-compress-man-page.patch
-)
-
 src_compile() {
tc-export CC CXX
 



[gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/

2021-10-29 Thread Sam James
commit: 43d9863e8abd71e2b8fa242795f95c42c688cb43
Author: Sam James  gentoo  org>
AuthorDate: Fri Oct 29 21:55:04 2021 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Oct 29 22:22:33 2021 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43d9863e

sys-devel/mold: initial import

Signed-off-by: Sam James  gentoo.org>

 sys-devel/mold/Manifest|  1 +
 .../mold/files/mold-0.9.6-respect-flags.patch  | 49 +
 sys-devel/mold/metadata.xml| 11 +++
 sys-devel/mold/mold-0.9.6.ebuild   | 85 ++
 4 files changed, 146 insertions(+)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
new file mode 100644
index 000..fc960548595
--- /dev/null
+++ b/sys-devel/mold/Manifest
@@ -0,0 +1 @@
+DIST mold-0.9.6.tar.gz 3378698 BLAKE2B 
1352e4f2bc018b53f6f18f6412c4747660a808a896d0c5c620db64babe42a6a949ca444f14a426a41202c8e26ff5973996819c6e4778eeaff6cb20b5746deb0d
 SHA512 
d3de30b371413e974728fba03958d6043026f59aead8371058a0b1dc672e2675e169a1def3afd3751058f529d6ec80ff78c773d2718c1d9f0bdea74d9f13bc2e

diff --git a/sys-devel/mold/files/mold-0.9.6-respect-flags.patch 
b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
new file mode 100644
index 000..270a28988f9
--- /dev/null
+++ b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
@@ -0,0 +1,49 @@
+From: Sam James 
+Date: Fri, 29 Oct 2021 22:50:40 +0100
+Subject: [PATCH] Respect *FLAGS
+
+--- a/Makefile
 b/Makefile
+@@ -10,10 +10,11 @@ GIT_HASH ?= $(shell [ -d .git ] && git rev-parse HEAD)
+ 
+ OS ?= $(shell uname -s)
+ 
+-CPPFLAGS = -g -pthread -std=c++20 -fPIE \
+-   -DMOLD_VERSION=\"0.9.6\" \
+-   -DGIT_HASH=\"$(GIT_HASH)\" \
+- $(EXTRA_CPPFLAGS)
++CFLAGS = -pthread -fPIE $(EXTRA_CFLAGS)
++CXXFLAGS = -pthread -std=c++20 -fPIE $(EXTRA_CXXFLAGS)
++CPPFLAGS = -DMOLD_VERSION=\"0.9.6\" \
++  -DGIT_HASH=\"$(GIT_HASH)\" \
++  $(EXTRA_CPPFLAGS)
+ LDFLAGS += $(EXTRA_LDFLAGS)
+ LIBS = -pthread -lz -lxxhash -ldl -lm
+ 
+@@ -28,12 +29,6 @@ LTO ?= 0
+ ASAN ?= 0
+ TSAN ?= 0
+ 
+-ifeq ($(DEBUG), 1)
+-  CPPFLAGS += -O0
+-else
+-  CPPFLAGS += -O2
+-endif
+-
+ ifeq ($(LTO), 1)
+   CPPFLAGS += -flto -O3
+   LDFLAGS  += -flto
+@@ -73,11 +68,11 @@ endif
+ all: mold mold-wrapper.so
+ 
+ mold: $(OBJS) $(MIMALLOC_LIB) $(TBB_LIB)
+-  $(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
++  $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
+   ln -sf mold ld
+ 
+ mold-wrapper.so: elf/mold-wrapper.c Makefile
+-  $(CC) -fPIC -shared -o $@ $< -ldl
++  $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $(LDFLAGS) $< -ldl
+ 
+ $(OBJS): $(HEADERS) Makefile
+ 

diff --git a/sys-devel/mold/metadata.xml b/sys-devel/mold/metadata.xml
new file mode 100644
index 000..42610750e82
--- /dev/null
+++ b/sys-devel/mold/metadata.xml
@@ -0,0 +1,11 @@
+
+http://www.gentoo.org/dtd/metadata.dtd'>
+
+   
+   s...@gentoo.org
+   Sam James
+   
+   
+   rui314/mold
+   
+

diff --git a/sys-devel/mold/mold-0.9.6.ebuild b/sys-devel/mold/mold-0.9.6.ebuild
new file mode 100644
index 000..2edeabeb557
--- /dev/null
+++ b/sys-devel/mold/mold-0.9.6.ebuild
@@ -0,0 +1,85 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold;
+SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+# Try again after 0.9.6
+RESTRICT="test"
+
+RDEPEND=">=dev-cpp/tbb-2021.4.0:=
+   dev-libs/xxhash:=
+   sys-libs/zlib
+   !kernel_Darwin? (
+   dev-libs/mimalloc:=
+   dev-libs/openssl:=
+   )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+   "${FILESDIR}"/${PN}-0.9.6-respect-flags.patch
+)
+
+src_prepare() {
+   default
+
+   sed -i \
+   -e '/   strip/d' \
+   -e '/   gzip/d' \
+   -e "s:\$(DEST)/lib:\$(DEST)/$(get_libdir):" \
+   Makefile || die
+
+   # Needs unpackaged dwarfutils
+   rm test/compressed-debug-info.sh \
+   test/compress-debug-sections.sh || die
+
+   # Seems to have been fixed in git (> 0.9.6)
+   # Broken atm?
+   rm test/mold-wrapper.sh || die
+
+   # Needs llvmgold
+   rm test/hello-static.sh || die
+}
+
+src_compile() {
+   tc-export CC CXX
+
+   emake \
+   SYSTEM_TBB=1 \
+   SYSTEM_MIMALLOC=1 \
+   EXTRA_CFLAGS="${CFLAGS}" \
+   EXTRA_CXXFLAGS="${CXXFLAGS}" \
+   EXTRA_CPPFLAGS="${CPPFLAGS}" \
+   EXTRA_LDFLAGS="${LDFLAGS}"
+}
+
+src_test() {
+emake \
+   SYSTEM_TBB=1 \
+   SYSTEM_MIMALLOC=1 \
+   EXTRA_CFLAGS="${CFLAGS}" \
+