From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 426C6158086 for ; Fri, 29 Oct 2021 22:23:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92450E0788; Fri, 29 Oct 2021 22:23:18 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5B14BE0788 for ; Fri, 29 Oct 2021 22:23:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 547E834336D for ; Fri, 29 Oct 2021 22:23:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D84C1187 for ; Fri, 29 Oct 2021 22:23:15 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1635546153.43d9863e8abd71e2b8fa242795f95c42c688cb43.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/mold/, sys-devel/mold/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/mold/Manifest sys-devel/mold/files/mold-0.9.6-respect-flags.patch sys-devel/mold/metadata.xml sys-devel/mold/mold-0.9.6.ebuild X-VCS-Directories: sys-devel/mold/files/ sys-devel/mold/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 43d9863e8abd71e2b8fa242795f95c42c688cb43 X-VCS-Branch: master Date: Fri, 29 Oct 2021 22:23:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 60a30130-a43f-45a5-a085-0ae3bad676ed X-Archives-Hash: 3ea6c6ad394adbbc2440077e4f3d01bf commit: 43d9863e8abd71e2b8fa242795f95c42c688cb43 Author: Sam James gentoo org> AuthorDate: Fri Oct 29 21:55:04 2021 +0000 Commit: Sam James gentoo 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 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 +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 @@ + + + + + sam@gentoo.org + Sam James + + + rui314/mold + + diff --git a/sys-devel/mold/mold-0.9.6.ebuild b/sys-devel/mold/mold-0.9.6.ebuild new file mode 100644 index 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 +}