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

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

sys-devel/mold: initial import

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

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

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

diff --git a/sys-devel/mold/files/mold-0.9.6-respect-flags.patch b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
new file mode 100644
index 00000000000..270a28988f9
--- /dev/null
+++ b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
@@ -0,0 +1,49 @@
+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/metadata.xml b/sys-devel/mold/metadata.xml
new file mode 100644
index 00000000000..42610750e82
--- /dev/null
+++ b/sys-devel/mold/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+	<maintainer type="person">
+		<email>sam@gentoo.org</email>
+		<name>Sam James</name>
+	</maintainer>
+	<upstream>
+		<remote-id type="github">rui314/mold</remote-id>
+	</upstream>
+</pkgmetadata>

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

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

commit:     17985d0258e3bf6a9c214233ea3d5a6bb84dc935
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 15 01:51:02 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 15 01:58:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17985d02

sys-devel/mold: drop upstreamed patches

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-9999.ebuild                    |  5 --
 3 files changed, 110 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
deleted file mode 100644
index ac218201b902..000000000000
--- a/sys-devel/mold/files/mold-9999-build-respect-user-FLAGS.patch
+++ /dev/null
@@ -1,83 +0,0 @@
-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
deleted file mode 100644
index 23dd705b553a..000000000000
--- a/sys-devel/mold/files/mold-9999-don-t-compress-man-page.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-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-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index 0a936b317bbc..77000266ebfe 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -30,11 +30,6 @@ RDEPEND=">=dev-cpp/tbb-2021.4.0:=
 	)"
 DEPEND="${RDEPEND}"
 
-PATCHES=(
-	"${FILESDIR}"/${PN}-9999-build-respect-user-FLAGS.patch
-	"${FILESDIR}"/${PN}-9999-don-t-compress-man-page.patch
-)
-
 src_compile() {
 	tc-export CC CXX
 


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

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/
@ 2022-01-20 14:40 Michael Orlitzky
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Orlitzky @ 2022-01-20 14:40 UTC (permalink / raw
  To: gentoo-commits

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

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

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

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

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

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

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


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

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

commit:     a254bacec24ef5bdeb2e350fa77cab786cbe20b1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 10 07:12:57 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Feb 10 07:50:12 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a254bace

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

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

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

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

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

diff --git a/sys-devel/mold/mold-1.0.0-r1.ebuild b/sys-devel/mold/mold-1.0.0-r1.ebuild
deleted file mode 100644
index 8560f5f36a1e..000000000000
--- a/sys-devel/mold/mold-1.0.0-r1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2021-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold"
-if [[ ${PV} == 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 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-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}"
-
-src_prepare() {
-	default
-
-	# Needs unpackaged dwarfdump
-	rm test/elf/{compress-debug-sections.sh,compressed-debug-info.sh} || die
-}
-
-src_compile() {
-	tc-export CC CXX
-
-	emake \
-		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
-}

diff --git a/sys-devel/mold/mold-1.0.1-r1.ebuild b/sys-devel/mold/mold-1.0.1-r1.ebuild
deleted file mode 100644
index 55ecbef5a00e..000000000000
--- a/sys-devel/mold/mold-1.0.1-r1.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2021-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold"
-if [[ ${PV} == 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 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-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}/${P}-no-gold-in-version.patch" )
-
-src_prepare() {
-	default
-
-	# Needs unpackaged dwarfdump
-	rm test/elf/{compress-debug-sections,compressed-debug-info}.sh || die
-}
-
-src_compile() {
-	tc-export CC CXX
-
-	emake \
-		SYSTEM_TBB=1 \
-		SYSTEM_MIMALLOC=1 \
-		SYSTEM_XXHASH=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 \
-		SYSTEM_XXHASH=1 \
-		DESTDIR="${D}" \
-		PREFIX="${EPREFIX}/usr" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		STRIP="true" \
-		install
-}

diff --git a/sys-devel/mold/mold-1.0.2.ebuild b/sys-devel/mold/mold-1.0.2.ebuild
deleted file mode 100644
index 7948bbc23805..000000000000
--- a/sys-devel/mold/mold-1.0.2.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2021-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold"
-if [[ ${PV} == 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 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-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}"
-
-src_prepare() {
-	default
-
-	# Needs unpackaged dwarfdump
-	rm test/elf/{compress-debug-sections,compressed-debug-info}.sh || die
-}
-
-src_compile() {
-	tc-export CC CXX
-
-	emake \
-		CFLAGS="${CFLAGS}" \
-		CXXFLAGS="${CXXFLAGS}" \
-		SYSTEM_TBB=1 \
-		SYSTEM_MIMALLOC=1 \
-		SYSTEM_XXHASH=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 \
-		SYSTEM_XXHASH=1 \
-		DESTDIR="${D}" \
-		PREFIX="${EPREFIX}/usr" \
-		LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
-		STRIP="true" \
-		install
-}


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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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


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

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

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

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

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

No revbump as installed files are the same.

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

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

diff --git a/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch b/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch
new file mode 100644
index 000000000000..58cfca04132e
--- /dev/null
+++ b/sys-devel/mold/files/mold-1.4.1-tbb-flags-stripping.patch
@@ -0,0 +1,28 @@
+https://github.com/oneapi-src/oneTBB/pull/716
+https://bugs.gentoo.org/865837
+
+From 9595b9699ae6863d1e0cf770a89728eafcaf8845 Mon Sep 17 00:00:00 2001
+From: Christoph Erhardt <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.4.1.ebuild b/sys-devel/mold/mold-1.4.1.ebuild
index 1aac8ca1098e..804483084d56 100644
--- a/sys-devel/mold/mold-1.4.1.ebuild
+++ b/sys-devel/mold/mold-1.4.1.ebuild
@@ -36,6 +36,8 @@ PATCHES=(
 	# Allows us to rm the tests as before. Will be included in next
 	# release.
 	"${FILESDIR}"/mold-1.4.1-glob-tests.patch
+	# https://bugs.gentoo.org/865837
+	"${FILESDIR}"/mold-1.4.1-tbb-flags-stripping.patch
 )
 
 pkg_pretend() {

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


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

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

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

sys-devel/mold: backport DT_RELR fix

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

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

diff --git a/sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch b/sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch
new file mode 100644
index 000000000000..267afde230d2
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.0.0-DT_RELR-dependency.patch
@@ -0,0 +1,161 @@
+https://bugs.gentoo.org/911591
+https://bugzilla.mozilla.org/show_bug.cgi?id=1847697
+https://github.com/rui314/mold/issues/653#event-10041847648
+https://github.com/rui314/mold/commit/f467ad1add2ab6e381e0e458f026df197e63d487
+
+From f467ad1add2ab6e381e0e458f026df197e63d487 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <ruiu@bluewhale.systems>
+Date: Wed, 9 Aug 2023 11:40:09 +0900
+Subject: [PATCH] Create a symbol version dependency to GLIBC_ABI_DT_RELR
+
+Fixes https://github.com/rui314/mold/issues/653
+---
+ elf/cmdline.cc                     |  2 ++
+ elf/mold.h                         |  1 +
+ elf/output-chunks.cc               | 44 +++++++++++++++++++++++++-----
+ test/elf/z-pack-relative-relocs.sh | 16 +++++++++++
+ 4 files changed, 56 insertions(+), 7 deletions(-)
+ create mode 100755 test/elf/z-pack-relative-relocs.sh
+
+diff --git a/elf/cmdline.cc b/elf/cmdline.cc
+index c568ce086..82a0e6869 100644
+--- a/elf/cmdline.cc
++++ b/elf/cmdline.cc
+@@ -875,8 +875,10 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
+       ctx.arg.z_nodefaultlib = true;
+     } else if (read_z_flag("pack-relative-relocs")) {
+       ctx.arg.pack_dyn_relocs_relr = true;
++      ctx.arg.z_pack_relative_relocs = true;
+     } else if (read_z_flag("nopack-relative-relocs")) {
+       ctx.arg.pack_dyn_relocs_relr = false;
++      ctx.arg.z_pack_relative_relocs = false;
+     } else if (read_z_flag("separate-loadable-segments")) {
+       z_separate_code = SEPARATE_LOADABLE_SEGMENTS;
+     } else if (read_z_flag("separate-code")) {
+diff --git a/elf/mold.h b/elf/mold.h
+index e5532211c..3a027f1e9 100644
+--- a/elf/mold.h
++++ b/elf/mold.h
+@@ -1831,6 +1831,7 @@ struct Context {
+     bool z_nodefaultlib = false;
+     bool z_now = false;
+     bool z_origin = false;
++    bool z_pack_relative_relocs = false;
+     bool z_relro = true;
+     bool z_sectionheader = true;
+     bool z_shstk = false;
+diff --git a/elf/output-chunks.cc b/elf/output-chunks.cc
+index 726a4da2b..3896a2991 100644
+--- a/elf/output-chunks.cc
++++ b/elf/output-chunks.cc
+@@ -2373,12 +2373,13 @@ void VerneedSection<E>::construct(Context<E> &ctx) {
+            std::tuple(((SharedFile<E> *)b->file)->soname, b->ver_idx);
+   });
+ 
+-  // Resize of .gnu.version
++  // Resize .gnu.version
+   ctx.versym->contents.resize(ctx.dynsym->symbols.size(), 1);
+   ctx.versym->contents[0] = 0;
+ 
+   // Allocate a large enough buffer for .gnu.version_r.
+-  contents.resize((sizeof(ElfVerneed<E>) + sizeof(ElfVernaux<E>)) * syms.size());
++  contents.resize((sizeof(ElfVerneed<E>) + sizeof(ElfVernaux<E>)) *
++                  (syms.size() + 1));
+ 
+   // Fill .gnu.version_r.
+   u8 *buf = (u8 *)&contents[0];
+@@ -2394,14 +2395,14 @@ void VerneedSection<E>::construct(Context<E> &ctx) {
+       verneed->vn_next = ptr - (u8 *)verneed;
+ 
+     verneed = (ElfVerneed<E> *)ptr;
+-    ptr += sizeof(*verneed);
++    ptr += sizeof(ElfVerneed<E>);
+     verneed->vn_version = 1;
+     verneed->vn_file = ctx.dynstr->find_string(((SharedFile<E> *)file)->soname);
+     verneed->vn_aux = sizeof(ElfVerneed<E>);
+     aux = nullptr;
+   };
+ 
+-  auto add_entry = [&](Symbol<E> *sym) {
++  auto add_entry = [&](std::string_view verstr) {
+     verneed->vn_cnt++;
+ 
+     if (aux)
+@@ -2409,23 +2410,52 @@ void VerneedSection<E>::construct(Context<E> &ctx) {
+     aux = (ElfVernaux<E> *)ptr;
+     ptr += sizeof(*aux);
+ 
+-    std::string_view verstr = sym->get_version();
+     aux->vna_hash = elf_hash(verstr);
+     aux->vna_other = ++veridx;
+     aux->vna_name = ctx.dynstr->add_string(verstr);
+   };
+ 
++  // Create version entries.
+   for (i64 i = 0; i < syms.size(); i++) {
+     if (i == 0 || syms[i - 1]->file != syms[i]->file) {
+       start_group(syms[i]->file);
+-      add_entry(syms[i]);
++      add_entry(syms[i]->get_version());
+     } else if (syms[i - 1]->ver_idx != syms[i]->ver_idx) {
+-      add_entry(syms[i]);
++      add_entry(syms[i]->get_version());
+     }
+ 
+     ctx.versym->contents[syms[i]->get_dynsym_idx(ctx)] = veridx;
+   }
+ 
++  if (ctx.arg.z_pack_relative_relocs) {
++    // If `-z pack-relative-relocs` is specified, we'll create a .relr.dyn
++    // section and store base relocation records to that section instead of
++    // to the usual .rela.dyn section.
++    //
++    // .relr.dyn is relatively new feature and not supported by glibc until
++    // 2.38 which was released in 2022. Executables built with `-z
++    // pack-relative-relocs` don't work and usually crash immediately on
++    // startup if libc doesn't support it.
++    //
++    // In the following code, we'll add a dependency to a dummy version name
++    // "GLIBC_ABI_DT_RELR" so that executables built with the option failed
++    // with a more friendly "version `GLIBC_ABI_DT_RELR' not found" error
++    // message. glibc 2.38 or later knows about this dummy version name and
++    // simply ignores it.
++    auto find_glibc2 = [&]() -> InputFile<E> * {
++      for (Symbol<E> *sym : syms)
++        if (((SharedFile<E> *)sym->file)->soname.starts_with("libc.so.") &&
++            sym->get_version().starts_with("GLIBC_2."))
++          return sym->file;
++      return nullptr;
++    };
++
++    if (InputFile<E> *file = find_glibc2()) {
++      start_group(file);
++      add_entry("GLIBC_ABI_DT_RELR");
++    }
++  }
++
+   // Resize .gnu.version_r to fit to its contents.
+   contents.resize(ptr - buf);
+ }
+diff --git a/test/elf/z-pack-relative-relocs.sh b/test/elf/z-pack-relative-relocs.sh
+new file mode 100755
+index 000000000..e09d441e7
+--- /dev/null
++++ b/test/elf/z-pack-relative-relocs.sh
+@@ -0,0 +1,16 @@
++#!/bin/bash
++. $(dirname $0)/common.inc
++
++cat <<EOF | $CC -o $t/a.o -fPIC -c -xc -
++#include <stdio.h>
++int main() {
++  printf("Hello world\n");
++}
++EOF
++
++$CC -B. -o $t/exe $t/a.o -pie -Wl,-z,pack-relative-relocs
++
++readelf -W -V $t/exe > $t/log
++grep -Fq GLIBC_2. $t/log || skip
++
++grep -q GLIBC_ABI_DT_RELR $t/log

diff --git a/sys-devel/mold/mold-2.0.0-r2.ebuild b/sys-devel/mold/mold-2.0.0-r2.ebuild
new file mode 100644
index 000000000000..72bb46594d66
--- /dev/null
+++ b/sys-devel/mold/mold-2.0.0-r2.ebuild
@@ -0,0 +1,94 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://github.com/rui314/mold.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
+fi
+
+# mold (MIT)
+#  - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
+SLOT="0"
+
+RDEPEND="
+	app-arch/zstd:=
+	>=dev-cpp/tbb-2021.7.0-r1:=
+	sys-libs/zlib
+	!kernel_Darwin? (
+		>=dev-libs/mimalloc-2:=
+		dev-libs/openssl:=
+	)
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-reloc-test-fix.patch
+	"${FILESDIR}"/${P}-DT_RELR-dependency.patch
+)
+
+pkg_pretend() {
+	# Requires a c++20 compiler, see #831473
+	if [[ ${MERGE_TYPE} != binary ]]; then
+		if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+			die "${PN} needs at least gcc 10"
+		elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+			die "${PN} needs at least clang 12"
+		fi
+	fi
+}
+
+src_prepare() {
+	cmake_src_prepare
+
+	# Needs unpackaged dwarfdump
+	rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+	# Heavy tests, need qemu
+	rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+	rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+	# Sandbox sadness
+	rm test/elf/run.sh || die
+	sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+		test/elf/mold-wrapper{,2}.sh || die
+
+	# static-pie tests require glibc built with static-pie support
+	if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+		rm test/elf/{,ifunc-}static-pie.sh || die
+	fi
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DMOLD_ENABLE_QEMU_TESTS=OFF
+		-DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+		-DMOLD_USE_SYSTEM_MIMALLOC=ON
+		-DMOLD_USE_SYSTEM_TBB=ON
+	)
+	cmake_src_configure
+}
+
+src_install() {
+	dobin "${BUILD_DIR}"/${PN}
+
+	# https://bugs.gentoo.org/872773
+	insinto /usr/$(get_libdir)/mold
+	doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+	dodoc docs/{design,execstack}.md
+	doman docs/${PN}.1
+
+	dosym ${PN} /usr/bin/ld.${PN}
+	dosym ${PN} /usr/bin/ld64.${PN}
+	dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld
+}


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

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

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

sys-devel/mold: add 2.3.0, disable PCH

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

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

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

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

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

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

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


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

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

commit:     bf9cbb53ac91ce4d3568f7bb51ebc6703f4ead32
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  3 01:40:29 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul  3 01:40:29 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf9cbb53

sys-devel/mold: add 2.32.1

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

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

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

diff --git a/sys-devel/mold/files/mold-2.32.1-libdl.patch b/sys-devel/mold/files/mold-2.32.1-libdl.patch
new file mode 100644
index 000000000000..994137938b68
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.32.1-libdl.patch
@@ -0,0 +1,20 @@
+https://github.com/rui314/mold/commit/091395df335d577adc2a09e854a129f02081c576
+
+From 091395df335d577adc2a09e854a129f02081c576 Mon Sep 17 00:00:00 2001
+From: Rui Ueyama <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/mold-2.32.1.ebuild b/sys-devel/mold/mold-2.32.1.ebuild
new file mode 100644
index 000000000000..5c267ea9c1cb
--- /dev/null
+++ b/sys-devel/mold/mold-2.32.1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 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
+}


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

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

commit:     1cae6bea37065d9a98ba9dd4c1a4c6be626d086a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 18 02:13:53 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 02:45:33 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cae6bea

sys-devel/mold: fix --icf assert

Shows up when building Firefox.

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

 sys-devel/mold/files/mold-2.33.0-icf.patch |  41 ++++++++++++
 sys-devel/mold/mold-2.33.0-r1.ebuild       | 103 +++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+)

diff --git a/sys-devel/mold/files/mold-2.33.0-icf.patch b/sys-devel/mold/files/mold-2.33.0-icf.patch
new file mode 100644
index 000000000000..e5b90fbfd9e3
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.33.0-icf.patch
@@ -0,0 +1,41 @@
+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.33.0-r1.ebuild b/sys-devel/mold/mold-2.33.0-r1.ebuild
new file mode 100644
index 000000000000..257d0d263979
--- /dev/null
+++ b/sys-devel/mold/mold-2.33.0-r1.ebuild
@@ -0,0 +1,103 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 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}"
+
+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() {
+	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] 12+ messages in thread

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

commit:     f6da81d9f85e2223a469e043dc95fd6fc555409f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 28 11:36:23 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 28 11:38:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6da81d9

sys-devel/mold: workaround linux-6.11 incompatibility

Don't write to existing files, instead replace them. This fixes (or works
around) an incompatibility with linux-6.11.

Bug: https://github.com/rui314/mold/issues/1361
Bug: https://bugs.gentoo.org/938659
Closes: https://bugs.gentoo.org/941070
Thanks-to: Jinghao Jia <jinghao7 <AT> illinois.edu>
Thanks-to: ernsteiswuerfel <erhard_f <AT> mailbox.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/mold/files/mold-2.34.1-linux-6.11.patch  | 22 ++++++++++++++++++++++
 .../{mold-9999.ebuild => mold-2.34.1-r1.ebuild}    |  4 ++++
 sys-devel/mold/mold-9999.ebuild                    |  4 ++++
 3 files changed, 30 insertions(+)

diff --git a/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch b/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch
new file mode 100644
index 000000000000..8540ec0cb246
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.34.1-linux-6.11.patch
@@ -0,0 +1,22 @@
+https://lore.kernel.org/stable/CACKH++YAtEMYu2nTLUyfmxZoGO37fqogKMDkBpddmNaz5HE6ng@mail.gmail.com/T/#u
+https://github.com/rui314/mold/issues/1361
+https://bugs.gentoo.org/941070
+--- a/src/output-file-unix.cc
++++ b/src/output-file-unix.cc
+@@ -19,16 +19,6 @@ template <typename E>
+ static int
+ open_or_create_file(Context<E> &ctx, std::string path, std::string tmpfile,
+                     int perm) {
+-  // Reuse an existing file if exists and writable because on Linux,
+-  // writing to an existing file is much faster than creating a fresh
+-  // file and writing to it.
+-  if (ctx.overwrite_output_file && rename(path.c_str(), tmpfile.c_str()) == 0) {
+-    i64 fd = ::open(tmpfile.c_str(), O_RDWR | O_CREAT, perm);
+-    if (fd != -1)
+-      return fd;
+-    unlink(tmpfile.c_str());
+-  }
+-
+   i64 fd = ::open(tmpfile.c_str(), O_RDWR | O_CREAT, perm);
+   if (fd == -1)
+     Fatal(ctx) << "cannot open " << tmpfile << ": " << errno_string();

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-2.34.1-r1.ebuild
similarity index 97%
copy from sys-devel/mold/mold-9999.ebuild
copy to sys-devel/mold/mold-2.34.1-r1.ebuild
index 456f654912e4..e9cd29a7fe47 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-2.34.1-r1.ebuild
@@ -34,6 +34,10 @@ 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

diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index 456f654912e4..e9cd29a7fe47 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -34,6 +34,10 @@ 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] 12+ messages in thread

end of thread, other threads:[~2024-10-28 11:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-09  3:11 [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-10-28 11:38 Sam James
2024-09-18  2:46 Sam James
2024-07-03  1:47 Sam James
2023-10-18 15:43 Sam James
2022-08-20  6:37 Matthew Smith
2022-06-26 12:54 Matthew Smith
2022-04-30  6:48 Matthew Smith
2022-02-10  7:50 Sam James
2022-01-20 14:40 Michael Orlitzky
2021-12-15  1:58 Sam James
2021-10-29 22:23 Sam James

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