[all-commits] [llvm/llvm-project] 0ec3a6: [runtimes] Avoid duplicate static archive when sha...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Jun 22 09:18:00 PDT 2026


  Branch: refs/heads/users/arsenm/runtimes-avoid-duplicate-static-archive-unsupported-shared-libs
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ec3a61e79115e885329453718481ed0ad3805e5
      https://github.com/llvm/llvm-project/commit/0ec3a61e79115e885329453718481ed0ad3805e5
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-06-22 (Mon, 22 Jun 2026)

  Changed paths:
    M libcxx/CMakeLists.txt
    M libcxxabi/CMakeLists.txt
    M libunwind/CMakeLists.txt

  Log Message:
  -----------
  [runtimes] Avoid duplicate static archive when shared libs are unsupported

After #203504, runtime sub-builds for GPU/baremetal targets are configured
with CMAKE_SYSTEM_NAME=Generic rather than inheriting the host's system
name. CMake's Platform/Generic.cmake sets the global
TARGET_SUPPORTS_SHARED_LIBS property to FALSE, which causes CMake to
silently turn SHARED library targets into STATIC ones.

libcxx, libcxxabi and libunwind always define their shared library target
(gated by EXCLUDE_FROM_ALL) even when *_ENABLE_SHARED is off, and the shared
and static targets share the same OUTPUT_NAME. With the shared target demoted
to a static archive, both targets generate e.g. "libc++abi.a", which Ninja
rejects:

  ninja: error: build.ninja:147837: multiple rules generate
  lib/amdgcn-amd-amdhsa/libc++abi.a [-w dupbuild=err]

Default the shared library output name to a distinct "-shared" name when the
platform does not support shared libraries, mirroring the existing workaround
in libcxx/cmake/caches/Armv7M-picolibc.cmake. This makes the GPU and other
Generic-targeted runtimes builds configure again.

See https://gitlab.kitware.com/cmake/cmake/-/issues/25759.

This was generated by AI. This is the quick fix, I have a more
comprehensive patch pending.

Co-Authored-By: Claude <noreply at anthropic.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list