Github messages for voidlinux
 help / color / mirror / Atom feed
From: Logarithmus <Logarithmus@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.1.1
Date: Wed, 30 Jun 2021 16:46:35 +0200	[thread overview]
Message-ID: <20210630144635.BhEod-q7Dt6YFg7wmMIWTt4V-A6PwpQO1vnj6MgN_s8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31707@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2003 bytes --]

There is an updated pull request by Logarithmus against master on the void-packages repository

https://github.com/Logarithmus/void-packages mold
https://github.com/void-linux/void-packages/pull/31707

[ci skip] New package: mold-0.1.1
[ci skip]

<!-- Mark items with [x] where applicable -->


Blocked on https://github.com/void-linux/void-packages/pull/31706

The package failed to build due to this error:
```
/usr/bin/x86_64-unknown-linux-gnu-ld: /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/10.2/crtbegin.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
```
Fixed after replacing `-Wl,-pie` with just `-pie`

#### General
- [x] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/31707.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mold-31707.patch --]
[-- Type: text/x-diff, Size: 4583 bytes --]

From e4b78268b76e3fd9cc40b80e32d80e78cd97d050 Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Tue, 29 Jun 2021 03:31:54 +0300
Subject: [PATCH] New package: mold-0.1.1

---
 srcpkgs/mold/patches/00-makefile.patch | 74 ++++++++++++++++++++++++++
 srcpkgs/mold/template                  | 36 +++++++++++++
 2 files changed, 110 insertions(+)
 create mode 100644 srcpkgs/mold/patches/00-makefile.patch
 create mode 100644 srcpkgs/mold/template

diff --git a/srcpkgs/mold/patches/00-makefile.patch b/srcpkgs/mold/patches/00-makefile.patch
new file mode 100644
index 000000000000..116b4b9d95c4
--- /dev/null
+++ b/srcpkgs/mold/patches/00-makefile.patch
@@ -0,0 +1,74 @@
+--- b/Makefile
++++ a/Makefile
+@@ -1,7 +1,7 @@ CC = clang
+ CXX = clang++
+
+ MIMALLOC_LIB = mimalloc/out/release/libmimalloc.a
+-GIT_HASH = $(shell [ -d .git ] && git rev-parse HEAD)
++GIT_HASH ?= $(shell [ -d .git ] && git rev-parse HEAD)
+ 
+ CPPFLAGS = -g -Imimalloc/include -pthread -std=c++20 \
+            -Wno-deprecated-volatile \
+@@ -9,7 +9,7 @@ CPPFLAGS = -g -Imimalloc/include -pthread -std=c++20 \
+            -DMOLD_VERSION=\"0.1.1\" \
+            -DGIT_HASH=\"$(GIT_HASH)\" \
+ 	   $(EXTRA_CPPFLAGS)
+-LDFLAGS = $(EXTRA_LDFLAGS)
++LDFLAGS += $(EXTRA_LDFLAGS)
+ LIBS = -Wl,-as-needed -lcrypto -pthread -ltbb -lz -lxxhash -ldl
+ OBJS = main.o object_file.o input_sections.o output_chunks.o \
+        mapfile.o perf.o linker_script.o archive_file.o output_file.o \
+@@ -40,7 +40,11 @@ else
+   # By default, we want to use mimalloc as a memory allocator.
+   # Since replacing the standard malloc is not compatible with ASAN,
+   # we do that only when ASAN is not enabled.
+-  LDFLAGS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
++  ifndef SYSTEM_MIMALLOC
++    LIBS += -Wl,-whole-archive $(MIMALLOC_LIB) -Wl,-no-whole-archive
++  else
++    LIBS += -lmimalloc
++  endif
+ endif
+ 
+ ifeq ($(TSAN), 1)
+@@ -50,7 +54,7 @@ endif
+ 
+ all: mold mold-wrapper.so
+ 
+-mold: $(OBJS) $(MIMALLOC_LIB)
+-	$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
++mold: $(OBJS)
++	$(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
+ 
+ mold-wrapper.so: mold-wrapper.c Makefile
+@@ -71,20 +75,21 @@ test tests check: all
+ 	for i in test/*.sh; do $$i || exit 1; done
+ 
+ install: all
+-	install -m 755 mold $(PREFIX)/bin
++	install -m 755 mold $(DESTDIR)$(PREFIX)/bin
+ 	strip $(PREFIX)/bin/mold
+ 
+-	install -m 755 -d $(PREFIX)/lib/mold
+-	install -m 644 mold-wrapper.so $(PREFIX)/lib/mold
+-	strip $(PREFIX)/lib/mold/mold-wrapper.so
++	install -m 755 -d $(DESTDIR)$(PREFIX)/lib/mold
++	install -m 644 mold-wrapper.so $(DESTDIR)$(PREFIX)/lib/mold
++	strip $(DESTDIR)$(PREFIX)/lib/mold/mold-wrapper.so
+ 
+-	install -m 644 docs/mold.1 $(PREFIX)/share/man/man1
+-	rm -f $(PREFIX)/share/man/man1/mold.1.gz
+-	gzip -9 $(PREFIX)/share/man/man1/mold.1
++	install -m 755 -d $(DESTDIR)$(PREFIX)/share/man/man1
++	install -m 644 docs/mold.1 $(DESTDIR)$(PREFIX)/share/man/man1
++	rm -f $(DESTDIR)$(PREFIX)/share/man/man1/mold.1.gz
++	gzip -9 $(DESTDIR)$(PREFIX)/share/man/man1/mold.1
+ 
+ uninstall:
+-	rm -rf $(PREFIX)/bin/mold $(PREFIX)/share/man/man1/mold.1.gz \
+-	       $(PREFIX)/lib/mold
++	rm -rf $(DESTDIR)$(PREFIX)/bin/mold $(DESTDIR)$(PREFIX)/share/man/man1/mold.1.gz \
++	       $(DESTDIR)$(PREFIX)/lib/mold
+ 
+ clean:
+ 	rm -f *.o *~ mold mold-wrapper.so
diff --git a/srcpkgs/mold/template b/srcpkgs/mold/template
new file mode 100644
index 000000000000..9258c390deda
--- /dev/null
+++ b/srcpkgs/mold/template
@@ -0,0 +1,36 @@
+# Template file for 'mold'
+pkgname=mold
+version=0.9.1
+revision=1
+build_style=gnu-makefile
+make_build_args="SYSTEM_MIMALLOC=1"
+hostmakedepends="clang"
+makedepends="mimalloc-devel openssl-devel xxHash-devel tbb-devel"
+short_desc="High performance drop-in replacement for existing Unix linkers"
+maintainer="Artur Sinila <freesoftware@logarithmus.dev>"
+license="AGPL-3.0-or-later"
+homepage="https://github.com/rui314/mold"
+changelog="https://github.com/rui314/mold/releases"
+distfiles="https://github.com/rui314/mold/archive/refs/tags/v${version}.tar.gz"
+checksum=02b156de6cd2d94fea4eed9748a7c96955673d810ec672359f603f2f90e2990d
+_commit_hash=9a09c777d9460ebe7eb498d1cc0327915f8bbcdc
+
+pre_build() {
+	# gcc 10.2 doesn't fully support C++20
+ 	export CXX=clang++
+
+ 	# "non-PIE executable found in PIE build" without these lines
+ 	CXXFLAGS+=" -fPIC"
+	LDFLAGS+=" -pie"
+
+	# commit hash for --version
+	export GIT_HASH=$_commit_hash
+}
+
+pre_install() {
+	vmkdir usr/bin
+}
+
+post_install() {
+	vlicense LICENSE
+}

  parent reply	other threads:[~2021-06-30 14:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  0:38 [PR PATCH] " Logarithmus
2021-06-29 21:07 ` [PR PATCH] [Updated] [ci skip] " Logarithmus
2021-06-30 14:11 ` Logarithmus
2021-06-30 14:46 ` Logarithmus [this message]
2021-06-30 14:47 ` Logarithmus
2021-06-30 17:22 ` [ci skip] New package: mold-0.9.1 Chocimier
2021-07-01  0:29 ` Logarithmus
2021-07-01  0:32 ` [PR PATCH] [Updated] " Logarithmus
2021-07-01 11:00 ` [PR PATCH] [Closed]: " Logarithmus
2021-07-01 11:11 ` Logarithmus

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=20210630144635.BhEod-q7Dt6YFg7wmMIWTt4V-A6PwpQO1vnj6MgN_s8@z \
    --to=logarithmus@users.noreply.github.com \
    --cc=ml@inbox.vuxu.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;
as well as URLs for NNTP newsgroup(s).