[all-commits] [llvm/llvm-project] 9ee97c: [libc++] Use ABI tags instead of internal linkage ...

Louis Dionne via All-commits all-commits at lists.llvm.org
Wed Jul 6 12:30:49 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ee97ce3b8305c5762ec34eecb4daf379984c95b
      https://github.com/llvm/llvm-project/commit/9ee97ce3b8305c5762ec34eecb4daf379984c95b
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2022-07-06 (Wed, 06 Jul 2022)

  Changed paths:
    M libcxx/CMakeLists.txt
    M libcxx/cmake/caches/Apple.cmake
    M libcxx/docs/BuildingLibcxx.rst
    M libcxx/docs/DesignDocs/VisibilityMacros.rst
    M libcxx/docs/ReleaseNotes.rst
    M libcxx/include/__config
    M libcxx/include/__config_site.in
    R libcxx/test/libcxx/strings/basic.string/PR42676.sh.cpp

  Log Message:
  -----------
  [libc++] Use ABI tags instead of internal linkage to provide per-TU insulation

Instead of marking private symbols with internal_linkage (which leads to
one copy per translation unit -- rather wasteful), use an ABI tag that
gets rev'd with each libc++ version. That way, we know that we can't have
name collisions between implementation-detail functions across libc++
versions, so we'll never violate the ODR. However, within a single program,
each symbol still has a proper name with external linkage, which means
that the linker is free to deduplicate symbols even across TUs.

This actually means that we can guarantee that versions of libc++ can
be mixed within the same program without ever having to take a code size
hit, and without having to manually opt-in -- it should just work out of
the box.

Differential Revision: https://reviews.llvm.org/D127444




More information about the All-commits mailing list