./devel/mold, High performance drop-in replacement for existing Unix linkers

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 1.3.0nb1, Package name: mold-1.3.0nb1, Maintainer: fcambus

mold is a new linker that is optimized for modern multi-core machines.

mold is command-line compatible with the other major linkers, GNU ld, GNU gold
and LLVM lld, yet it is several times faster than them. Its goal is to increase
programmer productivity by speeding up program build time, especially for rapid
edit-build-test-debug cycles.


Master sites:

Filesize: 4579.566 KB

Version history: (Expand)


CVS history: (Expand)


   2022-06-23 16:24:33 by Frederic Cambus | Files touched by this commit (1)
Log message:
mold: fix the build by reverting to using SYSTEM_TBB=1.
   2022-06-18 16:23:13 by Frederic Cambus | Files touched by this commit (3) | Package updated
Log message:
mold: update to 1.3.0.

Pkgsrc changes:

- Remove now unneeded pkg-config from USE_TOOLS
- Use <stdlib.h> on systems where <alloca.h> doesn't exist
- Link the bundled (patched) libtbb, as per upstream recommendation

Bug fixes and compatibility improvements:

- The --icf=safe option has been supported. This option enables a feature
  to find and deduplicate identical code that can be merged safely. For C++
  programs, it typically reduces the output binary size by a few percent.
  --icf=safe needs to be used with a compiler that supports .llvm_addrsig
  section; if a compiler does not support it, --icf=safe doesn't do any harm
  but cannot optimize a given program at all. That section is supported by
  LLVM/Clang at the moment, and we are working on adding it to GCC.
- LTO now works reliably under a heavy load. mold used to abort occasionally
  under such condition on Linux due to a spurious failure of pthread_create(2).
- mold now prints out undefined symbol errors in a format similar to LLVM lld.
- mold now prints out a better error message for the disk full situation.
- mold can now build GCC 12 with LTO.
- Fixed an LTO issue on 32-bits hosts such as i686.
- mold is now AddressSanitizer and UndefinedSanitizer clean.
- mold used to create broken debug info on 32-bits hosts. The bug has been
  fixed.
- mold used to accept not only a single dash but also double dashes for
  single-letter options. For example, --S was accidentally accepted as an
  alias for-S. This is unconventional, and such options are no longer
  accepted.
- --color-diagnostics is now an alias for --color-diagnostics=auto instead
  of --color-diagnostics=always for compatibility with LLVM lld.
- pkg-config is no longer needed to build mold.
- The --package-metadata option is supported.

Removed features:

- An experimental --preload flag has been removed.
   2022-05-11 09:02:11 by Frederic Cambus | Files touched by this commit (1)
Log message:
mold: install phase uses python3 command, provide a symlink.

Thanks to wiz@ once again for the heads up.
   2022-05-05 23:22:29 by Frederic Cambus | Files touched by this commit (1)
Log message:
mold: the install target requires Python.
   2022-05-05 23:11:55 by Frederic Cambus | Files touched by this commit (1)
Log message:
mold: needs pkg-config.
   2022-04-29 08:45:45 by Frederic Cambus | Files touched by this commit (2) | Package updated
Log message:
mold: update to 1.2.1.

Bug fixes and compatibility improvements:

- Various bugs in --gdb-index have been fixed.
- mold now recognizes --thinlto-cache-dir and --thinlto-cache-policy for the
  sake of compatibility with LLVM lld. (7ebd071)
- mold can now handle TLS common symbols. It looks like GCC sometimes creates
  such symbol for a thread-local variable. (cf850f8)
- In some edge cases, mold created a non-versioned symbol and a versioned one
  for the same symbol, even though if one symbol is versioned, all symbols of
  the same name must be versioned. This bug has been fixed. (8298c0a)
- mold used to write a PLT address of a symbol instead of its address to
  .symtab. This bug has been fixed. (e088db7)
- mold can now handle an input file with more than 219 symbols. (f1f2d40)
- /usr/local/libexec/mold/ld is now installed as a relative symlink instead
  of an absolute symlink. (5803c3c)
   2022-04-15 18:30:37 by Frederic Cambus | Files touched by this commit (2) | Package updated
Log message:
mold: update to 1.2.0.

mold 1.2.0 is a new release of the high-speed linker. The highlight of this
release is the 32-bit ARM support. We also added other features, and as
always, we fixed many bugs and compatibility issues in this release.

New features:

- The ARM32 target is now supported.

- --gdb-index is implemented. If this option is given, mold creates an
  .gdb_index section in an output file to speed up GNU debugger. Users have
  to compile their object files with -ggnu-pubnames to use this flag. mold
  used to ignore --gdb-index. (a7475dd)

- mold now supports the following flags: --start-address, -Tbss, -Tdata,
  -Ttext, --oformat=binary, --disable-new-dtags

Deprecated features:

- An experimental, mold-specific --preload flag has been marked as
  deprecated. It's still usable, but a warning message will be displayed
  if that flag is given.

Bug fixes and compatibility improvements:

- -dy and -dn are now accepted as aliases for -Bdynamic and -Bstatic,
  respectively. (82e8072)

- -static-pie now works with older versions of glibc thanks to a few bug
  fixes. (3d68824, 0884f27)

- Issues found by UndefinedBehaviorSanizer, AddressSanitizer and
  ThreadSanitizer are fixed. (bf26753, f4753b3, e1e4e9f)

- mold used to place sections with very large section alignment
  requirements to wrong places in an output file. That caused a mysterious
  crash of a produced binary (#405). That bug was most noticeable when
  Nvidia-provided object files are given because they tend to contain such
  sections. This bug has been fixed. (100922b)

- .ctors and .dtors sections are now recognized by mold, and their contents
  are sorted with a special rule. This shouldn't affect most build
  environments because these sections have been superseded by .init_array
  and .fini_array sections a long time ago. But it looks like some old
  i386 compilers are still using .ctors and .dtors. (392781a)

- For a non-position-independent executable, we have to make address-taken
  PLT entries as "canonical". Marking all PLT entries canonical should be
  harmless in theory, so we did so. However, some programs, notably Qt
  library, assume that non-address-taken PLTs can never be canonical
  (#352). For the sake of compatibility with such programs, we now make
  PLTs canonical only when their addresses are taken. (e0bc74a)

- mold now defines _TLS_MODULE_BASE_ symbol. A reference to this symbol
  can occur if -mtls-dialect=gnu2 is given to a compiler. The flag tells
  the compiler to use TLSDESC mechanism instead of the regular TLS access
  mechanism to access thread-local variables. (5feab82)

- libbacktrace sometimes fail to read compressed debug sections in
  mold-generated files due to a bug. We not only fix that libbacktrace's
  bug (ianlancetaylor/libbacktrace#87) but also implemented a workaround
  to mold (ba63479) so that mold works with older versions of libbacktrace.

- [ARM64] mold now recognizes R_AARCH64_LD_PREL_LO19 relocation. (146ddd7)

- [RISCV64] The correct semantics of R_RISCV_ALIGN is implemented.
  (0daf623)
   2022-03-08 15:04:57 by Frederic Cambus | Files touched by this commit (3) | Package updated
Log message:
mold: update to 1.1.1.

New features:

- The --dependency-file option has been added. The option is analogous to
  the compiler's -MM option; it generates a text file containing dependency
  information in the Makefile format, so that you can include a generated
  file into a Makefile to automate the file dependency management. (a054bcd)
- mold has gained the --reverse-sections option. If the option is given,
  mold reverses the list of input sections before assigning them the
  addresses in an output file. This option is useful to find a bug in global
  initializers (e.g. constructors of global variables.) In C++, the execution
  order of global initializers is guaranteed only within a single compilation
  unit (they are executed from top to bottom.) If two global initializers
  are in different object files, they can be executed in any order. Reversing
  the execution order of the global initializers in different input files
  should help you identify a bug in your program. If your program does not
  work with -Wl,--reverse-sections, your program depends on the undefined
  behavior.
- --shuffle-sections now takes an optional seed for the random number
  generator in the form of --shuffle-sections=<number>. (8f21cc3)
- mold now supports the following LTO-related options for compatibility
  with LLVM lld: --disable-verify, --lto-O, --lto-cs-profile-file,
  --lto-cs-profile-generate, --lto-debug-pass-manager, --lto-emit-asm,
  --lto-obj-path, --lto-partitions, --lto-pseudo-probe-for-profiling,
  --lto-sample-profile, --no-legacy-pass-manager,
  --no-lto-legacy-pass-manager, --opt-remarks-filename, --opt-remarks-format,
  --opt-remarks-hotness-threshold, --opt-remarks-passes,
  --opt-remarks-with_hotness, --save-temps, --thinlto-emit-imports-files,
  --thinlto-index-only, --thinlto-index-only, --thinlto-jobs, --thinlto-jobs,
  --thinlto-object-suffix-replace, --thinlto-prefix-replace (e413433)
- -noinhibit-exec and --warn-shared-textrel have been supported.

Performance improvements:

- We optimized mold's memory usage by reducing the sizes of
  frequently-allocated objects. Compared to mold 1.1, we observed ~6%
  reduction of maximum resident set size (RSS) when linking Chromium. Our
  maximum RSS is smaller than LLVM lld and GNU gold as far as we tested. We
  measured maximum RSSes with time -v. (f2d27d8, 7068c0c, 83e05da, 4dae896)
- If Intel CET-based security-enhanced PLT is enabled (i.e. -z ibtplt is
  given), mold used to create a PLT section in which each entry is 32 bytes
  long. We optimized the machine code sequence of the CET-enabled PLT
  section, so each PLT entry now occupies only 16 bytes, reducing the size
  of .plt by almost half. (480efde)

Bug fixes and compatibility improvements:

- -static-pie now works with recent versions of glibc. Previously,
  statically-linked position-independent executable would crash on startup
  when linked with mold. (3999aa8)
- Previously, mold sometimes created corrupted output file on x86-64 if
  an input file containing thread-local variables were compiled with
  -mcmodel=large (#360). This issue has been fixed. (4aa4bfa)
- Previously, mold created corrupted debug info section on i386 if an
  input debug section is also compressed using the compiler -gz option.
  (#361) This issue has been fixed. (3068364)
- mold used to create multiple .init_array sections if input files contain
  both writable and non-writable .int_array sections. That caused an issue
  that some initializer functions would not be executed on process startup.
  (#363). This issue has been fixed. (4198627)
- When building a large program with GCC LTO, mold occasionally failed
  with "too many open files" error. This issue has been resolved. (e67f460)
- Previously, mold created a corrupted dynamic relocation table if .got.plt
  is missing. This issue has been fixed by always creating
  _GLOBAL_OFFSET_TABLE_ symbol in .got on any target. mold used to try to
  create the symbol in .got.plt on x86-64 or i386. (eb79859)