[all-commits] [llvm/llvm-project] 014d5d: [lldb] Change most tests to build with system libc...

Alex Langford via All-commits all-commits at lists.llvm.org
Mon Apr 6 15:42:44 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 014d5d51e11ba6e84e16bb97a897fa568a971341
      https://github.com/llvm/llvm-project/commit/014d5d51e11ba6e84e16bb97a897fa568a971341
  Author: Alex Langford <alangford at apple.com>
  Date:   2026-04-06 (Mon, 06 Apr 2026)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/make/Makefile.rules

  Log Message:
  -----------
  [lldb] Change most tests to build with system libc++ on Darwin (#190034)

Today, on Darwin platforms, almost every test binary in our test suite
loads two copies of libc++, libc++abi, and libunwind. This is because
each of the test binaries explicitly link against a just-built libc++
(which is explicitly required on Darwin right now) but we don't take the
correct steps to replace the system libc++. Doing so is unnecessary and
potentially error-prone, so most tests should link against the system
libc++ where possible.

Background:
The lldb test suite has a collection of tests that rely on libc++
explicitly. The two biggest categories are data formatter tests (which
make sure that we can correctly display values for std types) and
import-std-module tests (which test that we can import the libc++ std
module). To make sure these tests are run, we require a just-built
libc++ to be used.

All of the test binaries link against the just-built libc++, so it gets
loaded. However, when any system library tries to load libc++, it
attempts to load the system one. dyld checks loaded libraries against
the request to load a new one using the full path, meaning anyone
linking against `/usr/lib/libc++.1.dylib` will get it no matter what
other libc++ dylib is already loaded.

The proper way to handle this is using `DYLD_LIBRARY_PATH`, which
switches dyld to checking the leaf name of a dylib instead of the full
path. In theory this works, but we run into an issue where the system
libc++ has additional symbols and many system libraries fail to load.
Louis Dionne added stubs in libc++abi for these missing symbols, meaning
it would be possible to make this scenario work. This may be useful for
the existing libc++ tests.



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