)]}'
{
  "commit": "e3826891272d239bb2836bf6a2167b44d057d8be",
  "tree": "fe047d5924e808be1bf032ad69612fd3d54214bd",
  "parents": [
    "cbf8258f6313a27de45955870306bc64354401e5"
  ],
  "author": {
    "name": "Ryan VanderMeulen",
    "email": "ryanvm@gmail.com",
    "time": "Wed Sep 02 11:45:15 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Wed Sep 02 11:46:08 2026 -0700"
  },
  "message": "PR #2136: Give externally-provided symbol declarations default visibility\n\nImported from GitHub PR https://github.com/abseil/abseil-cpp/pull/2136\n\nAbseil forward-declares a few symbols that are provided by something *outside* the object being linked:\n\n| Symbol(s) | File | Provided by |\n|---|---|---|\n| 14x `Annotate*` race annotations | `absl/base/dynamic_annotations.h` | sanitizer runtime |\n| `__tsan_read1` | `absl/synchronization/mutex.cc` | sanitizer runtime |\n| `__mmap2` | `absl/base/internal/direct_mmap.h` | Bionic |\n\nNone of these has a public header to include — none of the `Annotate*` functions nor `__tsan_read1` appears in any compiler-rt `sanitizer/*.h`, and `__mmap2` is a private Bionic symbol — so declaring them locally is the only option. But a local declaration inherits whatever visibility is in effect at that point.\n\nWhen the translation unit is compiled with `-fvisibility\u003dhidden` and abseil is linked into a shared library, those references become *hidden* undefined symbols. They then cannot be resolved from the sanitizer runtime (which lives in the executable) or from libc, and the link fails:\n\n```\nld.lld: error: undefined hidden symbol: AnnotateIgnoreReadsBegin\nld.lld: error: undefined hidden symbol: AnnotateIgnoreWritesBegin\nld.lld: error: undefined hidden symbol: AnnotateIgnoreWritesEnd\nld.lld: error: undefined hidden symbol: AnnotateIgnoreReadsEnd\nld.lld: error: undefined hidden symbol: __tsan_read1\nld.lld: error: undefined hidden symbol: __mmap2\n```\n\nThis wraps each declaration in `#pragma GCC visibility push(default)` / `pop`.\n\n### Verification\n\nCompiling all ~163 abseil sources with `-fsanitize\u003dthread` and a tree-wide `#pragma GCC visibility push(hidden)`, then scanning every object for hidden undefined symbols: before this change the four `Annotate*` and `__tsan_read1` are `GLOBAL HIDDEN UND`; after, every `__tsan_*` and `Annotate*` reference is `GLOBAL DEFAULT UND`. The only hidden undefined symbols remaining are `AbslInternal*` ones that abseil defines itself, which is correct.\n\nFor `__mmap2`, on a 32-bit Android shared-library link:\n\n```\nwithout the pragma:  ld.lld: error: undefined hidden symbol: __mmap2\nwith the pragma:     4: FUNC GLOBAL DEFAULT UND __mmap2@LIBC\n```\n\n### Notes\n\n- Every affected site is already inside a Bionic or sanitizer guard, so the GCC/Clang-only pragma does not reduce portability.\n- The `__mmap2` path only compiles on 32-bit architectures, which is why this is rarely hit — Chromium\u0027s Android builds are 64-bit. We hit it on 32-bit ARM.\n- Found while updating the copy of abseil vendored into Firefox, which builds with `-fvisibility\u003dhidden` tree-wide.\nMerge ab78d3a7f471fdaa44f6b7bc5feece81cd1d2833 into e1cacc79e6a318108eded02261219ceabff38ce0\n\nMerging this change closes #2136\n\nPiperOrigin-RevId: 975244998\nChange-Id: I1be645e8658b7a323fdcc34f081d3466cd9eb6ed\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f18b5e0a8fa9d832ff378fd5129ee127fa76e0e1",
      "old_mode": 33188,
      "old_path": "absl/base/dynamic_annotations.h",
      "new_id": "1e679a6b1398b4e9b36101f20172c0a0e92fdeb3",
      "new_mode": 33188,
      "new_path": "absl/base/dynamic_annotations.h"
    },
    {
      "type": "modify",
      "old_id": "f56ba2398738444a8556cfa8b9b133298d0c702c",
      "old_mode": 33188,
      "old_path": "absl/base/internal/direct_mmap.h",
      "new_id": "855f51ed96d8ea26f89d2a9ec4c4fbc9ce48f93e",
      "new_mode": 33188,
      "new_path": "absl/base/internal/direct_mmap.h"
    },
    {
      "type": "modify",
      "old_id": "be0d91a50f80fb614db208208cf00249263e6f4f",
      "old_mode": 33188,
      "old_path": "absl/synchronization/mutex.cc",
      "new_id": "d6e2aace10c7f0cb7fffad116bc9ade8a72f5544",
      "new_mode": 33188,
      "new_path": "absl/synchronization/mutex.cc"
    }
  ]
}
