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] New packages: mold-0.9.1, mimalloc-1.7.2
Date: Mon, 12 Jul 2021 17:27:33 +0200	[thread overview]
Message-ID: <20210712152733.lmiz12sCUhTyHqgOTRhUtlI-LmoOOogBFYDLHpCol28@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31706@inbox.vuxu.org>

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

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

https://github.com/Logarithmus/void-packages mimalloc
https://github.com/void-linux/void-packages/pull/31706

New packages: mold-0.9.1, mimalloc-1.7.2
<!-- Mark items with [x] where applicable -->

TODO
- [ ] fix tests for `mold` on `x86_64` (blocker: https://github.com/rui314/mold/pull/77)
- [ ] run and possibly fix tests for `mold` for all other architectures
- [ ] wait for a new release of `mold` (0.9.2) https://github.com/rui314/mold/issues/65
- [ ] fix `mold` compilation on `*-musl` targets


#### 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/31706.patch is attached

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

From 3b660f0b40e0bf024a9ace0d1e3e22a13ca7f2e1 Mon Sep 17 00:00:00 2001
From: Artur Sinila <freesoftware@logarithmus.dev>
Date: Tue, 29 Jun 2021 03:30:50 +0300
Subject: [PATCH 1/2] New package: mimalloc-1.7.2

---
 common/shlibs                                 |   1 +
 srcpkgs/mimalloc-devel                        |   1 +
 .../mimalloc/patches/00-fix-cmakelists.patch  |  20 ++++
 srcpkgs/mimalloc/patches/01-fix-test.patch    |  11 ++
 srcpkgs/mimalloc/patches/03-libatomic.patch   | 112 ++++++++++++++++++
 ...4-remove-secure-suffix-from-basename.patch |  15 +++
 srcpkgs/mimalloc/template                     |  32 +++++
 7 files changed, 192 insertions(+)
 create mode 120000 srcpkgs/mimalloc-devel
 create mode 100644 srcpkgs/mimalloc/patches/00-fix-cmakelists.patch
 create mode 100644 srcpkgs/mimalloc/patches/01-fix-test.patch
 create mode 100644 srcpkgs/mimalloc/patches/03-libatomic.patch
 create mode 100644 srcpkgs/mimalloc/patches/04-remove-secure-suffix-from-basename.patch
 create mode 100644 srcpkgs/mimalloc/template

diff --git a/common/shlibs b/common/shlibs
index 9df122c0edfe..b748cc44be6f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -416,6 +416,7 @@ libMAC.so.6 libMAC-5.28_1
 libmad.so.0 libmad-0.15.1b_1
 libmatroska.so.7 libmatroska-1.6.0_1
 libmatrix_client.so.0.5.1 mtxclient-0.5.1_1
+libmimalloc.so.1.7 mimalloc-1.7.2_1
 libebml.so.5 libebml-1.4.0_1
 libdvdread.so.8 libdvdread-6.1.1_1
 libdvdnav.so.4 libdvdnav-4.1.3_1
diff --git a/srcpkgs/mimalloc-devel b/srcpkgs/mimalloc-devel
new file mode 120000
index 000000000000..9af584a917a5
--- /dev/null
+++ b/srcpkgs/mimalloc-devel
@@ -0,0 +1 @@
+mimalloc
\ No newline at end of file
diff --git a/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch b/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch
new file mode 100644
index 000000000000..1d18ccd7d859
--- /dev/null
+++ b/srcpkgs/mimalloc/patches/00-fix-cmakelists.patch
@@ -0,0 +1,20 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -210,7 +210,7 @@ endif()
+ if (MI_INSTALL_TOPLEVEL)
+   set(mi_install_libdir   "lib")
+   set(mi_install_incdir   "include")
+-  set(mi_install_cmakedir "cmake")
++  set(mi_install_cmakedir "share/cmake")
+ else()
+   set(mi_install_libdir   "lib/mimalloc-${mi_version}")
+   set(mi_install_incdir   "include/mimalloc-${mi_version}")
+@@ -224,7 +224,7 @@ else()
+ endif()
+ 
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC)
+-if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel)$"))
++if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$"))
+   set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version
+ endif()
+ if(MI_BUILD_SHARED)
diff --git a/srcpkgs/mimalloc/patches/01-fix-test.patch b/srcpkgs/mimalloc/patches/01-fix-test.patch
new file mode 100644
index 000000000000..f1c35c37ea28
--- /dev/null
+++ b/srcpkgs/mimalloc/patches/01-fix-test.patch
@@ -0,0 +1,11 @@
+--- a/test/test-api.c
++++ b/test/test-api.c
+@@ -83,7 +83,7 @@ int main() {
+     void* p = mi_malloc(0); mi_free(p);
+   });
+   CHECK_BODY("malloc-nomem1",{
+-    result = (mi_malloc(SIZE_MAX/2) == NULL);
++    result = (mi_malloc((size_t)PTRDIFF_MAX + (size_t)1) == NULL);
+   });
+   CHECK_BODY("malloc-null",{
+     mi_free(NULL);
diff --git a/srcpkgs/mimalloc/patches/03-libatomic.patch b/srcpkgs/mimalloc/patches/03-libatomic.patch
new file mode 100644
index 000000000000..ca9af8ddfb1a
--- /dev/null
+++ b/srcpkgs/mimalloc/patches/03-libatomic.patch
@@ -0,0 +1,112 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -203,6 +203,9 @@ else()
+   endif()
+ endif()
+ 
++include("cmake/atomic.cmake")
++list(APPEND mi_libraries ${CMAKE_REQUIRED_LIBRARIES})
++
+ # -----------------------------------------------------------------------------
+ # Install and output names
+ # -----------------------------------------------------------------------------
+--- /dev/null
++++ b/cmake/atomic.cmake
+@@ -0,0 +1,97 @@
++# Based on:
++# https://github.com/llvm/llvm-project/blob/d4dcb55c7050fd908af2378fa551078d859d994f/llvm/cmake/modules/DetermineGCCCompatible.cmake
++# https://github.com/llvm/llvm-project/blob/d4dcb55c7050fd908af2378fa551078d859d994f/llvm/cmake/modules/CheckAtomic.cmake
++
++INCLUDE(CheckCXXSourceCompiles)
++INCLUDE(CheckLibraryExists)
++
++# Determine if the compiler has GCC-compatible command-line syntax.
++
++if(CMAKE_COMPILER_IS_GNUCXX)
++  set(COMPILER_IS_GCC_COMPATIBLE ON)
++elseif( MSVC )
++  set(COMPILER_IS_GCC_COMPATIBLE OFF)
++elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
++  set(COMPILER_IS_GCC_COMPATIBLE ON)
++elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" )
++  set(COMPILER_IS_GCC_COMPATIBLE ON)
++endif()
++
++# Sometimes linking against libatomic is required for atomic ops, if
++# the platform doesn't support lock-free atomics.
++
++function(check_working_cxx_atomics varname)
++  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
++  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11")
++  CHECK_CXX_SOURCE_COMPILES("
++#include <atomic>
++std::atomic<int> x;
++std::atomic<short> y;
++std::atomic<char> z;
++int main() {
++  ++z;
++  ++y;
++  return ++x;
++}
++" ${varname})
++  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
++endfunction(check_working_cxx_atomics)
++
++function(check_working_cxx_atomics64 varname)
++  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
++  set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
++  CHECK_CXX_SOURCE_COMPILES("
++#include <atomic>
++#include <cstdint>
++std::atomic<uint64_t> x (0);
++int main() {
++  uint64_t i = x.load(std::memory_order_relaxed);
++  (void)i;
++  return 0;
++}
++" ${varname})
++  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
++endfunction(check_working_cxx_atomics64)
++
++
++# Check for (non-64-bit) atomic operations.
++if(MSVC)
++  set(HAVE_CXX_ATOMICS_WITHOUT_LIB True)
++elseif(COMPILER_IS_GCC_COMPATIBLE)
++  # First check if atomics work without the library.
++  check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
++  # If not, check if the library exists, and atomics work with it.
++  if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
++    check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
++    if(HAVE_LIBATOMIC)
++      list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
++      check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB)
++      if (NOT HAVE_CXX_ATOMICS_WITH_LIB)
++        message(FATAL_ERROR "Host compiler must support std::atomic!")
++      endif()
++    else()
++      message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
++    endif()
++  endif()
++endif()
++
++# Check for 64 bit atomic operations.
++if(MSVC)
++  set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
++elseif(COMPILER_IS_GCC_COMPATIBLE)
++  # First check if atomics work without the library.
++  check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
++  # If not, check if the library exists, and atomics work with it.
++  if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
++    check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
++    if(HAVE_CXX_LIBATOMICS64)
++      list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
++      check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
++      if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
++        message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!")
++      endif()
++    else()
++      message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.")
++    endif()
++  endif()
++endif()
diff --git a/srcpkgs/mimalloc/patches/04-remove-secure-suffix-from-basename.patch b/srcpkgs/mimalloc/patches/04-remove-secure-suffix-from-basename.patch
new file mode 100644
index 000000000000..604df22d38ce
--- /dev/null
+++ b/srcpkgs/mimalloc/patches/04-remove-secure-suffix-from-basename.patch
@@ -0,0 +1,15 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -220,11 +220,7 @@ else()
+   set(mi_install_cmakedir "share/mimalloc-${mi_version}/cmake") 
+ endif()
+ 
+-if(MI_SECURE)
+-  set(mi_basename "mimalloc-secure")
+-else()
+-  set(mi_basename "mimalloc")
+-endif()
++set(mi_basename "mimalloc")
+ 
+ string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC)
+ if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$"))
diff --git a/srcpkgs/mimalloc/template b/srcpkgs/mimalloc/template
new file mode 100644
index 000000000000..fa14ba485b6c
--- /dev/null
+++ b/srcpkgs/mimalloc/template
@@ -0,0 +1,32 @@
+# Template file for 'mimalloc'
+pkgname=mimalloc
+version=1.7.2
+revision=1
+build_style=cmake
+configure_args="-DMI_INSTALL_TOPLEVEL=ON -DMI_SECURE=ON"
+short_desc="MIcrosoft's malloc"
+maintainer="Artur Sinila <freesoftware@logarithmus.dev>"
+license="MIT"
+homepage="https://github.com/microsoft/mimalloc"
+distfiles="https://github.com/microsoft/mimalloc/archive/refs/tags/v${version}.tar.gz"
+checksum=b1912e354565a4b698410f7583c0f83934a6dbb3ade54ab7ddcb1569320936bd
+
+if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
+	makedepends+=" libatomic-devel"
+fi
+
+post_install() {
+	vlicense LICENSE
+}
+
+mimalloc-devel_package() {
+	depends="${pkgname}>=${version}_${revision}"
+	short_desc+=" - development files"
+	pkg_install() {
+		vmove usr/include
+		vmove usr/share/cmake
+		vmove usr/lib/*.a
+		vmove usr/lib/*.o
+		vmove usr/lib/*.so
+	}
+}

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

---
 srcpkgs/mold/patches/00-grep.patch | 279 +++++++++++++++++++++++++++++
 srcpkgs/mold/template              |  38 ++++
 2 files changed, 317 insertions(+)
 create mode 100644 srcpkgs/mold/patches/00-grep.patch
 create mode 100644 srcpkgs/mold/template

diff --git a/srcpkgs/mold/patches/00-grep.patch b/srcpkgs/mold/patches/00-grep.patch
new file mode 100644
index 000000000000..fa939d96a22a
--- /dev/null
+++ b/srcpkgs/mold/patches/00-grep.patch
@@ -0,0 +1,279 @@
+--- a/test/build-id.sh
++++ b/test/build-id.sh
+@@ -12,7 +12,7 @@ readelf -n $t/exe | grep -qv 'GNU.*0x00000010.*NT_GNU_BUILD_ID'
+ 
+ clang -o $t/exe $t/a.c -fuse-ld=`pwd`/../mold -Wl,-build-id=uuid
+ readelf -nW $t/exe |
+-  grep -Pq 'GNU.*0x00000010.*NT_GNU_BUILD_ID.*Build ID: ............4...[89abcdef]'
++  rg -Pq 'GNU.*0x00000010.*NT_GNU_BUILD_ID.*Build ID: ............4...[89abcdef]'
+ 
+ clang -o $t/exe $t/a.c -fuse-ld=`pwd`/../mold -Wl,-build-id=md5
+ readelf -n $t/exe | grep -q 'GNU.*0x00000010.*NT_GNU_BUILD_ID'
+--- a/test/copyrel-relro.sh
++++ b/test/copyrel-relro.sh
+@@ -22,7 +22,7 @@ EOF
+ clang -fuse-ld=`pwd`/../mold $t/a.o $t/b.so -o $t/exe
+ readelf -a $t/exe > $t/log
+ 
+-grep -Pqz '(?s)\[(\d+)\] .dynbss.rel.ro .* \1 readonly' $t/log
+-grep -Pqz '(?s)\[(\d+)\] .dynbss .* \1 readwrite' $t/log
++rg -PUq '(?s)\[(\d+)\] .dynbss.rel.ro .* \1 readonly' $t/log
++rg -PUq '(?s)\[(\d+)\] .dynbss .* \1 readwrite' $t/log
+ 
+ echo OK
+--- a/test/demangle.sh
++++ b/test/demangle.sh
+@@ -16,10 +16,10 @@ EOF
+ grep -q 'undefined symbol: .*: _Z3fooii' $t/log
+ 
+ ! clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,-demangle 2> $t/log || false
+-grep -Pq 'undefined symbol: .*: foo\(int, int\)' $t/log
++rg -Pq 'undefined symbol: .*: foo\(int, int\)' $t/log
+ 
+ ! clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o 2> $t/log || false
+-grep -Pq 'undefined symbol: .*: foo\(int, int\)' $t/log
++rg -Pq 'undefined symbol: .*: foo\(int, int\)' $t/log
+ 
+ cat <<EOF | clang -c -o $t/b.o -xc -
+ extern int Pi;
+--- a/test/dt_init.sh
++++ b/test/dt_init.sh
+@@ -18,15 +18,15 @@ EOF
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o
+ readelf -a $t/exe > $t/log
+ 
+-grep -Pqz '(?s)\(INIT\)\s+0x([0-9a-f]+)\b.*\1\s+0 FUNC    GLOBAL HIDDEN\s+\d+ _init\b' $t/log
++rg -PUq '(?s)\(INIT\)\s+0x([0-9a-f]+)\b.*\1\s+0 FUNC    GLOBAL HIDDEN\s+\d+ _init\b' $t/log
+ 
+-grep -Pqz '(?s)\(FINI\)\s+0x([0-9a-f]+)\b.*\1\s+0 FUNC    GLOBAL HIDDEN\s+\d+ _fini\b' $t/log
++rg -PUq '(?s)\(FINI\)\s+0x([0-9a-f]+)\b.*\1\s+0 FUNC    GLOBAL HIDDEN\s+\d+ _fini\b' $t/log
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,-init,init -Wl,-fini,fini
+ readelf -a $t/exe > $t/log
+ 
+-grep -Pqz '(?s)\(INIT\)\s+0x([0-9a-f]+)\b.*\1\s+0 NOTYPE  GLOBAL DEFAULT\s+\d+ init\b' $t/log
++rg -PUq '(?s)\(INIT\)\s+0x([0-9a-f]+)\b.*\1\s+0 NOTYPE  GLOBAL DEFAULT\s+\d+ init\b' $t/log
+ 
+-grep -Pqz '(?s)\(FINI\)\s+0x([0-9a-f]+)\b.*\1\s+0 NOTYPE  GLOBAL DEFAULT\s+\d+ fini\b' $t/log
++rg -PUq '(?s)\(FINI\)\s+0x([0-9a-f]+)\b.*\1\s+0 NOTYPE  GLOBAL DEFAULT\s+\d+ fini\b' $t/log
+ 
+ echo OK
+--- a/test/dt_needed.sh
++++ b/test/dt_needed.sh
+@@ -23,7 +23,7 @@ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/b.o -L $t -lfoo
+ readelf --dynamic $t/exe | fgrep -q 'Shared library: [libfoo]'
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/b.o $t/libbar.so
+-readelf --dynamic $t/exe | grep -Pq 'Shared library: \[.*dt_needed/libbar\.so\]'
++readelf --dynamic $t/exe | rg -Pq 'Shared library: \[.*dt_needed/libbar\.so\]'
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/b.o -L$t -lbar
+ readelf --dynamic $t/exe | fgrep -q 'Shared library: [libbar.so]'
+--- a/test/dynamic.sh
++++ b/test/dynamic.sh
+@@ -14,7 +14,7 @@ fgrep -q 'Shared library: [libc.so.6]' $t/log
+ fgrep -q 'Shared library: [ld-linux-x86-64.so.2]' $t/log
+ 
+ readelf -W --symbols --use-dynamic $t/exe > $t/log2
+-grep -Pq 'FUNC\s+GLOBAL\s+DEFAULT\s+UND\s+__libc_start_main' $t/log2
++rg -Pq 'FUNC\s+GLOBAL\s+DEFAULT\s+UND\s+__libc_start_main' $t/log2
+ 
+ cat <<EOF | clang -c -fPIC -o $t/b.o -xc -
+ #include <stdio.h>
+--- a/test/ifunc-export.sh
++++ b/test/ifunc-export.sh
+@@ -32,6 +32,6 @@ resolve_foobar:
+ EOF
+ 
+ clang -fuse-ld=`pwd`/../mold -shared -o $t/b.so $t/a.o
+-readelf --dyn-syms $t/b.so | grep -Pq '0 (IFUNC|<OS specific>: 10)\s+GLOBAL DEFAULT   \d+ foobar'
++readelf --dyn-syms $t/b.so | rg -Pq '0 (IFUNC|<OS specific>: 10)\s+GLOBAL DEFAULT   \d+ foobar'
+ 
+ echo OK
+--- a/test/image-base.sh
++++ b/test/image-base.sh
+@@ -16,6 +16,6 @@ EOF
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,--image-base=0x8000000
+ $t/exe | grep -q 'Hello world'
+-readelf -W --sections $t/exe | grep -Pq '.interp\s+PROGBITS\s+0000000008000...\b'
++readelf -W --sections $t/exe | rg -Pq '.interp\s+PROGBITS\s+0000000008000...\b'
+ 
+ echo OK
+--- a/test/note.sh
++++ b/test/note.sh
+@@ -31,9 +31,9 @@ EOF
+ ../mold -static -o $t/exe $t/a.o
+ readelf -W --sections $t/exe > $t/log
+ 
+-grep -Pq '.note.bar\s+NOTE.+000008 00   A  0   0  4' $t/log
+-grep -Pq '.note.baz\s+NOTE.+000008 00   A  0   0  8' $t/log
+-grep -Pq '.note.nonalloc\s+NOTE.+000008 00      0   0  1' $t/log
++rg -Pq '.note.bar\s+NOTE.+000008 00   A  0   0  4' $t/log
++rg -Pq '.note.baz\s+NOTE.+000008 00   A  0   0  8' $t/log
++rg -Pq '.note.nonalloc\s+NOTE.+000008 00      0   0  1' $t/log
+ 
+ readelf --segments $t/exe > $t/log
+ fgrep -q '01     .note.bar' $t/log
+--- a/test/pltgot.sh
++++ b/test/pltgot.sh
+@@ -26,6 +26,6 @@ EOF
+ 
+ objdump -d -j .plt.got $t/exe > $t/log
+ 
+-grep -Pq '201020:\s+ff 25 da 0f 00 00\s+jmpq   \*0xfda\(%rip\)\s+# 202000 <ext2>' $t/log
++rg -Pq '201020:\s+ff 25 da 0f 00 00\s+jmpq   \*0xfda\(%rip\)\s+# 202000 <ext2>' $t/log
+ 
+ echo OK
+--- a/test/relax.sh
++++ b/test/relax.sh
+@@ -39,43 +39,43 @@ EOF
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o $t/b.o
+ objdump -d $t/exe | grep -A20 '<bar>:' > $t/log
+ 
+-grep -Pq 'lea \s*0x.+\(%rip\),%rax .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rcx .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rdx .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rbx .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rbp .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rsi .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%rdi .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r8  .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r9  .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r10 .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r11 .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r12 .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r13 .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r14 .*<foo>' $t/log
+-grep -Pq 'lea \s*0x.+\(%rip\),%r15 .*<foo>' $t/log
+-grep -Pq 'callq.*<foo>' $t/log
+-grep -Pq 'jmpq.*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rax .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rcx .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rdx .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rbx .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rbp .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rsi .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%rdi .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r8  .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r9  .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r10 .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r11 .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r12 .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r13 .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r14 .*<foo>' $t/log
++rg -Pq 'lea \s*0x.+\(%rip\),%r15 .*<foo>' $t/log
++rg -Pq 'callq.*<foo>' $t/log
++rg -Pq 'jmpq.*<foo>' $t/log
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o $t/b.o -Wl,-no-relax
+ objdump -d $t/exe | grep -A20 '<bar>:' > $t/log
+ 
+-grep -Pq 'mov \s*0x.+\(%rip\),%rax' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rcx' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rdx' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rbx' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rbp' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rsi' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%rdi' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r8 ' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r9 ' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r10' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r11' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r12' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r13' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r14' $t/log
+-grep -Pq 'mov \s*0x.+\(%rip\),%r15' $t/log
+-grep -Pq 'callq.*\(%rip\)' $t/log
+-grep -Pq 'jmpq.*\(%rip\)' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rax' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rcx' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rdx' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rbx' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rbp' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rsi' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%rdi' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r8 ' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r9 ' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r10' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r11' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r12' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r13' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r14' $t/log
++rg -Pq 'mov \s*0x.+\(%rip\),%r15' $t/log
++rg -Pq 'callq.*\(%rip\)' $t/log
++rg -Pq 'jmpq.*\(%rip\)' $t/log
+ 
+ echo OK
+--- a/test/shared.sh
++++ b/test/shared.sh
+@@ -19,7 +19,7 @@ clang -shared -fuse-ld=`pwd`/../mold -o $t/b.so $t/a.o
+ readelf --dyn-syms $t/b.so > $t/log
+ 
+ grep -q '0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND fn2' $t/log
+-grep -Pq '0 NOTYPE  GLOBAL DEFAULT   \d+ fn1' $t/log
++rg -Pq '0 NOTYPE  GLOBAL DEFAULT   \d+ fn1' $t/log
+ 
+ cat <<EOF | clang -fPIC -c -o $t/c.o -xc -
+ #include <stdio.h>
+--- a/test/symtab.sh
++++ b/test/symtab.sh
+@@ -28,11 +28,11 @@ echo '{ local: module_local; };' > $t/c.map
+ 
+ readelf --symbols $t/exe > $t/log
+ 
+-grep -Pq '0 NOTYPE  LOCAL  DEFAULT    \d+ local1' $t/log
+-grep -Pq '0 NOTYPE  LOCAL  DEFAULT    \d+ local2' $t/log
+-grep -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ foo' $t/log
+-grep -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ bar' $t/log
+-grep -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ this_is_global' $t/log
+-grep -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ module_local' $t/log
++rg -Pq '0 NOTYPE  LOCAL  DEFAULT    \d+ local1' $t/log
++rg -Pq '0 NOTYPE  LOCAL  DEFAULT    \d+ local2' $t/log
++rg -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ foo' $t/log
++rg -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ bar' $t/log
++rg -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ this_is_global' $t/log
++rg -Pq '0 NOTYPE  GLOBAL DEFAULT    \d+ module_local' $t/log
+ 
+ echo OK
+--- a/test/thin-archive.sh
++++ b/test/thin-archive.sh
+@@ -34,9 +34,9 @@ rm -f $t/d.a
+ 
+ clang -fuse-ld=`pwd`/../mold -Wl,--trace -o $t/exe $t/d.o $t/d.a > $t/log
+ 
+-grep -Pq 'thin-archive/d.a\(.*long-long-long-filename.o\)' $t/log
+-grep -Pq 'thin-archive/d.a\(.*b.o\)' $t/log
+-grep -Pq 'thin-archive/d.a\(/.*/b.o\)' $t/log
++rg -Pq 'thin-archive/d.a\(.*long-long-long-filename.o\)' $t/log
++rg -Pq 'thin-archive/d.a\(.*b.o\)' $t/log
++rg -Pq 'thin-archive/d.a\(/.*/b.o\)' $t/log
+ fgrep -q thin-archive/d.o $t/log
+ 
+ $t/exe | grep -q 15
+--- a/test/z_nodump.sh
++++ b/test/z_nodump.sh
+@@ -10,9 +10,9 @@ void foo() {}
+ EOF
+ 
+ clang -fuse-ld=`pwd`/../mold -shared -o $t/b.so $t/a.o
+-! readelf --dynamic $t/b.so | grep -Pq 'Flags: NODUMP' || false
++! readelf --dynamic $t/b.so | rg -Pq 'Flags: NODUMP' || false
+ 
+ clang -fuse-ld=`pwd`/../mold -shared -o $t/b.so $t/a.o -Wl,-z,nodump
+-readelf --dynamic $t/b.so | grep -Pq 'Flags: NODUMP'
++readelf --dynamic $t/b.so | rg -Pq 'Flags: NODUMP'
+ 
+ echo OK
+--- a/test/z_origin.sh
++++ b/test/z_origin.sh
+@@ -15,7 +15,7 @@ EOF
+ 
+ clang -fuse-ld=`pwd`/../mold -o $t/exe $t/a.o -Wl,-z,origin
+ 
+-readelf --dynamic $t/exe | grep -Pq '\(FLAGS\)\s+ORIGIN'
+-readelf --dynamic $t/exe | grep -Pq 'Flags: ORIGIN'
++readelf --dynamic $t/exe | rg -Pq '\(FLAGS\)\s+ORIGIN'
++readelf --dynamic $t/exe | rg -Pq 'Flags: ORIGIN'
+ 
+ echo OK
diff --git a/srcpkgs/mold/template b/srcpkgs/mold/template
new file mode 100644
index 000000000000..8359114c3145
--- /dev/null
+++ b/srcpkgs/mold/template
@@ -0,0 +1,38 @@
+# Template file for 'mold'
+pkgname=mold
+_commit_hash=6695c49379d6d053ea37ba716bf94acb5c4767aa
+version=0.9.2
+revision=1
+build_style=gnu-makefile
+makedepends="mimalloc-devel openssl-devel xxHash-devel tbb-devel zlib-devel"
+checkdepends="ripgrep libdwarf clang tar"
+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=09b624e6bf5240a59aac5eb961b7dde2ea9b439d3e017a1e393034a10fe75b27
+
+# use system-wide installed mimalloc instead of the vendored one
+export SYSTEM_MIMALLOC=1
+export GIT_HASH=$_commit_hash
+
+# skip 32-bit tests on 64-bit musl, because musl doesn't support multilib
+if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
+	if [ "$XBPS_TARGET_WORDSIZE" -eq 64 ]; then
+		checkdepends+=" glibc-devel-32bit libgcc-devel-32bit"
+	else
+		checkdepends+=" glibc-devel libgcc-devel"
+	fi
+else
+	rm test/i386*.sh
+fi
+
+pre_install() {
+	vmkdir usr/bin
+}
+
+post_install() {
+	vlicense LICENSE
+}

  parent reply	other threads:[~2021-07-12 15:27 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  0:36 [PR PATCH] New package: mimalloc-1.7.2 Logarithmus
2021-06-29  0:56 ` [PR REVIEW] " sgn
2021-06-29  0:56 ` sgn
2021-06-29  0:56 ` sgn
2021-06-29  0:56 ` sgn
2021-06-29  0:56 ` sgn
2021-06-29  0:57 ` sgn
2021-06-29  0:58 ` sgn
2021-06-29  1:02 ` Logarithmus
2021-06-29  1:03 ` Logarithmus
2021-06-29  1:03 ` Logarithmus
2021-06-29  1:28 ` Logarithmus
2021-06-29  1:28 ` Logarithmus
2021-06-29  1:32 ` sgn
2021-06-29  1:33 ` Logarithmus
2021-06-29  1:35 ` sgn
2021-06-29  1:36 ` sgn
2021-06-29  1:38 ` Logarithmus
2021-06-29  1:40 ` [PR PATCH] [Updated] " Logarithmus
2021-06-29  1:41 ` Logarithmus
2021-06-29 16:48 ` [PR PATCH] [Updated] " Logarithmus
2021-06-29 17:19 ` Logarithmus
2021-06-29 18:05 ` Logarithmus
2021-06-29 19:26 ` Logarithmus
2021-06-29 19:34 ` Logarithmus
2021-06-29 20:15 ` Logarithmus
2021-06-29 20:15 ` Logarithmus
2021-06-29 20:16 ` Logarithmus
2021-06-30  9:06 ` [PR REVIEW] " travankor
2021-06-30 12:29 ` Logarithmus
2021-06-30 14:07 ` [PR PATCH] [Updated] " Logarithmus
2021-07-01 11:10 ` Logarithmus
2021-07-01 11:20 ` [PR REVIEW] New packages: mold-0.9.1, mimalloc-1.7.2 Logarithmus
2021-07-01 11:26 ` q66
2021-07-01 11:26 ` Logarithmus
2021-07-01 11:28 ` Logarithmus
2021-07-01 13:12 ` q66
2021-07-01 13:23 ` Vaelatern
2021-07-01 13:28 ` q66
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` ericonr
2021-07-01 13:40 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:54 ` Logarithmus
2021-07-01 13:58 ` Logarithmus
2021-07-01 14:00 ` Logarithmus
2021-07-01 14:08 ` q66
2021-07-01 14:26 ` Logarithmus
2021-07-01 14:27 ` Logarithmus
2021-07-01 14:30 ` q66
2021-07-01 14:37 ` Logarithmus
2021-07-01 14:38 ` Logarithmus
2021-07-01 14:39 ` Logarithmus
2021-07-01 14:45 ` Logarithmus
2021-07-01 14:49 ` q66
2021-07-01 15:04 ` ericonr
2021-07-01 15:05 ` Logarithmus
2021-07-01 15:07 ` ericonr
2021-07-01 15:09 ` Logarithmus
2021-07-01 15:20 ` [PR PATCH] [Updated] " Logarithmus
2021-07-01 15:21 ` [PR REVIEW] " Logarithmus
2021-07-01 15:24 ` q66
2021-07-01 15:29 ` Logarithmus
2021-07-01 15:30 ` Logarithmus
2021-07-01 15:34 ` Logarithmus
2021-07-01 15:35 ` Logarithmus
2021-07-01 16:57 ` sgn
2021-07-01 16:59 ` Logarithmus
2021-07-12 15:27 ` Logarithmus [this message]
2021-07-13  2:18 ` [PR PATCH] [Updated] " Logarithmus
2021-07-13  2:23 ` Logarithmus
2021-07-13  2:26 ` [PR REVIEW] " sgn
2021-07-13  2:27 ` sgn
2021-07-13  2:29 ` Logarithmus
2021-07-13  2:37 ` Logarithmus
2021-07-13  2:37 ` Logarithmus
2021-07-13  2:47 ` [PR PATCH] [Updated] New packages: mold-0.9.2, mimalloc-1.7.2 Logarithmus
2021-07-13  2:55 ` [PR REVIEW] " Logarithmus
2021-07-13  2:56 ` Logarithmus
2021-07-13  3:32 ` [PR PATCH] [Updated] " Logarithmus
2021-07-13  3:42 ` [PR REVIEW] " Logarithmus
2021-07-13  3:47 ` [PR PATCH] [Updated] " Logarithmus
2021-07-13  3:49 ` Logarithmus
2021-07-13 10:33 ` [PR PATCH] [Updated] " Logarithmus
2021-07-13 10:37 ` Logarithmus
2021-07-13 10:44 ` Logarithmus
2021-07-13 11:08 ` Logarithmus
2021-07-13 13:12 ` [PR REVIEW] " ericonr
2021-07-13 13:12 ` ericonr
2021-07-13 13:12 ` ericonr
2021-07-13 13:12 ` ericonr
2021-07-13 13:13 ` Logarithmus
2021-07-13 13:15 ` Logarithmus
2021-07-13 13:18 ` Logarithmus
2021-07-24  1:48 ` [PR PATCH] [Updated] " Logarithmus
2021-07-24 10:24 ` Logarithmus
2021-07-24 10:32 ` [PR PATCH] [Updated] New packages: mold-0.9.3, mimalloc-1.7.2 Logarithmus
2021-07-24 12:13 ` [PR REVIEW] " sgn
2021-07-24 12:14 ` Logarithmus
2021-07-25 20:19 ` ericonr
2021-07-26 13:47 ` [PR PATCH] [Updated] " Logarithmus
2021-07-26 13:50 ` Logarithmus
2021-07-27  3:23 ` [PR REVIEW] " Logarithmus
2021-07-27  3:25 ` Logarithmus
2021-10-24 18:13 ` cinerea0
2021-12-20  1:45 ` Sinono3
2021-12-24 20:15 ` Logarithmus
2021-12-24 20:16 ` Logarithmus
2022-01-09 20:09 ` [PR REVIEW] " Anachron
2022-01-10 19:31 ` Chocimier
2022-01-10 22:08 ` Anachron
2022-01-11  8:27 ` Anachron
2022-01-14  4:15 ` cinerea0
2022-05-24  2:13 ` github-actions
2022-06-08  2:11 ` [PR PATCH] [Closed]: " github-actions

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=20210712152733.lmiz12sCUhTyHqgOTRhUtlI-LmoOOogBFYDLHpCol28@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).