]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
build: add Mold linker compatibility
authorRonen Friedman <rfriedma@redhat.com>
Sun, 28 Jun 2026 14:42:07 +0000 (14:42 +0000)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 28 Jun 2026 14:53:54 +0000 (14:53 +0000)
commite55244161992640e2e4a487b1cbaa702f2cebf43
treea3b7bb9b63b39f9f821a7b51ed969f680ba6ed13
parent16052666146c8ebb671b2740c226db4d6d1ea03f
build: add Mold linker compatibility

Mold handles several linker features differently from ld.bfd:

- --exclude-libs,ALL hides .symver-aliased symbols (e.g. rados_*)
  even when the version script lists them as global. Detect Mold
  (via USING_MOLD_LINKER) and disable --exclude-libs; version
  scripts already control symbol visibility.

- Duplicate symbols across static archives are treated as errors.
  Merge crimson-alien-common into crimson-alienstore as a single
  archive. For crimson-osd, link crimson-alienstore before
  crimson-common with --allow-multiple-definition so the alien
  thread's non-crimson definitions win (Mold picks first definition).

- Python/Cython extension builds (via Distutils.cmake) invoked the
  system default linker. Pass -fuse-ld= via MOLD_FUSE_LD_FLAG so
  extensions link with the configured linker.

- Add rados_* and _rados_* to librados.map global section for Mold
  compatibility with .symver aliases.

Co-authored-by: Mark Kogan <mkogan@redhat.com>
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
cmake/modules/CephChecks.cmake
cmake/modules/Distutils.cmake
src/crimson/os/alienstore/CMakeLists.txt
src/crimson/osd/CMakeLists.txt
src/librados/librados.map