public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2021-12-14 11:14 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-12-14 11:14 UTC (permalink / raw
  To: gentoo-commits

commit:     cb38ac7fc6ad1953967241e3520eb754f263840e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 14 11:13:03 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 14 11:14:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb38ac7f

sys-devel/mold: add live ebuild

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/mold-9999-build-respect-user-FLAGS.patch | 83 ++++++++++++++++++++++
 .../files/mold-9999-don-t-compress-man-page.patch  | 22 ++++++
 sys-devel/mold/mold-0.9.6-r2.ebuild                | 10 ++-
 .../{mold-0.9.6-r2.ebuild => mold-9999.ebuild}     | 49 +++++--------
 4 files changed, 130 insertions(+), 34 deletions(-)

diff --git a/sys-devel/mold/files/mold-9999-build-respect-user-FLAGS.patch b/sys-devel/mold/files/mold-9999-build-respect-user-FLAGS.patch
new file mode 100644
index 000000000000..ac218201b902
--- /dev/null
+++ b/sys-devel/mold/files/mold-9999-build-respect-user-FLAGS.patch
@@ -0,0 +1,83 @@
+https://github.com/rui314/mold/pull/135
+
+From: Sam James <sam@gentoo.org>
+Date: Tue, 14 Dec 2021 10:53:44 +0000
+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 <sam@gentoo.org>
+--- 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-9999-don-t-compress-man-page.patch b/sys-devel/mold/files/mold-9999-don-t-compress-man-page.patch
new file mode 100644
index 000000000000..23dd705b553a
--- /dev/null
+++ b/sys-devel/mold/files/mold-9999-don-t-compress-man-page.patch
@@ -0,0 +1,22 @@
+https://github.com/rui314/mold/pull/135
+
+From: Sam James <sam@gentoo.org>
+Date: Tue, 14 Dec 2021 11:01:19 +0000
+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 <sam@gentoo.org>
+--- 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-0.9.6-r2.ebuild b/sys-devel/mold/mold-0.9.6-r2.ebuild
index a8bb3b7a4246..ceaaeaf2af4f 100644
--- a/sys-devel/mold/mold-0.9.6-r2.ebuild
+++ b/sys-devel/mold/mold-0.9.6-r2.ebuild
@@ -7,11 +7,17 @@ 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"
+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"
+fi
 
 LICENSE="AGPL-3"
 SLOT="0"
-KEYWORDS="~amd64"
+
 # Try again after 0.9.6
 RESTRICT="test"
 

diff --git a/sys-devel/mold/mold-0.9.6-r2.ebuild b/sys-devel/mold/mold-9999.ebuild
similarity index 55%
copy from sys-devel/mold/mold-0.9.6-r2.ebuild
copy to sys-devel/mold/mold-9999.ebuild
index a8bb3b7a4246..0a936b317bbc 100644
--- a/sys-devel/mold/mold-0.9.6-r2.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -7,11 +7,17 @@ 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"
+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"
+fi
 
 LICENSE="AGPL-3"
 SLOT="0"
-KEYWORDS="~amd64"
+
 # Try again after 0.9.6
 RESTRICT="test"
 
@@ -25,37 +31,10 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
 DEPEND="${RDEPEND}"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-0.9.6-respect-flags.patch
-	"${FILESDIR}"/${PN}-0.9.6-fix-libdir-wrapper.patch
+	"${FILESDIR}"/${PN}-9999-build-respect-user-FLAGS.patch
+	"${FILESDIR}"/${PN}-9999-don-t-compress-man-page.patch
 )
 
-src_prepare() {
-	default
-
-	sed -i \
-		-e '/	strip/d' \
-		-e '/	gzip/d' \
-		-e "s:\$(DEST)/lib:\$(DEST)/$(get_libdir):" \
-		Makefile || die
-
-	# Drop on next release: bug #823653
-	# https://github.com/rui314/mold/issues/127
-	sed -i \
-		-e "s:/usr/lib64/mold/mold-wrapper.so:${EPREFIX}/usr/$(get_libdir)/mold/mold-wrapper.so:" \
-		elf/subprocess.cc || 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
 
@@ -65,7 +44,9 @@ src_compile() {
 		EXTRA_CFLAGS="${CFLAGS}" \
 		EXTRA_CXXFLAGS="${CXXFLAGS}" \
 		EXTRA_CPPFLAGS="${CPPFLAGS}" \
-		EXTRA_LDFLAGS="${LDFLAGS}"
+		EXTRA_LDFLAGS="${LDFLAGS}" \
+		STRIP="true"
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)"
 }
 
 src_test() {
@@ -76,6 +57,8 @@ src_test() {
 		EXTRA_CXXFLAGS="${CXXFLAGS}" \
 		EXTRA_CPPFLAGS="${CPPFLAGS}" \
 		EXTRA_LDFLAGS="${LDFLAGS}" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		STRIP="true"
 		check
 }
 
@@ -88,5 +71,7 @@ src_install() {
 		EXTRA_CPPFLAGS="${CPPFLAGS}" \
 		EXTRA_LDFLAGS="${LDFLAGS}" \
 		DESTDIR="${ED}" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		STRIP="true" \
 		install
 }


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2021-12-20  5:08 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2021-12-20  5:08 UTC (permalink / raw
  To: gentoo-commits

commit:     7de18053c3711a2ded06d55c4523305eb2ba4bd0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 20 05:08:24 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 20 05:08:29 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7de18053

sys-devel/mold: drop 0.9.6-r3

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                            |  1 -
 .../mold/files/mold-0.9.6-fix-libdir-wrapper.patch | 26 ------
 .../mold/files/mold-0.9.6-respect-flags.patch      | 49 -----------
 sys-devel/mold/mold-0.9.6-r3.ebuild                | 98 ----------------------
 4 files changed, 174 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index c1c71b4a9882..a5d35e75f69c 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,2 +1 @@
-DIST mold-0.9.6.tar.gz 3378698 BLAKE2B 1352e4f2bc018b53f6f18f6412c4747660a808a896d0c5c620db64babe42a6a949ca444f14a426a41202c8e26ff5973996819c6e4778eeaff6cb20b5746deb0d SHA512 d3de30b371413e974728fba03958d6043026f59aead8371058a0b1dc672e2675e169a1def3afd3751058f529d6ec80ff78c773d2718c1d9f0bdea74d9f13bc2e
 DIST mold-1.0.0.tar.gz 3482927 BLAKE2B 56ebc267370548a2f91a71ebeed87871cede6f564c29dc7d44a499b95fe570f6e9c8a717baf2d9e235c7057c41e735b315493bd23d3b44574d2a44b14aaf5ef8 SHA512 99ffd0b9e2ff7157cc8b26808675c9d3147bf88961155ae19ed9b99990ac647b7ec31ee78d05062decc6d41e66d99aa0fdc398d119803929b8dbff51eb3d077c

diff --git a/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch b/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch
deleted file mode 100644
index d8155cde8f58..000000000000
--- a/sys-devel/mold/files/mold-0.9.6-fix-libdir-wrapper.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Should be fixed with a LIBDIR variable in the next release.
-
-https://bugs.gentoo.org/823653
-https://github.com/rui314/mold/issues/127
---- a/elf/subprocess.cc
-+++ b/elf/subprocess.cc
-@@ -267,18 +267,7 @@
- 
- template <typename E>
- std::string find_dso(Context<E> &ctx, const std::string &self) {
--  // Look for mold-wrapper.so from the same directory as the executable is.
--  std::string path = std::string(path_dirname(self)) + "/mold-wrapper.so";
--  if (is_regular_file(path))
--    return path;
--
--  // If not exist, mold might be installed as $PREFIX/bin/mold and the
--  // DSO as $PREFIX/lib/mold/mold-wrapper.so.
--  path = path_clean(self + "/../../lib/mold/mold-wrapper.so");
--  if (is_regular_file(path))
--    return path;
--
--  Fatal(ctx) << "mold-wrapper.so is missing";
-+  return "/usr/lib64/mold/mold-wrapper.so";
- }
- 
- template <typename E>

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
deleted file mode 100644
index 270a28988f9d..000000000000
--- a/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From: Sam James <sam@gentoo.org>
-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/mold-0.9.6-r3.ebuild b/sys-devel/mold/mold-0.9.6-r3.ebuild
deleted file mode 100644
index 3baea582d9ec..000000000000
--- a/sys-devel/mold/mold-0.9.6-r3.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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"
-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"
-fi
-
-LICENSE="AGPL-3"
-SLOT="0"
-
-# 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-2:=
-		dev-libs/openssl:=
-	)"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-0.9.6-respect-flags.patch
-	"${FILESDIR}"/${PN}-0.9.6-fix-libdir-wrapper.patch
-)
-
-src_prepare() {
-	default
-
-	sed -i \
-		-e '/	strip/d' \
-		-e '/	gzip/d' \
-		-e "s:\$(DEST)/lib:\$(DEST)/$(get_libdir):" \
-		Makefile || die
-
-	# Drop on next release: bug #823653
-	# https://github.com/rui314/mold/issues/127
-	sed -i \
-		-e "s:/usr/lib64/mold/mold-wrapper.so:${EPREFIX}/usr/$(get_libdir)/mold/mold-wrapper.so:" \
-		elf/subprocess.cc || 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}" \
-		EXTRA_CXXFLAGS="${CXXFLAGS}" \
-		EXTRA_CPPFLAGS="${CPPFLAGS}" \
-		EXTRA_LDFLAGS="${LDFLAGS}" \
-		check
-}
-
-src_install() {
-	emake \
-		SYSTEM_TBB=1 \
-		SYSTEM_MIMALLOC=1 \
-		EXTRA_CFLAGS="${CFLAGS}" \
-		EXTRA_CXXFLAGS="${CXXFLAGS}" \
-		EXTRA_CPPFLAGS="${CPPFLAGS}" \
-		EXTRA_LDFLAGS="${LDFLAGS}" \
-		DESTDIR="${ED}" \
-		install
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2022-07-28 10:17 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2022-07-28 10:17 UTC (permalink / raw
  To: gentoo-commits

commit:     b53e78583cc4390f7660936543b7417af040e141
Author:     Han Gao <rabenda.cn <AT> gmail <DOT> com>
AuthorDate: Thu Jul 28 09:32:30 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 28 10:13:19 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b53e7858

sys-devel/mold: fix riscv R_RISCV_SET32 in EhFrameSection

Bug: https://bugs.gentoo.org/861488
Signed-off-by: Han Gao <rabenda.cn <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../mold/files/mold-1.3.1-fix-riscv-set32.patch    | 25 ++++++
 sys-devel/mold/mold-1.3.1-r1.ebuild                | 99 ++++++++++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch b/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch
new file mode 100644
index 000000000000..5613d8ddc003
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.3.1-fix-riscv-set32.patch
@@ -0,0 +1,25 @@
+From https://github.com/rui314/mold/pull/590
+From 68bd00caa7c7946f380f72a5dd263e7c1d436e9f Mon Sep 17 00:00:00 2001
+From: Alex Fan <alex.fan.q@gmail.com>
+Date: Thu, 28 Jul 2022 14:04:21 +1000
+Subject: [PATCH] [ELF][RISCV] add missing R_RISCV_SET32 in EhFrameSection
+
+Signed-off-by: Alex Fan <alex.fan.q@gmail.com>
+---
+ elf/arch-riscv64.cc | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/elf/arch-riscv64.cc b/elf/arch-riscv64.cc
+index 8761c6ac..0c589118 100644
+--- a/elf/arch-riscv64.cc
++++ b/elf/arch-riscv64.cc
+@@ -183,6 +183,9 @@ void EhFrameSection<E>::apply_reloc(Context<E> &ctx, const ElfRel<E> &rel,
+   case R_RISCV_SET16:
+     *(ul16 *)loc = val;
+     return;
++  case R_RISCV_SET32:
++    *(ul32 *)loc = val;
++    return;
+   case R_RISCV_32_PCREL:
+     *(ul32 *)loc = val - this->shdr.sh_addr - offset;
+     return;

diff --git a/sys-devel/mold/mold-1.3.1-r1.ebuild b/sys-devel/mold/mold-1.3.1-r1.ebuild
new file mode 100644
index 000000000000..b4a955bb2dea
--- /dev/null
+++ b/sys-devel/mold/mold-1.3.1-r1.ebuild
@@ -0,0 +1,99 @@
+# 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} == 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
+
+LICENSE="AGPL-3"
+SLOT="0"
+
+RDEPEND=">=dev-cpp/tbb-2021.4.0:=
+	sys-libs/zlib
+	!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
+	# Bug #861488
+	"${FILESDIR}"/${PN}-1.3.1-fix-riscv-set32.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() {
+	default
+
+	# 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_compile() {
+	tc-export CC CXX
+
+	emake \
+		CFLAGS="${CFLAGS}" \
+		CXXFLAGS="${CXXFLAGS}" \
+		SYSTEM_TBB=1 \
+		SYSTEM_MIMALLOC=1 \
+		STRIP="true" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+}
+
+src_test() {
+	emake \
+		SYSTEM_TBB=1 \
+		SYSTEM_MIMALLOC=1 \
+		check
+}
+
+src_install() {
+	emake \
+		SYSTEM_TBB=1 \
+		SYSTEM_MIMALLOC=1 \
+		DESTDIR="${D}" \
+		PREFIX="${EPREFIX}/usr" \
+		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+		STRIP="true" \
+		install
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2022-12-04  8:55 Matthew Smith
  0 siblings, 0 replies; 11+ messages in thread
From: Matthew Smith @ 2022-12-04  8:55 UTC (permalink / raw
  To: gentoo-commits

commit:     b0bd2023758303844007687ca0f568a2bd2df4ad
Author:     Matthew Smith <matthew <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  4 08:54:22 2022 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Sun Dec  4 08:55:22 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0bd2023

sys-devel/mold: drop 1.6.0-r1

Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 sys-devel/mold/Manifest                            |  1 -
 .../files/mold-1.4.1-tbb-flags-stripping.patch     | 28 -------
 sys-devel/mold/mold-1.6.0-r1.ebuild                | 94 ----------------------
 3 files changed, 123 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 51dd654d8604..d00b1f11c936 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,2 +1 @@
-DIST mold-1.6.0.tar.gz 8270834 BLAKE2B e9da062ab9871db35322cd516197e6e8172bee3a146ba32cde65976da2fb4cff0090ad62f06e25da9baed146c6defbd93d8704bd2156dcfb581ec247c45a2e12 SHA512 dcb498da95ee02a08b175861ae24f3793705671670f6f3487eebd3aab2487fd2163fc1747c9ca2fd1c3570a5f1f0bcfd7d4d91bf6a904a1ba098be6cbbe8c857
 DIST mold-1.7.1.tar.gz 8381932 BLAKE2B 3355304cfe4de7aa96608e68183868debe6d7749940c507e717c5f6def3344bf1bfba8605275506bec6bab018f921c1da87515c4a8fc4f4488d37d874e70c452 SHA512 2e1b6203591718976a3b6c22cb9cdc4037efd101ecb520b809aaa242ee758ee24ed98d0b53012fa8423725fd9b89da94e67603af57b9de1dfb3189a096e1ae5b

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
deleted file mode 100644
index 58cfca04132e..000000000000
--- a/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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 <github@sicherha.de>
-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 <github@sicherha.de>
---- 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.6.0-r1.ebuild b/sys-devel/mold/mold-1.6.0-r1.ebuild
deleted file mode 100644
index 45c7fd085eb8..000000000000
--- a/sys-devel/mold/mold-1.6.0-r1.ebuild
+++ /dev/null
@@ -1,94 +0,0 @@
-# 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 ~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:=
-	sys-libs/zlib
-	!kernel_Darwin? (
-		>=dev-libs/mimalloc-2:=
-		dev-libs/openssl:=
-	)
-"
-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
-		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
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2023-07-29  4:43 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2023-07-29  4:43 UTC (permalink / raw
  To: gentoo-commits

commit:     11f5aee9517614ad79d5bf9aae5d9e7a165ac6ab
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 29 04:28:38 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul 29 04:28:38 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11f5aee9

sys-devel/mold: backport musl test fix

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../mold/files/mold-2.0.0-reloc-test-fix.patch     | 58 ++++++++++++++
 sys-devel/mold/mold-2.0.0-r1.ebuild                | 93 ++++++++++++++++++++++
 2 files changed, 151 insertions(+)

diff --git a/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch b/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch
new file mode 100644
index 000000000000..8e6e04f5d535
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.0.0-reloc-test-fix.patch
@@ -0,0 +1,58 @@
+https://github.com/rui314/mold/issues/1067
+https://github.com/rui314/mold/commit/1582b720d58df61bc4c0ae39fa269e3b250b94df
+
+From 1582b720d58df61bc4c0ae39fa269e3b250b94df Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@bluewhale.systems>
+Date: Fri, 28 Jul 2023 14:58:57 +0900
+Subject: [PATCH] Weak undefs should not keep DSOs alive
+
+Fixes https://github.com/rui314/mold/issues/1067
+--- a/elf/input-files.cc
++++ b/elf/input-files.cc
+@@ -1396,7 +1396,8 @@ SharedFile<E>::mark_live_objects(Context<E> &ctx,
+     if (sym.is_traced)
+       print_trace_symbol(ctx, *this, esym, sym);
+ 
+-    if (esym.is_undef() && sym.file && !sym.file->is_alive.test_and_set()) {
++    if (esym.is_undef() && !esym.is_weak() && sym.file &&
++        !sym.file->is_alive.test_and_set()) {
+       feeder(sym.file);
+ 
+       if (sym.is_traced)
+--- /dev/null
++++ b/test/elf/as-needed-dso2.sh
+@@ -0,0 +1,33 @@
++#!/bin/bash
++. $(dirname $0)/common.inc
++
++cat <<EOF | $CC -c -fPIC -o $t/a.o -xc -
++int foo() {
++  return 0;
++}
++EOF
++
++cat <<EOF | $CC -c -fPIC -o $t/b.o -xc -
++__attribute__((weak)) int foo();
++
++int bar() {
++  if (foo) return foo();
++  return 0;
++}
++EOF
++
++cat <<EOF | $CC -xc -c -o $t/c.o -
++int bar();
++
++int main() {
++  return bar();
++}
++EOF
++
++$CC -B. -shared -o $t/libfoo.so $t/a.o
++$CC -B. -shared -o $t/libbar.so $t/b.o
++$CC -B. -o $t/exe $t/c.o -L$t -Wl,--as-needed -lfoo -lbar
++
++readelf --dynamic $t/exe > $t/log
++! grep libfoo.so $t/log || false
++grep -q libbar.so $t/log
+

diff --git a/sys-devel/mold/mold-2.0.0-r1.ebuild b/sys-devel/mold/mold-2.0.0-r1.ebuild
new file mode 100644
index 000000000000..6d863f669627
--- /dev/null
+++ b/sys-devel/mold/mold-2.0.0-r1.ebuild
@@ -0,0 +1,93 @@
+# 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
+)
+
+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
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2023-11-13  2:11 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2023-11-13  2:11 UTC (permalink / raw
  To: gentoo-commits

commit:     2fc10cbc98bebe136012849b28f6969327d6613b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 13 02:10:14 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 13 02:10:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fc10cbc

sys-devel/mold: backport symbol interposition fix (e.g. mimalloc/musl segfault)

Closes: https://bugs.gentoo.org/917089
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...d-2.3.2-mimalloc-visibility-interposition.patch | 495 +++++++++++++++++++++
 sys-devel/mold/mold-2.3.2-r1.ebuild                |  96 ++++
 2 files changed, 591 insertions(+)

diff --git a/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch b/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch
new file mode 100644
index 000000000000..e569bfaf3013
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.3.2-mimalloc-visibility-interposition.patch
@@ -0,0 +1,495 @@
+https://bugs.gentoo.org/917089
+https://github.com/microsoft/mimalloc/issues/360
+https://github.com/rui314/mold/issues/1071
+https://github.com/rui314/mold/commit/da3f5dd4ecf4faaba466ba41c7c30ba4f8f73bfd
+
+From da3f5dd4ecf4faaba466ba41c7c30ba4f8f73bfd Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@cs.stanford.edu>
+Date: Sat, 11 Nov 2023 17:59:54 +0900
+Subject: [PATCH] Fix --dynamic-list for DSOs
+
+--dynamic-list, --export-dynamic-symbol and --export-dynamic-symbol-list
+have different semantics for executables and DSOs. If the output is an
+executable, they specify a list of symbols that are to be exported.
+If the output is a shared object, they specify the list of symbols that
+are to be interposable.
+
+mold havne't implemented the latter semantics. This commit fixes that
+issue.
+
+Fixes https://github.com/rui314/mold/issues/1071
+---
+ elf/cmdline.cc              |  25 +++-----
+ elf/linker-script.cc        |  35 ++++++-----
+ elf/main.cc                 |  16 -----
+ elf/mold.h                  |  17 +++--
+ elf/output-chunks.cc        |   8 ++-
+ elf/passes.cc               | 122 +++++++++++++++++++++++++++++-------
+ test/elf/dynamic-list4.sh   |  44 +++++++++++++
+ test/elf/version-script6.sh |   4 +-
+ 8 files changed, 194 insertions(+), 77 deletions(-)
+ create mode 100755 test/elf/dynamic-list4.sh
+
+diff --git a/elf/cmdline.cc b/elf/cmdline.cc
+index 6bc13a300..6c06b4b14 100644
+--- a/elf/cmdline.cc
++++ b/elf/cmdline.cc
+@@ -1104,21 +1104,21 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
+     } else if (read_flag("no-keep-memory")) {
+     } else if (read_arg("max-cache-size")) {
+     } else if (read_arg("version-script")) {
+-      // --version-script, --dynamic-list and --export-dynamic-symbol[-list]
+-      // are treated as positional arguments even though they are actually not
+-      // positional. This is because linker scripts (a positional argument)
+-      // can also specify a version script, and it's better to consolidate
+-      // parsing in read_input_files. In particular, version scripts can
+-      // modify ctx.default_version which we initialize *after* parsing
+-      // non-positional args, so the parsing cannot be done right here.
++      // --version-script is treated as positional arguments even though
++      // they are actually not positional. This is because linker scripts
++      // (a positional argument) can also specify a version script, and
++      // it's better to consolidate parsing in read_input_files. In
++      // particular, version scripts can modify ctx.default_version which
++      // we initialize *after* parsing non-positional args, so the parsing
++      // cannot be done right here.
+       remaining.push_back("--version-script=" + std::string(arg));
+     } else if (read_arg("dynamic-list")) {
+       ctx.arg.Bsymbolic = true;
+-      remaining.push_back("--dynamic-list=" + std::string(arg));
++      append(ctx.dynamic_list_patterns, parse_dynamic_list(ctx, arg));
+     } else if (read_arg("export-dynamic-symbol")) {
+-      remaining.push_back("--export-dynamic-symbol=" + std::string(arg));
++      ctx.dynamic_list_patterns.push_back({arg, "<command line>"});
+     } else if (read_arg("export-dynamic-symbol-list")) {
+-      remaining.push_back("--export-dynamic-symbol-list=" + std::string(arg));
++      append(ctx.dynamic_list_patterns, parse_dynamic_list(ctx, arg));
+     } else if (read_flag("as-needed")) {
+       remaining.push_back("--as-needed");
+     } else if (read_flag("no-as-needed")) {
+@@ -1228,11 +1228,6 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
+   if (char *env = getenv("MOLD_REPRO"); env && env[0])
+     ctx.arg.repro = true;
+ 
+-  if (ctx.arg.shared || ctx.arg.export_dynamic)
+-    ctx.default_version = VER_NDX_GLOBAL;
+-  else
+-    ctx.default_version = VER_NDX_LOCAL;
+-
+   if (ctx.arg.default_symver) {
+     std::string ver = ctx.arg.soname.empty() ?
+       filepath(ctx.arg.output).filename().string() : std::string(ctx.arg.soname);
+diff --git a/elf/linker-script.cc b/elf/linker-script.cc
+index 4bdc19e7c..7ad500bb8 100644
+--- a/elf/linker-script.cc
++++ b/elf/linker-script.cc
+@@ -312,7 +312,6 @@ read_version_script_commands(Context<E> &ctx, std::span<std::string_view> &tok,
+ 
+     if (tok[0] == "*") {
+       ctx.default_version = (is_global ? ver_idx : (u32)VER_NDX_LOCAL);
+-      ctx.default_version_from_version_script = true;
+     } else if (is_global) {
+       ctx.version_patterns.push_back({unquote(tok[0]), current_file<E>->name,
+                                       ver_str, ver_idx, is_cpp});
+@@ -367,7 +366,9 @@ void parse_version_script(Context<E> &ctx, MappedFile<Context<E>> *mf) {
+ }
+ 
+ template <typename E>
+-void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &tok,
++void read_dynamic_list_commands(Context<E> &ctx,
++                                std::vector<DynamicPattern> &result,
++                                std::span<std::string_view> &tok,
+                                 bool is_cpp) {
+   while (!tok.empty() && tok[0] != "}") {
+     if (tok[0] == "extern") {
+@@ -376,11 +377,11 @@ void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &to
+       if (!tok.empty() && tok[0] == "\"C\"") {
+         tok = tok.subspan(1);
+         tok = skip(ctx, tok, "{");
+-        read_dynamic_list_commands(ctx, tok, false);
++        read_dynamic_list_commands(ctx, result, tok, false);
+       } else {
+         tok = skip(ctx, tok, "\"C++\"");
+         tok = skip(ctx, tok, "{");
+-        read_dynamic_list_commands(ctx, tok, true);
++        read_dynamic_list_commands(ctx, result, tok, true);
+       }
+ 
+       tok = skip(ctx, tok, "}");
+@@ -388,29 +389,32 @@ void read_dynamic_list_commands(Context<E> &ctx, std::span<std::string_view> &to
+       continue;
+     }
+ 
+-    if (tok[0] == "*")
+-      ctx.default_version = VER_NDX_GLOBAL;
+-    else
+-      ctx.version_patterns.push_back({unquote(tok[0]), current_file<E>->name,
+-                                      "global", VER_NDX_GLOBAL, is_cpp});
+-
++    result.push_back({unquote(tok[0]), "", is_cpp});
+     tok = skip(ctx, tok.subspan(1), ";");
+   }
+ }
+ 
+ template <typename E>
+-void parse_dynamic_list(Context<E> &ctx, MappedFile<Context<E>> *mf) {
+-  current_file<E> = mf;
+-  std::vector<std::string_view> vec = tokenize(ctx, mf->get_contents());
++std::vector<DynamicPattern>
++parse_dynamic_list(Context<E> &ctx, std::string_view path) {
++  std::string_view contents =
++    MappedFile<Context<E>>::must_open(ctx, std::string(path))->get_contents();
++  std::vector<std::string_view> vec = tokenize(ctx, contents);
+   std::span<std::string_view> tok = vec;
++  std::vector<DynamicPattern> result;
+ 
+   tok = skip(ctx, tok, "{");
+-  read_dynamic_list_commands(ctx, tok, false);
++  read_dynamic_list_commands(ctx, result, tok, false);
+   tok = skip(ctx, tok, "}");
+   tok = skip(ctx, tok, ";");
+ 
+   if (!tok.empty())
+     SyntaxError(ctx, tok[0]) << "trailing garbage token";
++
++  for (DynamicPattern &p : result)
++    p.source = path;
++
++  return result;
+ }
+ 
+ using E = MOLD_TARGET;
+@@ -418,6 +422,7 @@ using E = MOLD_TARGET;
+ template void parse_linker_script(Context<E> &, MappedFile<Context<E>> *);
+ template std::string_view get_script_output_type(Context<E> &, MappedFile<Context<E>> *);
+ template void parse_version_script(Context<E> &, MappedFile<Context<E>> *);
+-template void parse_dynamic_list(Context<E> &, MappedFile<Context<E>> *);
++template std::vector<DynamicPattern> parse_dynamic_list(Context<E> &, std::string_view);
++
+ 
+ } // namespace mold::elf
+diff --git a/elf/main.cc b/elf/main.cc
+index c4f3cd6ff..6df00cfe9 100644
+--- a/elf/main.cc
++++ b/elf/main.cc
+@@ -299,22 +299,6 @@ static void read_input_files(Context<E> &ctx, std::span<std::string> args) {
+       if (!mf)
+         Fatal(ctx) << "--version-script: file not found: " << arg;
+       parse_version_script(ctx, mf);
+-    } else if (remove_prefix(arg, "--dynamic-list=")) {
+-      MappedFile<Context<E>> *mf = find_from_search_paths(ctx, std::string(arg));
+-      if (!mf)
+-        Fatal(ctx) << "--dynamic-list: file not found: " << arg;
+-      parse_dynamic_list(ctx, mf);
+-    } else if (remove_prefix(arg, "--export-dynamic-symbol=")) {
+-      if (arg == "*")
+-        ctx.default_version = VER_NDX_GLOBAL;
+-      else
+-        ctx.version_patterns.push_back({arg, "--export-dynamic-symbol",
+-                                        "global", VER_NDX_GLOBAL, false});
+-    } else if (remove_prefix(arg, "--export-dynamic-symbol-list=")) {
+-      MappedFile<Context<E>> *mf = find_from_search_paths(ctx, std::string(arg));
+-      if (!mf)
+-        Fatal(ctx) << "--export-dynamic-symbol-list: file not found: " << arg;
+-      parse_dynamic_list(ctx, mf);
+     } else if (arg == "--push-state") {
+       state.push_back({ctx.as_needed, ctx.whole_archive, ctx.is_static,
+                        ctx.in_lib});
+diff --git a/elf/mold.h b/elf/mold.h
+index 7ff7c2e6f..d593f6840 100644
+--- a/elf/mold.h
++++ b/elf/mold.h
+@@ -1281,8 +1281,15 @@ get_script_output_type(Context<E> &ctx, MappedFile<Context<E>> *mf);
+ template <typename E>
+ void parse_version_script(Context<E> &ctx, MappedFile<Context<E>> *mf);
+ 
++struct DynamicPattern {
++  std::string_view pattern;
++  std::string_view source;
++  bool is_cpp = false;
++};
++
+ template <typename E>
+-void parse_dynamic_list(Context<E> &ctx, MappedFile<Context<E>> *mf);
++std::vector<DynamicPattern>
++parse_dynamic_list(Context<E> &ctx, std::string_view path);
+ 
+ //
+ // lto.cc
+@@ -1733,13 +1740,11 @@ struct Context {
+   } arg;
+ 
+   std::vector<VersionPattern> version_patterns;
+-  u16 default_version = VER_NDX_GLOBAL;
++  std::vector<DynamicPattern> dynamic_list_patterns;
++  i64 default_version = -1;
+   i64 page_size = E::page_size;
+   std::optional<int> global_lock_fd;
+ 
+-  // true if default_version is set by a wildcard in version script.
+-  bool default_version_from_version_script = false;
+-
+   // Reader context
+   bool as_needed = false;
+   bool whole_archive = false;
+@@ -2034,7 +2039,7 @@ class Symbol {
+   i32 sym_idx = -1;
+ 
+   i32 aux_idx = -1;
+-  u16 ver_idx = 0;
++  i32 ver_idx = -1;
+ 
+   // `flags` has NEEDS_ flags.
+   Atomic<u8> flags = 0;
+diff --git a/elf/output-chunks.cc b/elf/output-chunks.cc
+index f44d448ac..00d5538df 100644
+--- a/elf/output-chunks.cc
++++ b/elf/output-chunks.cc
+@@ -2550,8 +2550,12 @@ void VerdefSection<E>::construct(Context<E> &ctx) {
+   for (std::string_view verstr : ctx.arg.version_definitions)
+     write(verstr, idx++, 0);
+ 
+-  for (Symbol<E> *sym : std::span<Symbol<E> *>(ctx.dynsym->symbols).subspan(1))
+-    ctx.versym->contents[sym->get_dynsym_idx(ctx)] = sym->ver_idx;
++  for (Symbol<E> *sym : std::span<Symbol<E> *>(ctx.dynsym->symbols).subspan(1)) {
++    i64 ver = sym->ver_idx;
++    if (ver == -1)
++      ver = VER_NDX_GLOBAL;
++    ctx.versym->contents[sym->get_dynsym_idx(ctx)] = ver;
++  }
+ }
+ 
+ template <typename E>
+diff --git a/elf/passes.cc b/elf/passes.cc
+index c6ee0f66b..8c7d5d0f5 100644
+--- a/elf/passes.cc
++++ b/elf/passes.cc
+@@ -1612,9 +1612,6 @@ template <typename E>
+ void apply_version_script(Context<E> &ctx) {
+   Timer t(ctx, "apply_version_script");
+ 
+-  // If all patterns are simple (i.e. not containing any meta-
+-  // characters and is not a C++ name), we can simply look up
+-  // symbols.
+   auto is_simple = [&] {
+     for (VersionPattern &v : ctx.version_patterns)
+       if (v.is_cpp || v.pattern.find_first_of("*?[") != v.pattern.npos)
+@@ -1622,6 +1619,9 @@ void apply_version_script(Context<E> &ctx) {
+     return true;
+   };
+ 
++  // If all patterns are simple (i.e. not containing any meta-
++  // characters and is not a C++ name), we can simply look up
++  // symbols.
+   if (is_simple()) {
+     for (VersionPattern &v : ctx.version_patterns) {
+       Symbol<E> *sym = get_symbol(ctx, v.pattern);
+@@ -1747,44 +1747,124 @@ void compute_import_export(Context<E> &ctx) {
+   if (!ctx.arg.shared) {
+     tbb::parallel_for_each(ctx.dsos, [&](SharedFile<E> *file) {
+       for (Symbol<E> *sym : file->symbols) {
+-        if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN) {
+-          if (sym->ver_idx != VER_NDX_LOCAL ||
+-              !ctx.default_version_from_version_script) {
+-            std::scoped_lock lock(sym->mu);
+-            sym->is_exported = true;
+-          }
++        if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN &&
++            sym->ver_idx != VER_NDX_LOCAL) {
++          std::scoped_lock lock(sym->mu);
++          sym->is_exported = true;
+         }
+       }
+     });
+   }
+ 
++  auto should_export = [&](Symbol<E> &sym) {
++    if (sym.visibility == STV_HIDDEN)
++      return false;
++
++    switch (sym.ver_idx) {
++    case -1:
++      if (ctx.arg.shared)
++        return !((ObjectFile<E> *)sym.file)->exclude_libs;
++      return ctx.arg.export_dynamic;
++    case VER_NDX_LOCAL:
++      return false;
++    default:
++      return true;
++    }
++  };
++
+   // Export symbols that are not hidden or marked as local.
+   // We also want to mark imported symbols as such.
+   tbb::parallel_for_each(ctx.objs, [&](ObjectFile<E> *file) {
+     for (Symbol<E> *sym : file->get_global_syms()) {
+-      if (!sym->file || sym->visibility == STV_HIDDEN ||
+-          sym->ver_idx == VER_NDX_LOCAL)
+-        continue;
+-
+-      // If we are using a symbol in a DSO, we need to import it at runtime.
+-      if (sym->file != file && sym->file->is_dso && !sym->is_absolute()) {
+-        std::scoped_lock lock(sym->mu);
+-        sym->is_imported = true;
++      // If we are using a symbol in a DSO, we need to import it.
++      if (sym->file && sym->file->is_dso) {
++        if (!sym->is_absolute()) {
++          std::scoped_lock lock(sym->mu);
++          sym->is_imported = true;
++        }
+         continue;
+       }
+ 
+-      // If we are creating a DSO, all global symbols are exported by default.
+-      if (sym->file == file) {
+-        std::scoped_lock lock(sym->mu);
++      // If we have a definition of a symbol, we may want to export it.
++      if (sym->file == file && should_export(*sym)) {
+         sym->is_exported = true;
+ 
+-        if (ctx.arg.shared && sym->visibility != STV_PROTECTED &&
++        // Exported symbols are marked as imported as well by default
++        // for DSOs.
++        if (ctx.arg.shared &&
++            sym->visibility != STV_PROTECTED &&
+             !ctx.arg.Bsymbolic &&
+             !(ctx.arg.Bsymbolic_functions && sym->get_type() == STT_FUNC))
+           sym->is_imported = true;
+       }
+     }
+   });
++
++
++  // Apply --dynamic-list, --export-dynamic-symbol and
++  // --export-dynamic-symbol-list options.
++  //
++  // The semantics of these options vary depending on whether we are
++  // creating an executalbe or a shared object.
++  //
++  // For executable, matched symbols are exported.
++  //
++  // For shared objects, matched symbols are imported if it is already
++  // exported so that they are interposable. In other words, symbols
++  // that did not match will be bound locally within the output file,
++  // effectively turning them into protected symbols.
++  MultiGlob matcher;
++  MultiGlob cpp_matcher;
++
++  auto handle_match = [&](Symbol<E> *sym) {
++    if (ctx.arg.shared) {
++      if (sym->is_exported)
++        sym->is_imported = true;
++    } else {
++      if (sym->file && !sym->file->is_dso && sym->visibility != STV_HIDDEN)
++        sym->is_exported = true;
++    }
++  };
++
++  for (DynamicPattern &p : ctx.dynamic_list_patterns) {
++    if (p.is_cpp) {
++      if (!cpp_matcher.add(p.pattern, 1))
++        Fatal(ctx) << p.source << ": invalid dynamic list entry: "
++                   << p.pattern;
++      continue;
++    }
++
++    if (p.pattern.find_first_of("*?[") != p.pattern.npos) {
++      if (!matcher.add(p.pattern, 1))
++        Fatal(ctx) << p.source << ": invalid dynamic list entry: "
++                   << p.pattern;
++      continue;
++    }
++
++    handle_match(get_symbol(ctx, p.pattern));
++  }
++
++  if (!matcher.empty() || !cpp_matcher.empty()) {
++    tbb::parallel_for_each(ctx.objs, [&](ObjectFile<E> *file) {
++      for (Symbol<E> *sym : file->get_global_syms()) {
++        if (sym->file != file)
++          continue;
++        if (ctx.arg.shared && !sym->is_exported)
++          continue;
++
++        std::string_view name = sym->name();
++
++        if (matcher.find(name)) {
++          handle_match(sym);
++        } else if (!cpp_matcher.empty()) {
++          if (std::optional<std::string_view> s = cpp_demangle(name))
++            name = *s;
++          if (cpp_matcher.find(name))
++            handle_match(sym);
++        }
++      }
++    });
++  }
+ }
+ 
+ // Compute the "address-taken" bit for each input section.
+diff --git a/test/elf/dynamic-list4.sh b/test/elf/dynamic-list4.sh
+new file mode 100755
+index 000000000..83d88887e
+--- /dev/null
++++ b/test/elf/dynamic-list4.sh
+@@ -0,0 +1,44 @@
++#!/bin/bash
++. $(dirname $0)/common.inc
++
++cat <<EOF | $CC -o $t/a.o -c -xc - -fPIC
++#include <stdio.h>
++
++void foo() { printf("foo1 "); }
++void bar() { printf("bar1 "); }
++void baz() { printf("baz1 "); }
++
++void print() {
++  foo();
++  bar();
++  baz();
++  printf("\n");
++}
++EOF
++
++cat <<EOF > $t/dyn
++{ foo; bar; };
++EOF
++
++$CC -B. -shared -o $t/b.so $t/a.o -Wl,--dynamic-list=$t/dyn
++
++cat <<EOF | $CC -o $t/c.o -c -xc - -fPIC
++#include <stdio.h>
++void foo() { printf("foo2 "); }
++void bar() { printf("bar2 "); }
++void baz() { printf("baz2 "); }
++EOF
++
++$CC -B. -shared -o $t/d.so $t/c.o
++
++cat <<EOF | $CC -o $t/e.o -c -xc -
++#include <stdio.h>
++void print();
++int main() { print(); }
++EOF
++
++$CC -B. -o $t/exe1 $t/e.o -Wl,-push-state,-no-as-needed $t/b.so -Wl,-pop-state
++$QEMU $t/exe1 | grep -q 'foo1 bar1 baz1'
++
++$CC -B. -o $t/exe2 $t/e.o -Wl,-push-state,-no-as-needed $t/d.so $t/b.so -Wl,-pop-state
++$QEMU $t/exe2 | grep -q 'foo2 bar2 baz1'
+diff --git a/test/elf/version-script6.sh b/test/elf/version-script6.sh
+index 74e2f9a89..44f809ef3 100755
+--- a/test/elf/version-script6.sh
++++ b/test/elf/version-script6.sh
+@@ -9,10 +9,10 @@ EOF
+ cat <<EOF | $CXX -fPIC -c -o $t/b.o -xc -
+ int foo = 5;
+ int bar = 6;
++int quux = 100;
+ EOF
+ 
+-$CC -B. -shared -Wl,--version-script=$t/a.ver \
+-  -o $t/c.so $t/b.o
++$CC -B. -shared -Wl,--version-script=$t/a.ver -o $t/c.so $t/b.o
+ 
+ cat <<'EOF' > $t/d.ver
+ VER_Y1 { local; *; };

diff --git a/sys-devel/mold/mold-2.3.2-r1.ebuild b/sys-devel/mold/mold-2.3.2-r1.ebuild
new file mode 100644
index 000000000000..26a184843d8c
--- /dev/null
+++ b/sys-devel/mold/mold-2.3.2-r1.ebuild
@@ -0,0 +1,96 @@
+# 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 ~loong ~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:=
+	dev-libs/blake3:=
+	sys-libs/zlib
+	!kernel_Darwin? (
+		>=dev-libs/mimalloc-2:=
+	)
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+	"${FILESDIR}"/${P}-mimalloc-visibility-interposition.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=(
+		-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_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 ../../../usr/bin/${PN} /usr/libexec/${PN}/ld
+}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2024-04-30  7:03 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-04-30  7:03 UTC (permalink / raw
  To: gentoo-commits

commit:     907cb4aa2d36c14e559e2b7a81f1281c8810264f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 30 07:02:15 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 07:02:15 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=907cb4aa

sys-devel/mold: fix tests w/ gcc 14

Test-only change.

Bug: https://github.com/rui314/mold/issues/1244
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/files/mold-2.30.0-gcc14.patch      | 76 +++++++++++++++++++++++
 sys-devel/mold/files/mold-2.30.0-which-hunt.patch | 31 +++++++++
 sys-devel/mold/mold-2.30.0.ebuild                 |  5 ++
 3 files changed, 112 insertions(+)

diff --git a/sys-devel/mold/files/mold-2.30.0-gcc14.patch b/sys-devel/mold/files/mold-2.30.0-gcc14.patch
new file mode 100644
index 000000000000..74e7f5081eeb
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.30.0-gcc14.patch
@@ -0,0 +1,76 @@
+https://github.com/rui314/mold/issues/1244
+https://github.com/rui314/mold/commit/002d619b11f38438514f4714f9eb89e8015ba1b6
+https://github.com/rui314/mold/commit/14952546a489c23236f50adc5ef9c8ada4f4e31a
+
+From 002d619b11f38438514f4714f9eb89e8015ba1b6 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@cs.stanford.edu>
+Date: Thu, 25 Apr 2024 16:58:09 +0900
+Subject: [PATCH] Attempt to fix a test failure
+
+I believe some version of objcopy corrupts an object file when
+renaming a section. In this change, I use sed instead of objcopy
+as a workaround.
+
+Fixes https://github.com/rui314/mold/issues/1244
+---
+ test/elf/exception-multiple-ehframe.sh | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
+index ca1d1a1c0..a9b360b09 100755
+--- a/test/elf/exception-multiple-ehframe.sh
++++ b/test/elf/exception-multiple-ehframe.sh
+@@ -28,9 +28,9 @@ int bar() {
+ }
+ EOF
+ 
+-$OBJCOPY --rename-section .eh_frame=.eh_frame2 $t/a.o
++sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
+ ./mold -r -o $t/c.o $t/a.o $t/b.o
+-$OBJCOPY --rename-section .eh_frame2=.eh_frame $t/c.o
++sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
+ 
+ cat <<EOF | $CXX -o $t/d.o -c -xc++ -
+ #include <stdio.h>
+@@ -44,5 +44,4 @@ int main() {
+ EOF
+ 
+ $CXX -B. -o $t/exe1 $t/d.o $t/c.o
+-$QEMU $t/exe1
+ $QEMU $t/exe1 | grep -q '^1 3$'
+
+From 14952546a489c23236f50adc5ef9c8ada4f4e31a Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@cs.stanford.edu>
+Date: Sun, 28 Apr 2024 13:04:43 +0900
+Subject: [PATCH] Do not edit binary files with sed
+
+Fixes https://github.com/rui314/mold/issues/1244
+---
+ test/elf/exception-multiple-ehframe.sh | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
+index a9b360b09..8cc31624a 100755
+--- a/test/elf/exception-multiple-ehframe.sh
++++ b/test/elf/exception-multiple-ehframe.sh
+@@ -3,6 +3,8 @@
+ 
+ nm mold | grep -q '__tsan_init' && skip
+ 
++which perl > /dev/null || skip
++
+ [ $MACHINE = m68k ] && skip
+ [ $MACHINE = sh4 ] && skip
+ 
+@@ -28,9 +30,9 @@ int bar() {
+ }
+ EOF
+ 
+-sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
++perl -i -0777 -pe 's/\.eh_frame/.EH_FRAME/g' $t/a.o
+ ./mold -r -o $t/c.o $t/a.o $t/b.o
+-sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
++perl -i -0777 -pe 's/\.EH_FRAME/.eh_frame/g' $t/c.o
+ 
+ cat <<EOF | $CXX -o $t/d.o -c -xc++ -
+ #include <stdio.h>

diff --git a/sys-devel/mold/files/mold-2.30.0-which-hunt.patch b/sys-devel/mold/files/mold-2.30.0-which-hunt.patch
new file mode 100644
index 000000000000..d8558091c4bc
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.30.0-which-hunt.patch
@@ -0,0 +1,31 @@
+https://github.com/rui314/mold/pull/1246
+
+From ec0a9d09ddff8b1796ff1822d5381442cd28acb1 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Tue, 30 Apr 2024 07:54:40 +0100
+Subject: [PATCH] test: use `command -v`, not non-portable `which`
+
+`which` isn't in POSIX and several Linux distributions are trying to
+remove it from their base system, see e.g. https://lwn.net/Articles/874049/.
+
+Just use `command -v` which is POSIX.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+---
+ test/elf/exception-multiple-ehframe.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
+index 8cc31624a..1b9f434a4 100755
+--- a/test/elf/exception-multiple-ehframe.sh
++++ b/test/elf/exception-multiple-ehframe.sh
+@@ -3,7 +3,7 @@
+ 
+ nm mold | grep -q '__tsan_init' && skip
+ 
+-which perl > /dev/null || skip
++command -v perl > /dev/null || skip
+ 
+ [ $MACHINE = m68k ] && skip
+ [ $MACHINE = sh4 ] && skip
+

diff --git a/sys-devel/mold/mold-2.30.0.ebuild b/sys-devel/mold/mold-2.30.0.ebuild
index a121f5ffefba..cce55d1650c9 100644
--- a/sys-devel/mold/mold-2.30.0.ebuild
+++ b/sys-devel/mold/mold-2.30.0.ebuild
@@ -31,6 +31,11 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+	"${FILESDIR}"/${P}-gcc14.patch
+	"${FILESDIR}"/${PN}-2.30.0-which-hunt.patch
+)
+
 pkg_pretend() {
 	# Requires a c++20 compiler, see #831473
 	if [[ ${MERGE_TYPE} != binary ]]; then


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2024-06-24  0:32 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-06-24  0:32 UTC (permalink / raw
  To: gentoo-commits

commit:     2dfe689924334f967b31ba58961a5b2e08c97841
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 24 00:21:31 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 24 00:21:31 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dfe6899

sys-devel/mold: drop 2.4.0, 2.4.1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                      |   2 -
 sys-devel/mold/files/mold-2.3.0-no-pch.patch |  12 ----
 sys-devel/mold/mold-2.4.0.ebuild             | 102 ---------------------------
 sys-devel/mold/mold-2.4.1.ebuild             |  98 -------------------------
 4 files changed, 214 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index aeabc142aef5..1c44c6c6396f 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,5 +1,3 @@
 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
 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.4.0.tar.gz 9974233 BLAKE2B 0710d9ce0407b64b05a23e04db142d603b38d41cd9e5e322b650680ee2bd8684f57647e9a0b5efc23b2106eb1e38e38143be7d4b357b2d32e4fe0b6a99e41cca SHA512 e332d027f783dfb0a4f48b1fb7daf98e11e830f8de82b971b58ee8a7bae59eaa30b8155e7491b6057f0ce8e0b09ddd0ab1d364f01ea15517e1d089fdb292a4e5
-DIST mold-2.4.1.tar.gz 9957259 BLAKE2B 17aab84c0793dc305d53a3c2f372ddc92395b6941ffe372af55cf94f4dd65ea8d63d4e85dcdb3e76622811e5f95577d6f10612102c373835d6f75f2a3d0bcfed SHA512 d61ee4306ecaa6ba5b4ce120636e70db081bb824a482bb3014429e13294134bc2560b1a9b477c47378f1062107f1c32dba2810e41be199cd6882cd1146971245

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
deleted file mode 100644
index e61b5df01f54..000000000000
--- a/sys-devel/mold/files/mold-2.3.0-no-pch.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-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
-       "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/elf/mold.h>"

diff --git a/sys-devel/mold/mold-2.4.0.ebuild b/sys-devel/mold/mold-2.4.0.ebuild
deleted file mode 100644
index 39999e0ec4a8..000000000000
--- a/sys-devel/mold/mold-2.4.0.ebuild
+++ /dev/null
@@ -1,102 +0,0 @@
-# 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} == 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
-fi
-
-# mold (MIT)
-#  - xxhash (BSD-2)
-LICENSE="MIT BSD-2"
-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}"/${PN}-2.3.0-no-pch.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_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-2.4.1.ebuild b/sys-devel/mold/mold-2.4.1.ebuild
deleted file mode 100644
index 066b8e9902c7..000000000000
--- a/sys-devel/mold/mold-2.4.1.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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} == 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
-fi
-
-# mold (MIT)
-#  - xxhash (BSD-2)
-LICENSE="MIT BSD-2"
-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}"
-
-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_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
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2024-09-02  5:14 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-09-02  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     a6ddeed354bf19b4e36d53b4ea268c9989aa66ea
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  2 05:13:09 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 05:13:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6ddeed3

sys-devel/mold: drop 2.30.0, 2.31.0, 2.32.0

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                           |   3 -
 sys-devel/mold/files/mold-2.30.0-gcc14.patch      |  76 ----------------
 sys-devel/mold/files/mold-2.30.0-which-hunt.patch |  31 -------
 sys-devel/mold/mold-2.30.0.ebuild                 | 103 ----------------------
 sys-devel/mold/mold-2.31.0.ebuild                 |  98 --------------------
 sys-devel/mold/mold-2.32.0.ebuild                 |  99 ---------------------
 6 files changed, 410 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 998c10749466..7ed9976e301e 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,6 +1,3 @@
 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
-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
 DIST mold-2.33.0.tar.gz 10061838 BLAKE2B 65c460035f3bdbc101120a27e30b70982d549a4222cf4beb1b7228c0c961afd3eb8928cacde5be20734a80a80765eb60e6d961bd5cb001ecaef1aba1152730b9 SHA512 67c41ae33f8a229f32aabf32ffb8bcb261eff047dedd189b8751e5de43ef12a2dbd05f45632c8baeac2ceff99c40256256d7d5c790cc12e4fecf1dc3cfebeb11

diff --git a/sys-devel/mold/files/mold-2.30.0-gcc14.patch b/sys-devel/mold/files/mold-2.30.0-gcc14.patch
deleted file mode 100644
index 74e7f5081eeb..000000000000
--- a/sys-devel/mold/files/mold-2.30.0-gcc14.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-https://github.com/rui314/mold/issues/1244
-https://github.com/rui314/mold/commit/002d619b11f38438514f4714f9eb89e8015ba1b6
-https://github.com/rui314/mold/commit/14952546a489c23236f50adc5ef9c8ada4f4e31a
-
-From 002d619b11f38438514f4714f9eb89e8015ba1b6 Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu@cs.stanford.edu>
-Date: Thu, 25 Apr 2024 16:58:09 +0900
-Subject: [PATCH] Attempt to fix a test failure
-
-I believe some version of objcopy corrupts an object file when
-renaming a section. In this change, I use sed instead of objcopy
-as a workaround.
-
-Fixes https://github.com/rui314/mold/issues/1244
----
- test/elf/exception-multiple-ehframe.sh | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
-index ca1d1a1c0..a9b360b09 100755
---- a/test/elf/exception-multiple-ehframe.sh
-+++ b/test/elf/exception-multiple-ehframe.sh
-@@ -28,9 +28,9 @@ int bar() {
- }
- EOF
- 
--$OBJCOPY --rename-section .eh_frame=.eh_frame2 $t/a.o
-+sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
- ./mold -r -o $t/c.o $t/a.o $t/b.o
--$OBJCOPY --rename-section .eh_frame2=.eh_frame $t/c.o
-+sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
- 
- cat <<EOF | $CXX -o $t/d.o -c -xc++ -
- #include <stdio.h>
-@@ -44,5 +44,4 @@ int main() {
- EOF
- 
- $CXX -B. -o $t/exe1 $t/d.o $t/c.o
--$QEMU $t/exe1
- $QEMU $t/exe1 | grep -q '^1 3$'
-
-From 14952546a489c23236f50adc5ef9c8ada4f4e31a Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu@cs.stanford.edu>
-Date: Sun, 28 Apr 2024 13:04:43 +0900
-Subject: [PATCH] Do not edit binary files with sed
-
-Fixes https://github.com/rui314/mold/issues/1244
----
- test/elf/exception-multiple-ehframe.sh | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
-index a9b360b09..8cc31624a 100755
---- a/test/elf/exception-multiple-ehframe.sh
-+++ b/test/elf/exception-multiple-ehframe.sh
-@@ -3,6 +3,8 @@
- 
- nm mold | grep -q '__tsan_init' && skip
- 
-+which perl > /dev/null || skip
-+
- [ $MACHINE = m68k ] && skip
- [ $MACHINE = sh4 ] && skip
- 
-@@ -28,9 +30,9 @@ int bar() {
- }
- EOF
- 
--sed -i 's/\.eh_frame/.EH_FRAME/g' $t/a.o
-+perl -i -0777 -pe 's/\.eh_frame/.EH_FRAME/g' $t/a.o
- ./mold -r -o $t/c.o $t/a.o $t/b.o
--sed -i 's/\.EH_FRAME/.eh_frame/g' $t/c.o
-+perl -i -0777 -pe 's/\.EH_FRAME/.eh_frame/g' $t/c.o
- 
- cat <<EOF | $CXX -o $t/d.o -c -xc++ -
- #include <stdio.h>

diff --git a/sys-devel/mold/files/mold-2.30.0-which-hunt.patch b/sys-devel/mold/files/mold-2.30.0-which-hunt.patch
deleted file mode 100644
index d8558091c4bc..000000000000
--- a/sys-devel/mold/files/mold-2.30.0-which-hunt.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/rui314/mold/pull/1246
-
-From ec0a9d09ddff8b1796ff1822d5381442cd28acb1 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Tue, 30 Apr 2024 07:54:40 +0100
-Subject: [PATCH] test: use `command -v`, not non-portable `which`
-
-`which` isn't in POSIX and several Linux distributions are trying to
-remove it from their base system, see e.g. https://lwn.net/Articles/874049/.
-
-Just use `command -v` which is POSIX.
-
-Signed-off-by: Sam James <sam@gentoo.org>
----
- test/elf/exception-multiple-ehframe.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/test/elf/exception-multiple-ehframe.sh b/test/elf/exception-multiple-ehframe.sh
-index 8cc31624a..1b9f434a4 100755
---- a/test/elf/exception-multiple-ehframe.sh
-+++ b/test/elf/exception-multiple-ehframe.sh
-@@ -3,7 +3,7 @@
- 
- nm mold | grep -q '__tsan_init' && skip
- 
--which perl > /dev/null || skip
-+command -v perl > /dev/null || skip
- 
- [ $MACHINE = m68k ] && skip
- [ $MACHINE = sh4 ] && skip
-

diff --git a/sys-devel/mold/mold-2.30.0.ebuild b/sys-devel/mold/mold-2.30.0.ebuild
deleted file mode 100644
index 05ff0820df78..000000000000
--- a/sys-devel/mold/mold-2.30.0.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# 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} == 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
-fi
-
-# mold (MIT)
-#  - xxhash (BSD-2)
-LICENSE="MIT BSD-2"
-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}-gcc14.patch
-	"${FILESDIR}"/${PN}-2.30.0-which-hunt.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_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-2.31.0.ebuild b/sys-devel/mold/mold-2.31.0.ebuild
deleted file mode 100644
index 7b109302a083..000000000000
--- a/sys-devel/mold/mold-2.31.0.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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} == 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 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
-fi
-
-# mold (MIT)
-#  - xxhash (BSD-2)
-LICENSE="MIT BSD-2"
-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}"
-
-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_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-2.32.0.ebuild b/sys-devel/mold/mold-2.32.0.ebuild
deleted file mode 100644
index 638c34d50c92..000000000000
--- a/sys-devel/mold/mold-2.32.0.ebuild
+++ /dev/null
@@ -1,99 +0,0 @@
-# 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} == 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 ~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}"
-
-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_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
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2024-12-09  5:54 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-12-09  5:54 UTC (permalink / raw
  To: gentoo-commits

commit:     89a031befe0411419ce9bac565be1ee69220967b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  9 05:53:49 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec  9 05:53:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89a031be

sys-devel/mold: drop 2.32.1, 2.33.0, 2.33.0-r1, 2.34.0, 2.34.1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                      |   3 -
 sys-devel/mold/files/mold-2.32.1-libdl.patch |  20 -----
 sys-devel/mold/files/mold-2.33.0-icf.patch   |  41 -----------
 sys-devel/mold/mold-2.32.1.ebuild            | 103 --------------------------
 sys-devel/mold/mold-2.33.0-r1.ebuild         | 106 ---------------------------
 sys-devel/mold/mold-2.33.0.ebuild            |  99 -------------------------
 sys-devel/mold/mold-2.34.0.ebuild            | 103 --------------------------
 sys-devel/mold/mold-2.34.1.ebuild            | 103 --------------------------
 8 files changed, 578 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 2d7be66ba802..fffe115e7813 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,6 +1,3 @@
 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
-DIST mold-2.34.0.tar.gz 10056591 BLAKE2B 88ee86c7f78b05cc79d67152a2f5cad7c88e2155f47674f2fe5aca5ef66c7cad607154f4a52cbd97e720a24e1b25ecf8452a88e626e9cf1c4d3f76401df5644d SHA512 b252f873f6fd4aa2e63344017c57e0bcff3fda5db86e4db2587b29ac1e44ee34a1a36c3b96b08bf607909dc5e877fa59617c32f7399ebe09591f84dd833c5bb5
 DIST mold-2.34.1.tar.gz 10057683 BLAKE2B 9a9b166e64c4e5d48631147e781ce0d58acf76420f172bdee31fe5c44f37a8e2b098ae5696b52b668255f9a5967b0fb567a51d9fb8b26cddba0e14ed5a3e3464 SHA512 6ddfda8b81b710555272ee67eac7f2b3088a7a78f308843caa1730c1b631fc7031b8f5eac33379b9926c9f000d7b27864c12bb62ea75051d2f1caf9f9d2946ab
 DIST mold-2.35.0.tar.gz 10056856 BLAKE2B 9b039031047263aa959aa6f2bf296d11d51bf02d0a66afa76e08200d4547ee5d66cf522497b86fce7fd8cbd43559b8d19ad0264c749833988592cf7291fd55fe SHA512 6f7be924cb6ea38c0089f0c34beec9ef51160daea3510dac4ed68c519efefe4496739271b35c271f7384c9e436bd8a0636ce47e0847aa2b4daf227accecc7314

diff --git a/sys-devel/mold/files/mold-2.32.1-libdl.patch b/sys-devel/mold/files/mold-2.32.1-libdl.patch
deleted file mode 100644
index 994137938b68..000000000000
--- a/sys-devel/mold/files/mold-2.32.1-libdl.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-https://github.com/rui314/mold/commit/091395df335d577adc2a09e854a129f02081c576
-
-From 091395df335d577adc2a09e854a129f02081c576 Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu@cs.stanford.edu>
-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/files/mold-2.33.0-icf.patch b/sys-devel/mold/files/mold-2.33.0-icf.patch
deleted file mode 100644
index e5b90fbfd9e3..000000000000
--- a/sys-devel/mold/files/mold-2.33.0-icf.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-https://bugs.gentoo.org/938009
-https://github.com/rui314/mold/issues/1326
-https://github.com/rui314/mold/commit/5a9919b43344b4fb92ea701f0b32a7e20857b9ca
-
-From 5a9919b43344b4fb92ea701f0b32a7e20857b9ca Mon Sep 17 00:00:00 2001
-From: Rui Ueyama <ruiu@cs.stanford.edu>
-Date: Fri, 9 Aug 2024 12:08:03 +0900
-Subject: [PATCH] Fix a crash bug
-
-Fixes https://github.com/rui314/mold/issues/1326
---- a/elf/output-chunks.cc
-+++ b/elf/output-chunks.cc
-@@ -1730,21 +1730,18 @@ ElfSym<E> to_output_esym(Context<E> &ctx, Symbol<E> &sym, u32 st_name,
-     esym.st_type = STT_FUNC;
-     esym.st_visibility = sym.visibility;
-     esym.st_value = sym.get_plt_addr(ctx);
--  } else if (!isec->output_section) {
-+  } else if ((isec->shdr().sh_flags & SHF_MERGE) &&
-+             !(isec->shdr().sh_flags & SHF_ALLOC)) {
-     // Symbol in a mergeable non-SHF_ALLOC section, such as .debug_str
--    assert(!(isec->shdr().sh_flags & SHF_ALLOC));
--    assert(isec->shdr().sh_flags & SHF_MERGE);
--    assert(!sym.file->is_dso);
--
-     ObjectFile<E> *file = (ObjectFile<E> *)sym.file;
--    MergeableSection<E> *m =
--      file->mergeable_sections[file->get_shndx(sym.esym())].get();
-+    MergeableSection<E> &m =
-+      *file->mergeable_sections[file->get_shndx(sym.esym())];
- 
-     SectionFragment<E> *frag;
-     i64 frag_addend;
--    std::tie(frag, frag_addend) = m->get_fragment(sym.esym().st_value);
-+    std::tie(frag, frag_addend) = m.get_fragment(sym.esym().st_value);
- 
--    shndx = m->parent.shndx;
-+    shndx = m.parent.shndx;
-     esym.st_visibility = sym.visibility;
-     esym.st_value = frag->get_addr(ctx) + frag_addend;
-   } else {
-

diff --git a/sys-devel/mold/mold-2.32.1.ebuild b/sys-devel/mold/mold-2.32.1.ebuild
deleted file mode 100644
index 8a4c59535484..000000000000
--- a/sys-devel/mold/mold-2.32.1.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# 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} == 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 ~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 || 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_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-2.33.0-r1.ebuild b/sys-devel/mold/mold-2.33.0-r1.ebuild
deleted file mode 100644
index 27b583561b71..000000000000
--- a/sys-devel/mold/mold-2.33.0-r1.ebuild
+++ /dev/null
@@ -1,106 +0,0 @@
-# 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"
-	KEYWORDS="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}"/${P}-icf.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() {
-	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-2.33.0.ebuild b/sys-devel/mold/mold-2.33.0.ebuild
deleted file mode 100644
index c125e91b311b..000000000000
--- a/sys-devel/mold/mold-2.33.0.ebuild
+++ /dev/null
@@ -1,99 +0,0 @@
-# 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} == 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 ~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"
-
-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}"
-
-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_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-2.34.0.ebuild b/sys-devel/mold/mold-2.34.0.ebuild
deleted file mode 100644
index 456f654912e4..000000000000
--- a/sys-devel/mold/mold-2.34.0.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# 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}"
-
-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-2.34.1.ebuild b/sys-devel/mold/mold-2.34.1.ebuild
deleted file mode 100644
index a0350478640f..000000000000
--- a/sys-devel/mold/mold-2.34.1.ebuild
+++ /dev/null
@@ -1,103 +0,0 @@
-# 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}"
-
-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
-}


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/
@ 2024-12-20  6:10 Sam James
  0 siblings, 0 replies; 11+ messages in thread
From: Sam James @ 2024-12-20  6:10 UTC (permalink / raw
  To: gentoo-commits

commit:     172a04700061bc4e34f02d8184faa0f68701d789
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 20 06:09:02 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Dec 20 06:09:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=172a0470

sys-devel/mold: add 2.35.1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/Manifest                            |  1 +
 .../mold/files/mold-2.35.1-system-mimalloc.patch   | 64 ++++++++++++++++++++++
 .../mold/{mold-9999.ebuild => mold-2.35.1.ebuild}  |  2 +-
 sys-devel/mold/mold-9999.ebuild                    |  4 --
 4 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index fffe115e7813..984985ba4b09 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,3 +1,4 @@
 DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
 DIST mold-2.34.1.tar.gz 10057683 BLAKE2B 9a9b166e64c4e5d48631147e781ce0d58acf76420f172bdee31fe5c44f37a8e2b098ae5696b52b668255f9a5967b0fb567a51d9fb8b26cddba0e14ed5a3e3464 SHA512 6ddfda8b81b710555272ee67eac7f2b3088a7a78f308843caa1730c1b631fc7031b8f5eac33379b9926c9f000d7b27864c12bb62ea75051d2f1caf9f9d2946ab
 DIST mold-2.35.0.tar.gz 10056856 BLAKE2B 9b039031047263aa959aa6f2bf296d11d51bf02d0a66afa76e08200d4547ee5d66cf522497b86fce7fd8cbd43559b8d19ad0264c749833988592cf7291fd55fe SHA512 6f7be924cb6ea38c0089f0c34beec9ef51160daea3510dac4ed68c519efefe4496739271b35c271f7384c9e436bd8a0636ce47e0847aa2b4daf227accecc7314
+DIST mold-2.35.1.tar.gz 10094602 BLAKE2B 4943588d116a4631ad4404a4f2d92c4f9745546ec1ab7054df2af766f270c634c571f90d5e224f5441e48a3b310819f6993e56d5574c60032dd547d68d08fc64 SHA512 30d9cadfe57288e80ffcaddf1bf7df7b3bff75d337ea2b612bdffa3de3f7bd908b02d24c1f848d4ad0e82f72cd0e04c33ddd01d23c549d81aac5af58e63dbab4

diff --git a/sys-devel/mold/files/mold-2.35.1-system-mimalloc.patch b/sys-devel/mold/files/mold-2.35.1-system-mimalloc.patch
new file mode 100644
index 000000000000..c0abe4b5fd68
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.35.1-system-mimalloc.patch
@@ -0,0 +1,64 @@
+https://github.com/rui314/mold/commit/9c9145eb6e5381b69f47bdfb11eeffb7b9febb8b
+https://github.com/rui314/mold/commit/ac9568f17b9054e92fed95a862ec83701336cd37
+
+From 9c9145eb6e5381b69f47bdfb11eeffb7b9febb8b Mon Sep 17 00:00:00 2001
+From: Christoph Erhardt <github@sicherha.de>
+Date: Thu, 19 Dec 2024 21:55:41 +0100
+Subject: [PATCH] Add missing `#include "common.h"`
+
+This allows the compiler to make sure that the implementation of
+`set_mimalloc_options()` matches its declaration.
+
+More importantly, it indirectly pulls in `config.h`, where the macros
+`MOLD_USE_SYSTEM_MIMALLOC` and `MOLD_USE_MIMALLOC` are conditionally
+defined. Without these, the build configuration is ignored.
+---
+ lib/mimalloc.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/mimalloc.cc b/lib/mimalloc.cc
+index 637d5e8ce7..823b91b8e9 100644
+--- a/lib/mimalloc.cc
++++ b/lib/mimalloc.cc
+@@ -1,3 +1,5 @@
++#include "common.h"
++
+ // Including mimalloc-new-delete.h overrides new/delete operators.
+ // We need it only when we are using mimalloc as a dynamic library.
+ #if MOLD_USE_SYSTEM_MIMALLOC
+
+From ac9568f17b9054e92fed95a862ec83701336cd37 Mon Sep 17 00:00:00 2001
+From: Christoph Erhardt <github@sicherha.de>
+Date: Thu, 19 Dec 2024 23:40:12 +0100
+Subject: [PATCH] Disable mimalloc when a sanitizer is used
+
+Combining mimalloc and AddressSanitizer triggers a segmentation fault in
+many tests.
+
+Combining mimalloc and ThreadSanitizer leads to duplicate symbols for
+the `new` and `delete`
+operators, causing the build to fail.
+Example message from a failed GitHub Actions build:
+```
+mold: error: duplicate symbol:
+third-party/mimalloc/libmimalloc-debug.a(alloc.c.o):
+/usr/lib/llvm-18/lib/clang/18/lib/linux/libclang_rt.tsan_cxx-x86_64.a(tsan_new_delete.cpp.o):
+operator delete(void*, std::align_val_t)
+```
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d8643961d9..c451ea952a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -180,7 +180,7 @@ endif()
+ # be stable on 32-bit targets.
+ cmake_dependent_option(
+   MOLD_USE_MIMALLOC "Use mimalloc" ON
+-  "CMAKE_SIZEOF_VOID_P EQUAL 8; NOT APPLE; NOT ANDROID; NOT OPENBSD" OFF)
++  "CMAKE_SIZEOF_VOID_P EQUAL 8; NOT APPLE; NOT ANDROID; NOT OPENBSD; NOT MOLD_USE_ASAN; NOT MOLD_USE_TSAN" OFF)
+ 
+ cmake_dependent_option(
+   MOLD_USE_SYSTEM_MIMALLOC "Use system or vendored mimalloc" OFF

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-2.35.1.ebuild
similarity index 98%
copy from sys-devel/mold/mold-9999.ebuild
copy to sys-devel/mold/mold-2.35.1.ebuild
index d7e4c65e6171..142325bfb19f 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-2.35.1.ebuild
@@ -35,7 +35,7 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-2.34.1-linux-6.11.patch
+	"${FILESDIR}"/${P}-system-mimalloc.patch
 )
 
 pkg_pretend() {

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index d7e4c65e6171..e0398e86fe4b 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -34,10 +34,6 @@ 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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-12-20  6:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09  5:54 [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/files/, sys-devel/mold/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-12-20  6:10 Sam James
2024-09-02  5:14 Sam James
2024-06-24  0:32 Sam James
2024-04-30  7:03 Sam James
2023-11-13  2:11 Sam James
2023-07-29  4:43 Sam James
2022-12-04  8:55 Matthew Smith
2022-07-28 10:17 Sam James
2021-12-20  5:08 Sam James
2021-12-14 11:14 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox