public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/
Date: Fri, 29 Oct 2021 22:23:15 +0000 (UTC)	[thread overview]
Message-ID: <1635546153.43d9863e8abd71e2b8fa242795f95c42c688cb43.sam@gentoo> (raw)

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
+}


             reply	other threads:[~2021-10-29 22:23 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635546153.43d9863e8abd71e2b8fa242795f95c42c688cb43.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox