pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/mold mold: update to 1.0.2.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/dfdc853ff3f0
branches:  trunk
changeset: 372861:dfdc853ff3f0
user:      fcambus <fcambus%pkgsrc.org@localhost>
date:      Mon Jan 31 22:44:55 2022 +0000

description:
mold: update to 1.0.2.

New features:

- mold now automatically falls back to ld.bfd or ld.lld if GCC-based LTO
  (link time optimization) or LLVM-based LTO are requested, respectively.
  This is a temporary hack until mold gains native LTO support. (a5029d1)
- The following flags have been added: -z ibt (9ca6a9d), -z cet-report
  (31a43a7), -z shstk (e29bd8f), -z ibtplt (fbfa01d)
- [ARM64] Range extension thunks are now supported. Previously, mold
  reported "relocation overflow" errors when the output file's text
  segment is larger than some threshold (~60 MiB). Now, it can link large
  programs just fine. (9287682)
- [NetBSD] mold is now usable on NetBSD. (948248b)
- [x86-64] mold now emits compact 8-byte PLT entries instead of the
  regular 16-byte PLT entries if -z now is given. (0370e7f)
- RELR-type packed dynamic relocations are now supported. You can enable
  it by passing -z pack-dyn-relocs=relr. The good news is that it can
  typically reduce PIE (position-independent executable) size by a few
  percent. This is not a negligible saving because PIE is now default on
  many systems for security reasons. The bad news is that it needs a
  runtime support. To our knowledge, it's supported only on ChromeOS,
  Android, Fuchsia and SerenityOS at this moment. We need to wait for a
  while for other systems to catch up. (bd6afa1)

Performance improvements:

- Version script processor was rewritten with the Aho-Corasick string
  matching algorithm. If your program uses a version script that contains
  lots of glob patterns with the * metacharacter, you'll likely to see a
  significant speedup. (d0c1c4d)
- Relocation processing for non-memory-allocated sections has been
  optimized. You'll likely to see a speedup if your binary contains large
  size of debug info. (d8dc8a6)

Bug fixes and compatibility improvements:

- mold can now link ICC-generated object files with GCC-generated ones
  even if the -static flag is given. (#271, be6ae07)
- mold can now handle archive files (.a files) larger than 4 GiB.
  (bba506d)
- mold no longer have "GNU gold" in its --version string. We had this
  identification string for some ./configure scripts that didn't work
  without it, but it causes other compatibility issue such as #284. Now,
  mold --version prints out something like mold 1.0.2 (compatible with
  GNU ld). We still need "GNU ld" for many ./configure scripts. (cea6a56)
- Symbol resolution algorithm has been completely rewritten. The previous
  implementation was non-deterministic in some edge cases, meaning that
  outcomes from multiple runs of the linker with the same command line
  parameters could be different due to thread scheduling randomness or
  some other internal randomness. Now it is guaranteed to be
  deterministic. (ce5749c)
- mold now try to pull out an object file from an archive if it's needed
  to resolve an undefined symbol with a common symbol. mold used to
  ignore common symbols in archives, so it could fail with an unresolved
  symbol error even if the undefined symbol could be resolved using a
  file in an archive. (27d8361)
- mold no longer converts .ctors/.dtors sections into
  .init_array/.fini_array sections. mold used to convert them but in a
  wrong way. Since .ctors/.dtors have been superseded by
  .init_array/.fini_array long ago, it should be fine to stop doing this
  now. (4348417)
- [i386] mold now ignores some legacy symbols in an i386 CRT files to
  avoid duplicate symbol errors. (#270, 0c19046)

diffstat:

 devel/mold/Makefile                         |   5 +-
 devel/mold/distinfo                         |  12 +++----
 devel/mold/patches/patch-Makefile           |  45 +++++++++++-----------------
 devel/mold/patches/patch-elf_cmdline.cc     |  32 --------------------
 devel/mold/patches/patch-elf_object-file.cc |  27 -----------------
 5 files changed, 26 insertions(+), 95 deletions(-)

diffs (160 lines):

diff -r bb122ed15537 -r dfdc853ff3f0 devel/mold/Makefile
--- a/devel/mold/Makefile       Mon Jan 31 22:44:21 2022 +0000
+++ b/devel/mold/Makefile       Mon Jan 31 22:44:55 2022 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.6 2022/01/19 02:52:24 pho Exp $
+# $NetBSD: Makefile,v 1.7 2022/01/31 22:44:55 fcambus Exp $
 
-DISTNAME=      mold-1.0.1
+DISTNAME=      mold-1.0.2
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=rui314/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
@@ -13,6 +13,7 @@
 USE_TOOLS+=    gmake
 USE_LANGUAGES= c c++20
 
+MAKE_FLAGS+=   PREFIX="${PREFIX}"
 MAKE_FLAGS+=   MANDIR="${PREFIX}/${PKGMANDIR}"
 MAKE_FLAGS+=   SYSTEM_MIMALLOC=1 SYSTEM_TBB=1 SYSTEM_XXHASH=1
 
diff -r bb122ed15537 -r dfdc853ff3f0 devel/mold/distinfo
--- a/devel/mold/distinfo       Mon Jan 31 22:44:21 2022 +0000
+++ b/devel/mold/distinfo       Mon Jan 31 22:44:55 2022 +0000
@@ -1,8 +1,6 @@
-$NetBSD: distinfo,v 1.8 2022/01/19 02:52:24 pho Exp $
+$NetBSD: distinfo,v 1.9 2022/01/31 22:44:55 fcambus Exp $
 
-BLAKE2s (mold-1.0.1.tar.gz) = d41c3256a5e956ffb060b32a6e7549c5e10ce5fa733802cd33b2677d7b3bf8f3
-SHA512 (mold-1.0.1.tar.gz) = cc03a7db395362b97879c28942397d4443d12b72e067b6f979b1ece4d8aab06154b4c1a0f4c57d6ac505bcd4f892bf9a355ad281d628d4d544d8f70edaf34b72
-Size (mold-1.0.1.tar.gz) = 3675262 bytes
-SHA1 (patch-Makefile) = 4599df0bdfdf0718219bf43a1bc2bdcfa0f33ab4
-SHA1 (patch-elf_cmdline.cc) = 2e6879b268e08a76556c167086799122ab8e4b2f
-SHA1 (patch-elf_object-file.cc) = 7ab32cd5cb907ee4a599ae4ced988cee4ad832cf
+BLAKE2s (mold-1.0.2.tar.gz) = b0c37210c716b5b252ee3b57c1e232056dec2ebf0ff6494c9634b19c4b5d63a4
+SHA512 (mold-1.0.2.tar.gz) = 27f6664e63c76c32a6e3ec8bfc4b204138926001f5431be94da9ce47a5d9d3b51aa634c5cd6df45be660d52ac0507f7b7eec17134e35db402db5747d2ecc3715
+Size (mold-1.0.2.tar.gz) = 4501088 bytes
+SHA1 (patch-Makefile) = 4da9e8cf4b5be616027bce527865e683249bfb4c
diff -r bb122ed15537 -r dfdc853ff3f0 devel/mold/patches/patch-Makefile
--- a/devel/mold/patches/patch-Makefile Mon Jan 31 22:44:21 2022 +0000
+++ b/devel/mold/patches/patch-Makefile Mon Jan 31 22:44:55 2022 +0000
@@ -1,34 +1,25 @@
-$NetBSD: patch-Makefile,v 1.5 2022/01/19 02:52:24 pho Exp $
+$NetBSD: patch-Makefile,v 1.6 2022/01/31 22:44:55 fcambus Exp $
 
-Do not hard-code -ldl, -pthread, or -fPIE as they are handled by the pkgsrc
-infrastructure.
+- Honour CFLAGS and CXXFLAGS
+- Do not hard-code -pthread, as it is handled by the pkgsrc infrastructure.
 
---- Makefile.orig      2021-12-31 05:10:03.000000000 +0000
+--- Makefile.orig      2022-01-23 08:19:40.000000000 +0000
 +++ Makefile
-@@ -19,7 +19,7 @@ STRIP ?= strip
- OS ?= $(shell uname -s)
- 
- # Used for both C and C++
--COMMON_FLAGS = -pthread -fPIE -fno-unwind-tables -fno-asynchronous-unwind-tables
-+COMMON_FLAGS = -fno-unwind-tables -fno-asynchronous-unwind-tables
+@@ -34,14 +34,14 @@ endif
  
- CFLAGS ?= -O2
- CFLAGS += $(COMMON_FLAGS)
-@@ -27,7 +27,7 @@ CFLAGS += $(COMMON_FLAGS)
- CXXFLAGS ?= -O2
- CXXFLAGS += $(COMMON_FLAGS) -std=c++20 -fno-exceptions
- CPPFLAGS += -DMOLD_VERSION=\"1.0.1\" -DLIBDIR="\"$(LIBDIR)\""
--LIBS = -pthread -lz -ldl -lm
-+LIBS = -lz -lm
+ # If you want to compile mold for debugging, invoke make as
+ # `make CXXFLAGS=-g`.
+-CFLAGS = -O2
+-CXXFLAGS = -O2
++CFLAGS ?= -O2
++CXXFLAGS ?= -O2
  
- SRCS=$(wildcard *.cc elf/*.cc macho/*.cc)
- HEADERS=$(wildcard *.h elf/*.h macho/*.h)
-@@ -120,7 +120,7 @@ mold: $(OBJS) $(MIMALLOC_LIB) $(TBB_LIB)
-       ln -sf mold ld64.mold
+ MOLD_CXXFLAGS = -std=c++20 -fno-exceptions -fno-unwind-tables \
+                 -fno-asynchronous-unwind-tables -DMOLD_VERSION=\"1.0.2\" \
+                 -DLIBDIR="\"$(LIBDIR)\""
  
- mold-wrapper.so: elf/mold-wrapper.c Makefile
--      $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $(LDFLAGS) $< -ldl
-+      $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $(LDFLAGS) $<
+-MOLD_LDFLAGS = -pthread -lz -lm
++MOLD_LDFLAGS = -lz -lm
  
- out/%.o: %.cc $(HEADERS) Makefile out/elf/.keep out/macho/.keep
-       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
+ GIT_HASH = $(shell [ -d .git ] && git rev-parse HEAD)
+ ifneq ($(GIT_HASH),)
diff -r bb122ed15537 -r dfdc853ff3f0 devel/mold/patches/patch-elf_cmdline.cc
--- a/devel/mold/patches/patch-elf_cmdline.cc   Mon Jan 31 22:44:21 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-$NetBSD: patch-elf_cmdline.cc,v 1.1 2022/01/19 02:52:24 pho Exp $
-
-Ignore -dc and -dp for now. The base GCC for NetBSD 9 passes them to linker but
-mold currently doesn't support them.
-
-PR sent to the upstream:
-https://github.com/rui314/mold/pull/278
-
---- elf/cmdline.cc.orig        2022-01-18 17:54:53.408218316 +0000
-+++ elf/cmdline.cc
-@@ -60,10 +60,12 @@ Options:
-   --color-diagnostics         Alias for --color-diagnostics=always
-   --compress-debug-sections [none,zlib,zlib-gabi,zlib-gnu]
-                               Compress .debug_* sections
-+  --dc                        Ignored
-   --defsym=SYMBOL=VALUE       Define a symbol alias
-   --demangle                  Demangle C++ symbols in log messages (default)
-     --no-demangle
-   --disable-new-dtags         Ignored
-+  --dp                        Ignored
-   --dynamic-list              Read a list of dynamic symbols
-   --eh-frame-hdr              Create .eh_frame_hdr section
-     --no-eh-frame-hdr
-@@ -796,6 +798,8 @@ void parse_nonpositional_args(Context<E>
-     } else if (read_flag(args, "no-undefined-version")) {
-     } else if (read_arg(ctx, args, arg, "sort-section")) {
-     } else if (read_flag(args, "sort-common")) {
-+    } else if (read_flag(args, "dc")) {
-+    } else if (read_flag(args, "dp")) {
-     } else if (read_flag(args, "fix-cortex-a53-843419")) {
-     } else if (read_flag(args, "EL")) {
-     } else if (read_flag(args, "warn-once")) {
diff -r bb122ed15537 -r dfdc853ff3f0 devel/mold/patches/patch-elf_object-file.cc
--- a/devel/mold/patches/patch-elf_object-file.cc       Mon Jan 31 22:44:21 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-$NetBSD: patch-elf_object-file.cc,v 1.1 2022/01/19 02:52:24 pho Exp $
-
-It should be perfectly legal to have an empty CIE along with an end-of-records
-marker of FDE. /usr/lib/crtend.o from NetBSD/amd64 has the following .eh_frame
-but mold emits an error for the zero-length FDE:
-
-    .section   .eh_frame, "a", @progbits
-    .align 8
-    .quad 0
-
-PR sent to the upstream:
-https://github.com/rui314/mold/pull/278
-
---- elf/object-file.cc.orig    2021-12-31 05:10:03.000000000 +0000
-+++ elf/object-file.cc
-@@ -322,9 +322,8 @@ void ObjectFile<E>::read_ehframe(Context
-   for (std::string_view data = contents; !data.empty();) {
-     i64 size = *(u32 *)data.data();
-     if (size == 0) {
--      if (data.size() != 4)
--        Fatal(ctx) << isec << ": garbage at end of section";
--      break;
-+      data = data.substr(4);
-+      continue;
-     }
- 
-     i64 begin_offset = data.data() - contents.data();



Home | Main Index | Thread Index | Old Index