Feature Request: Native support for mold linker

Description: Summary Requesting native support or a dedicated switch (e.g., -fuse-mold) to utilize the mold linker, similar to how GCC and Clang allow -fuse-ld=mold.

Context & Motivation The mold linker is a modern drop-in replacement for GNU ld and gold that offers significantly faster linking speeds (often 3x-10x faster on large projects). For large Lazarus/FPC projects, the linking stage is currently a major bottleneck in the "Code -> Compile -> Test" loop.

Current Workaround Currently, users must manually override the linker path using the -FD switch (e.g., fpc -FD/usr/bin/mold ...). While this works because mold accepts standard ld arguments, it requires absolute paths and manual configuration per project/environment.

Proposed Solution

  1. Dedicated Switch: Introduce a switch (e.g., -use-mold or extend -k options) that instructs the compiler to look for mold in the standard path without requiring absolute paths.
  2. Detection: If possible, allow FPC to detect if mold is available and prioritized, or provide a cleaner configuration option in fpc.cfg.

Benefits

  • Performance: Drastically reduces link times for large binaries (Lazarus IDE, games, large server apps).
  • Modernization: Aligns FPC with modern C++ toolchains (Rust, Clang) that are adopting mold for improved developer experience.

Environment

  • OS: Linux / Unix-like systems (primary target for mold).
  • Architecture: x86_64 (primary), AArch64.