Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: mold-0.1.1
@ 2021-06-29  0:38 Logarithmus
  2021-06-29 21:07 ` [PR PATCH] [Updated] [ci skip] " Logarithmus
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Logarithmus @ 2021-06-29  0:38 UTC (permalink / raw)
  To: ml

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

There is a new 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

New package: mold-0.1.1
<!-- Mark items with [x] where applicable -->

Blocked on https://github.com/void-linux/void-packages/pull/31706
The package fails 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
```

Any hints on fixing it?

#### 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: 4195 bytes --]

From 7efb8434f4dc79bd91e85c82f79cedff8870148b 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-system-mimalloc.patch | 66 +++++++++++++++++++
 srcpkgs/mold/template                         | 31 +++++++++
 2 files changed, 97 insertions(+)
 create mode 100644 srcpkgs/mold/patches/00-system-mimalloc.patch
 create mode 100644 srcpkgs/mold/template

diff --git a/srcpkgs/mold/patches/00-system-mimalloc.patch b/srcpkgs/mold/patches/00-system-mimalloc.patch
new file mode 100644
index 000000000000..5c05303773a1
--- /dev/null
+++ b/srcpkgs/mold/patches/00-system-mimalloc.patch
@@ -0,0 +1,66 @@
+diff --git b/Makefile a/Makefile
+index cd5effb..fbdaf1a 100644
+--- b/Makefile
++++ a/Makefile
+@@ -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)
++mold: $(OBJS)
+ 	$(CXX) $(CFLAGS) $(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..ad9e9705c4dc
--- /dev/null
+++ b/srcpkgs/mold/template
@@ -0,0 +1,31 @@
+# Template file for 'mold'
+pkgname=mold
+version=0.1.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=43b18575334bc50ea4d4876806b4e15b3550fd92ff933a9de7b3c76d47f28684
+
+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+=" -Wl,-pie"
+}
+
+pre_install() {
+	vmkdir usr/bin
+}
+
+post_install() {
+	vlicense LICENSE
+}

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

* Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.1.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
@ 2021-06-29 21:07 ` Logarithmus
  2021-06-30 14:11 ` Logarithmus
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-06-29 21:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1974 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 fails 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
```

Any hints on fixing it?

#### 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: 4248 bytes --]

From f848cf4ceb735224e516e46b9745078d9113b5e9 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-system-mimalloc.patch | 67 +++++++++++++++++++
 srcpkgs/mold/template                         | 31 +++++++++
 2 files changed, 98 insertions(+)
 create mode 100644 srcpkgs/mold/patches/00-system-mimalloc.patch
 create mode 100644 srcpkgs/mold/template

diff --git a/srcpkgs/mold/patches/00-system-mimalloc.patch b/srcpkgs/mold/patches/00-system-mimalloc.patch
new file mode 100644
index 000000000000..e173631a1415
--- /dev/null
+++ b/srcpkgs/mold/patches/00-system-mimalloc.patch
@@ -0,0 +1,67 @@
+diff --git b/Makefile a/Makefile
+index cd5effb..fbdaf1a 100644
+--- b/Makefile
++++ a/Makefile
+@@ -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..633105b05e13
--- /dev/null
+++ b/srcpkgs/mold/template
@@ -0,0 +1,31 @@
+# Template file for 'mold'
+pkgname=mold
+version=0.1.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=43b18575334bc50ea4d4876806b4e15b3550fd92ff933a9de7b3c76d47f28684
+
+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"
+}
+
+pre_install() {
+	vmkdir usr/bin
+}
+
+post_install() {
+	vlicense LICENSE
+}

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

* Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.1.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
  2021-06-29 21:07 ` [PR PATCH] [Updated] [ci skip] " Logarithmus
@ 2021-06-30 14:11 ` Logarithmus
  2021-06-30 14:46 ` Logarithmus
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-06-30 14:11 UTC (permalink / raw)
  To: ml

[-- 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: 4183 bytes --]

From e8ba03f8623a756da46a69d0942501616b810246 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-system-mimalloc.patch | 65 +++++++++++++++++++
 srcpkgs/mold/template                         | 31 +++++++++
 2 files changed, 96 insertions(+)
 create mode 100644 srcpkgs/mold/patches/00-system-mimalloc.patch
 create mode 100644 srcpkgs/mold/template

diff --git a/srcpkgs/mold/patches/00-system-mimalloc.patch b/srcpkgs/mold/patches/00-system-mimalloc.patch
new file mode 100644
index 000000000000..9a9e76a7fdd0
--- /dev/null
+++ b/srcpkgs/mold/patches/00-system-mimalloc.patch
@@ -0,0 +1,65 @@
+--- b/Makefile
++++ a/Makefile
+@@ -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..633105b05e13
--- /dev/null
+++ b/srcpkgs/mold/template
@@ -0,0 +1,31 @@
+# Template file for 'mold'
+pkgname=mold
+version=0.1.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=43b18575334bc50ea4d4876806b4e15b3550fd92ff933a9de7b3c76d47f28684
+
+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"
+}
+
+pre_install() {
+	vmkdir usr/bin
+}
+
+post_install() {
+	vlicense LICENSE
+}

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

* Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.1.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
  2021-06-29 21:07 ` [PR PATCH] [Updated] [ci skip] " Logarithmus
  2021-06-30 14:11 ` Logarithmus
@ 2021-06-30 14:46 ` Logarithmus
  2021-06-30 14:47 ` Logarithmus
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-06-30 14:46 UTC (permalink / raw)
  To: ml

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

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

* Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.1.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (2 preceding siblings ...)
  2021-06-30 14:46 ` Logarithmus
@ 2021-06-30 14:47 ` Logarithmus
  2021-06-30 17:22 ` [ci skip] New package: mold-0.9.1 Chocimier
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-06-30 14:47 UTC (permalink / raw)
  To: ml

[-- 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 9cd75f36185341ec664e06072c10c6fa353fa1fb 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.9.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
+}

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

* Re: [ci skip] New package: mold-0.9.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (3 preceding siblings ...)
  2021-06-30 14:47 ` Logarithmus
@ 2021-06-30 17:22 ` Chocimier
  2021-07-01  0:29 ` Logarithmus
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Chocimier @ 2021-06-30 17:22 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/31707#issuecomment-871591133

Comment:
> ready for review

It fails to build. Packages that need new dependencies should go to in one PR, it's easier to notice then. Please move mold to mimalloc PR as discussion happened there, unless you want mimalloc in repos even if mold is rejected.

Add nocross="no cross compling clang available".

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

* Re: [ci skip] New package: mold-0.9.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (4 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-07-01  0:29 UTC (permalink / raw)
  To: ml

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

New comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/31707#issuecomment-871815883

Comment:
@Chocimier why is no cross compilation for `clang`? I've personally used clang to cross compile things (not for Void) and it works out of the box, contrary to `gcc`, where you have to install something like `arm-none-eabi-gcc` for each target architecture.

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

* Re: [PR PATCH] [Updated] [ci skip] New package: mold-0.9.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (5 preceding siblings ...)
  2021-07-01  0:29 ` Logarithmus
@ 2021-07-01  0:32 ` Logarithmus
  2021-07-01 11:00 ` [PR PATCH] [Closed]: " Logarithmus
  2021-07-01 11:11 ` Logarithmus
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-07-01  0:32 UTC (permalink / raw)
  To: ml

[-- 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.9.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?
- [x] 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: 4680 bytes --]

From 65bc3dc19e4de1afc1968891749940a77c17444d 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.9.1

---
 srcpkgs/mold/patches/00-makefile.patch | 79 ++++++++++++++++++++++++++
 srcpkgs/mold/template                  | 36 ++++++++++++
 2 files changed, 115 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..99716798fb98
--- /dev/null
+++ b/srcpkgs/mold/patches/00-makefile.patch
@@ -0,0 +1,79 @@
+diff --git a/Makefile b/Makefile
+index 3778c00..ef134a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2,14 +2,14 @@ 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 \
+            -DMOLD_VERSION=\"0.9.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 \
+@@ -41,7 +41,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)
+@@ -51,8 +55,12 @@ endif
+ 
+ all: mold mold-wrapper.so
+ 
++ifdef SYSTEM_MIMALLOC
++  undefine MIMALLOC_LIB
++endif
++
+ mold: $(OBJS) $(MIMALLOC_LIB)
+-	$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
++	$(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
+ 
+ mold-wrapper.so: mold-wrapper.c Makefile
+ 	$(CC) -fPIC -shared -o $@ $< -ldl
+@@ -68,20 +76,21 @@ test tests check: all
+ 	 $(MAKE) -C test --output-sync --no-print-directory
+ 
+ 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 -rf *.o *~ mold mold-wrapper.so test/tmp
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
+}

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

* Re: [PR PATCH] [Closed]: [ci skip] New package: mold-0.9.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (6 preceding siblings ...)
  2021-07-01  0:32 ` [PR PATCH] [Updated] " Logarithmus
@ 2021-07-01 11:00 ` Logarithmus
  2021-07-01 11:11 ` Logarithmus
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-07-01 11:00 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

[ci skip] New package: mold-0.9.1
https://github.com/void-linux/void-packages/pull/31707

Description:
[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?
- [x] 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
-->


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

* Re: [ci skip] New package: mold-0.9.1
  2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
                   ` (7 preceding siblings ...)
  2021-07-01 11:00 ` [PR PATCH] [Closed]: " Logarithmus
@ 2021-07-01 11:11 ` Logarithmus
  8 siblings, 0 replies; 10+ messages in thread
From: Logarithmus @ 2021-07-01 11:11 UTC (permalink / raw)
  To: ml

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

New comment by Logarithmus on void-packages repository

https://github.com/void-linux/void-packages/pull/31707#issuecomment-872123771

Comment:
Moved to #31706.

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

end of thread, other threads:[~2021-07-01 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  0:38 [PR PATCH] New package: mold-0.1.1 Logarithmus
2021-06-29 21:07 ` [PR PATCH] [Updated] [ci skip] " Logarithmus
2021-06-30 14:11 ` Logarithmus
2021-06-30 14:46 ` Logarithmus
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

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).