Mon Feb 21 11:47:41 2022 UTC ()
mold: update to 1.1.

mold 1.1 is a new release of the high-performance linker. It contains
a few new major features and various bug fixes.

New features:

- Native LTO (link-time optimization) support has been added.
  mold used to invoke ld.bfd or ld.lld if it encountered a GCC
  IR (intermediate representation) file or an LLVM IR file to
  delegate the task to the LTO-capable linkers, respectively.
  Now, mold handles IR files directly. This feature is implemented
  using the linker plugin API which is also used by GNU ld and
  GNU gold. Note that the LTO support has been added for completeness
  and not for speed. mold is only marginally faster than the
  other linkers for LTO builds because not linking but code
  optimization dominates. (46995bc)
- RISC-V (RV64) is now supported as both host and target platforms.
  mold can link real-world large programs such as mold itself or
  LLVM Clang for RISC-V. (e76f7c0)
- The -emit-relocs option is supported. If the option is given,
  mold copies relocation sections from input files to an output
  file. This feature is used by some post-link binary optimization
  or analysis tools such as Facebook's Bolt. (26fe71d)
- mold gained the --shuffle-sections option. If the option is
  given, the linker randomly shuffle the order of input sections
  before fixing their addresses in the virtual address space.
  This feature is useful in some situations. First, it can be
  used as a strong form of ASLR (address space layout randomization).
  Second, you can enable it when you are benchmarking some other
  program to get more reliable benchmark numbers, because even
  the same machine code can vary in performance if they are laid
  out differently in the virtual address space. You want to make
  sure that you got good/bad benchmark numbers not by coincidence
  by shuffling input sections. (7e91897)
- The --print-dependencies and --print-dependencies=full options
  were added. They print out dependencies between input files in
  the CSV format. That is, they print out the information as to
  which file depends on which file to use which symbol. We added
  this feature with a few use cases in mind. First, you can use
  this to analyze why some object file was pulled out from an
  archive and got linked to an output file. Second, when you want
  to eliminate all dependencies to some library, you can find
  all of them very easy with this feature. Note that this is an
  experimental feature and may change or removed in feature
  releases of mold. (a1287c2)
- The following options are added: --warn-once (f24b997),
  --warn-textrel (6ffcae4)
- Runtime dependency to libxxhash has been eliminated. (e5f4b96)

Bug fixes and compatibility improvements:

- A PT_GNU_RELRO segment is now aligned up to the next page
  boundary. Previously, mold didn't align it up, and the runtime
  loader align it down, so the last partial page would not be
  protected by the RELRO mechanism. Now, the entire RELRO segment
  is guaranteed to be read-only at runtime. (0a0f9b3)
- The .got.plt section is now protected by RELRO if -z now is
  given. This is possible because writes to .got.plt happen only
  during process startup if all symbols are resolved on process
  startup. (73159e2)
- Previously, mold reported an error if object files created with
  old GCC (with -fgnu-unique) are mixed with ones created with
  newer GCC or Clang (with -fno-gnu-unique) (#324). Now, mold
  accepts such input files. (e65c5d2)
- mold can now be built with musl libc. (42b7eb8)
- mold-generated .symtab section now contains section symbols
  and symbols derived from input shared object files. (e4c03c2,
  1550b5a)
- mold-generated executables can now run under valgrind. Previously,
  valgrind aborted on startup due to an assertion failure because
  it didn't expect for an executable to have both .bss and .dynbss
  sections. mold generated .dynbss to contain copy-relocated
  symbols. The section has been renamed .copyrel to workaround
  the valgrind's issue. (0f8bf23)


(fcambus)
diff -r1.8 -r1.9 pkgsrc/devel/mold/Makefile
diff -r1.10 -r1.11 pkgsrc/devel/mold/distinfo
diff -r1.7 -r1.8 pkgsrc/devel/mold/patches/patch-Makefile

cvs diff -r1.8 -r1.9 pkgsrc/devel/mold/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/mold/Makefile 2022/02/01 14:21:51 1.8
+++ pkgsrc/devel/mold/Makefile 2022/02/21 11:47:41 1.9
@@ -1,35 +1,34 @@ @@ -1,35 +1,34 @@
1# $NetBSD: Makefile,v 1.8 2022/02/01 14:21:51 fcambus Exp $ 1# $NetBSD: Makefile,v 1.9 2022/02/21 11:47:41 fcambus Exp $
2 2
3DISTNAME= mold-1.0.3 3DISTNAME= mold-1.1
4CATEGORIES= devel 4CATEGORIES= devel
5MASTER_SITES= ${MASTER_SITE_GITHUB:=rui314/} 5MASTER_SITES= ${MASTER_SITE_GITHUB:=rui314/}
6GITHUB_TAG= v${PKGVERSION_NOREV} 6GITHUB_TAG= v${PKGVERSION_NOREV}
7 7
8MAINTAINER= fcambus@NetBSD.org 8MAINTAINER= fcambus@NetBSD.org
9HOMEPAGE= https://github.com/rui314/mold/ 9HOMEPAGE= https://github.com/rui314/mold/
10COMMENT= High performance drop-in replacement for existing Unix linkers 10COMMENT= High performance drop-in replacement for existing Unix linkers
11LICENSE= gnu-agpl-v3 11LICENSE= gnu-agpl-v3
12 12
13USE_TOOLS+= gmake 13USE_TOOLS+= gmake
14USE_LANGUAGES= c c++20 14USE_LANGUAGES= c c++20
15 15
16MAKE_FLAGS+= PREFIX="${PREFIX}" 16MAKE_FLAGS+= PREFIX="${PREFIX}"
17MAKE_FLAGS+= MANDIR="${PREFIX}/${PKGMANDIR}" 17MAKE_FLAGS+= MANDIR="${PREFIX}/${PKGMANDIR}"
18MAKE_FLAGS+= SYSTEM_MIMALLOC=1 SYSTEM_TBB=1 SYSTEM_XXHASH=1 18MAKE_FLAGS+= SYSTEM_MIMALLOC=1 SYSTEM_TBB=1
19 19
20# This package uses a lot of C++20 features. GCC 10 is the oldest GCC that can 20# This package uses a lot of C++20 features. GCC 10 is the oldest GCC that can
21# build it. 21# build it.
22GCC_REQD+= 10 22GCC_REQD+= 10
23 23
24# Handle linker flags for dlopen and pthread automatically. 24# Handle linker flags for dlopen and pthread automatically.
25DL_AUTO_VARS= yes 25DL_AUTO_VARS= yes
26PTHREAD_AUTO_VARS= yes 26PTHREAD_AUTO_VARS= yes
27 27
28.include "../../devel/mimalloc/buildlink3.mk" 28.include "../../devel/mimalloc/buildlink3.mk"
29.include "../../devel/xxhash/buildlink3.mk" 
30.include "../../devel/zlib/buildlink3.mk" 29.include "../../devel/zlib/buildlink3.mk"
31.include "../../parallel/threadingbuildingblocks/buildlink3.mk" 30.include "../../parallel/threadingbuildingblocks/buildlink3.mk"
32.include "../../security/openssl/buildlink3.mk" 31.include "../../security/openssl/buildlink3.mk"
33.include "../../mk/dlopen.buildlink3.mk" 32.include "../../mk/dlopen.buildlink3.mk"
34.include "../../mk/pthread.buildlink3.mk" 33.include "../../mk/pthread.buildlink3.mk"
35.include "../../mk/bsd.pkg.mk" 34.include "../../mk/bsd.pkg.mk"

cvs diff -r1.10 -r1.11 pkgsrc/devel/mold/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/mold/distinfo 2022/02/01 14:21:51 1.10
+++ pkgsrc/devel/mold/distinfo 2022/02/21 11:47:41 1.11
@@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
1$NetBSD: distinfo,v 1.10 2022/02/01 14:21:51 fcambus Exp $ 1$NetBSD: distinfo,v 1.11 2022/02/21 11:47:41 fcambus Exp $
2 2
3BLAKE2s (mold-1.0.3.tar.gz) = 26f2d46b7595debc2b26dcb8728dea8c574bb4b409760d728460b5d995801a96 3BLAKE2s (mold-1.1.tar.gz) = 7980e10d71e758ffbfce0c0640364ba593ae98270f1e9f2ec182cae8ad406357
4SHA512 (mold-1.0.3.tar.gz) = 50b4a80c8b7a4925e6e85a35e92529867648df61ca016ee662b3fce7cf9d4a8fd717311ec0542aa594f44b49d48de34d51d7e94cae0f21bda01fdd4418990f38 4SHA512 (mold-1.1.tar.gz) = b8b125c77563abe2741c2f32d73ab2b12dff275b92b633fcd015336c6ea735e38e95c3d2afb50e5baace2023d4f9de3eb50d53053eabc2cd2f045110eef4cc1e
5Size (mold-1.0.3.tar.gz) = 4501162 bytes 5Size (mold-1.1.tar.gz) = 4522886 bytes
6SHA1 (patch-Makefile) = 58f8bd9fe926274220ce2f925ba9f26351f0e8cd 6SHA1 (patch-Makefile) = 2abe38249ccd2691dd86e163cf11fd4c93429f7d

cvs diff -r1.7 -r1.8 pkgsrc/devel/mold/patches/Attic/patch-Makefile (expand / switch to unified diff)

--- pkgsrc/devel/mold/patches/Attic/patch-Makefile 2022/02/01 14:21:51 1.7
+++ pkgsrc/devel/mold/patches/Attic/patch-Makefile 2022/02/21 11:47:41 1.8
@@ -1,25 +1,26 @@ @@ -1,25 +1,26 @@
1$NetBSD: patch-Makefile,v 1.7 2022/02/01 14:21:51 fcambus Exp $ 1$NetBSD: patch-Makefile,v 1.8 2022/02/21 11:47:41 fcambus Exp $
2 2
3- Honour CFLAGS and CXXFLAGS 3- Honour CFLAGS and CXXFLAGS
4- Do not hard-code -pthread, as it is handled by the pkgsrc infrastructure. 4- Do not hard-code -pthread, as it is handled by the pkgsrc infrastructure.
 5- Do not hard-code -ldl
5 6
6--- Makefile.orig 2022-01-30 10:39:38.000000000 +0000 7--- Makefile.orig 2022-02-20 07:40:17.000000000 +0000
7+++ Makefile 8+++ Makefile
8@@ -34,14 +34,14 @@ endif 9@@ -42,14 +42,14 @@ endif
9  10
10 # If you want to compile mold for debugging, invoke make as 11 # If you want to compile mold for debugging, invoke make as
11 # `make CXXFLAGS=-g`. 12 # `make CXXFLAGS=-g`.
12-CFLAGS = -O2 13-CFLAGS = -O2
13-CXXFLAGS = -O2 14-CXXFLAGS = -O2
14+CFLAGS ?= -O2 15+CFLAGS ?= -O2
15+CXXFLAGS ?= -O2 16+CXXFLAGS ?= -O2
16  17
17 MOLD_CXXFLAGS = -std=c++20 -fno-exceptions -fno-unwind-tables \ 18 MOLD_CXXFLAGS := -std=c++20 -fno-exceptions -fno-unwind-tables \
18 -fno-asynchronous-unwind-tables -DMOLD_VERSION=\"1.0.3\" \ 19 -fno-asynchronous-unwind-tables -Ithird-party/xxhash \
19 -DLIBDIR="\"$(LIBDIR)\"" 20 -DMOLD_VERSION=\"$(VERSION)\" -DLIBDIR="\"$(LIBDIR)\""
20  21
21-MOLD_LDFLAGS = -pthread -lz -lm 22-MOLD_LDFLAGS := -pthread -lz -lm -ldl
22+MOLD_LDFLAGS = -lz -lm 23+MOLD_LDFLAGS := -lz -lm
23  24
24 GIT_HASH = $(shell [ -d .git ] && git rev-parse HEAD) 25 GIT_HASH := $(shell [ -d .git ] && git rev-parse HEAD)
25 ifneq ($(GIT_HASH),) 26 ifneq ($(GIT_HASH),)