{
 "number": 35197,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/35197",
 "title": "guix: add -Wl,--icf=safe to darwin build",
 "author": "fanquake",
 "author_association": "MEMBER",
 "created_at": "2026-05-03T09:38:51Z",
 "updated_at": "2026-08-10T10:16:53Z",
 "age_days": 137,
 "draft": false,
 "labels": [
  "Build system"
 ],
 "milestone": null,
 "base": "master",
 "head_sha": "24ad7419dea40e647b10791105a0659df143e014",
 "head_ref": "lld_icf_safe",
 "head_repo": "fanquake/bitcoin",
 "head_history": [
  {
   "t": "2026-05-04T21:22:08Z",
   "sha": "19818a14943523643885636d809376e625da42b7"
  },
  {
   "t": "2026-05-06T10:09:57Z",
   "sha": "5c6c4260948c1830959c6353ecdad667a5c6765a"
  },
  {
   "t": "2026-05-08T10:32:06Z",
   "sha": "09de5363d3601ef3e612c8f6920f41678fc8aaa2"
  },
  {
   "t": "2026-05-11T10:29:44Z",
   "sha": "aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc"
  },
  {
   "t": "2026-05-27T13:48:51Z",
   "sha": "ec9a205c3c2d0e0e8d98d87b253b2f69f5ad7309"
  },
  {
   "t": "2026-06-11T08:28:17Z",
   "sha": "9c54372108ea38fb77e57f5d4ce3f4efb33e7510"
  },
  {
   "t": "2026-06-15T12:35:15Z",
   "sha": "d2a92323f7defc32119bbaff9c769ae4cd17a6c0"
  },
  {
   "t": "2026-07-03T11:43:54Z",
   "sha": "48cd8fa16dad1e8fe9434c0bef48a84e635e2ae9"
  },
  {
   "t": "2026-07-10T10:33:25Z",
   "sha": "24ad7419dea40e647b10791105a0659df143e014"
  }
 ],
 "additions": 5,
 "deletions": 0,
 "changed_files": 1,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "blocked",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "concept_ack": [
     {
      "login": "hebasto",
      "url": "https://github.com/bitcoin/bitcoin/pull/35197#pullrequestreview-4781720529"
     },
     {
      "login": "151henry151",
      "url": "https://github.com/bitcoin/bitcoin/pull/35197#issuecomment-5136916557"
     }
    ],
    "stale_ack": [
     {
      "login": "davidgumberg",
      "url": "https://github.com/bitcoin/bitcoin/pull/35197#issuecomment-4446990079"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "davidgumberg": {
   "kind": "ack",
   "hash": null,
   "t": "2026-05-14T02:45:21Z",
   "stale": true
  },
  "hebasto": {
   "kind": "concept_ack",
   "hash": null,
   "t": "2026-07-26T12:23:17Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 0,
  "stale_ack": 1,
  "concept_ack": 1,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "0xB10C",
   "151henry151",
   "Sjors",
   "davidgumberg",
   "hebasto",
   "sedited",
   "theuni"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "blocked",
  "last_author_activity": "2026-08-10T10:16:53Z",
  "last_reviewer_activity": "2026-07-30T22:28:12Z",
  "last_reviewer": "151henry151",
  "author_silent_days": 38,
  "waiting_on_author_days": 0,
  "days_since_update": 38
 },
 "refs": {
  "mentioned": [],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "CMakeLists.txt"
 ],
 "body": "[quoted text omitted]\n\nThis reduces the size of bitcoind by ~`0.5mb`, and bitcoin-qt by `1.3mb` (`aarch64-apple-darwin`).\n\nThis option exists for lld, which is why it's only added for darwin builds.",
 "commits": [
  {
   "sha": "24ad7419dea40e647b10791105a0659df143e014",
   "date": "2026-07-10T09:44:51Z",
   "message": "build: add -Wl,--icf=safe(thunks)\n\n[quoted text omitted]\nThis reduces the size of (release) bitcoind by ~0.5mb, and bitcoin-qt\nby 1.3mb (aarch64-apple-darwin)."
  }
 ],
 "timeline": [
  {
   "t": "2026-05-04T21:22:08Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "19818a14943523643885636d809376e625da42b7"
  },
  {
   "t": "2026-05-06T10:09:57Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "5c6c4260948c1830959c6353ecdad667a5c6765a"
  },
  {
   "t": "2026-05-08T10:32:06Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "09de5363d3601ef3e612c8f6920f41678fc8aaa2"
  },
  {
   "t": "2026-05-11T10:29:44Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc"
  },
  {
   "t": "2026-05-14T02:45:21Z",
   "kind": "comment",
   "who": "davidgumberg",
   "assoc": "CONTRIBUTOR",
   "text": "ACK https://github.com/bitcoin/bitcoin/commit/aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc\n\nSeems reasonable to me, the only harm is this will introduce ambiguity in some cases when debugging/profiling release binaries[^1], but that seems fine to me, and it's a nice win in binary sizes, might be worth highlighting with a release note.\n\nAll sizes in bytes:\n\n### arm64\n| Binary         | Parent (aa3bbe2ea218^) | Branch (aa3bbe2ea218) | Size reduced | % of original size reduced |\n|----------------|------------------------|-----------------------|--------------|----------------------------|\n| bitcoin        | 209512                 | 193040                | 16472        | -7.86%                     |\n| bitcoin-cli    | 3167072                | 2540328               | 626744       | -19.79%                    |\n| bitcoind       | 12551448               | 11940744              | 610704       | -4.87%                     |\n| bitcoin-qt     | 32420944               | 31097424              | 1323520      | -4.08%                     |\n| bitcoin-tx     | 2393064                | 2327088               | 65976        | -2.76%                     |\n| bitcoin-util   | 372088                 | 355576                | 16512        | -4.44%                     |\n| bitcoin-wallet | 4163212                | 4014652               | 148560       | -3.57%                     |\n| Total          | 55277340               | 52468852              | 2808488      | -5.08%                     |\n\n### x86_64\n| Binary         | Parent (aa3bbe2ea218^) | Branch (aa3bbe2ea218) | Size reduced | % of original size reduced |\n|----------------|------------------------|-----------------------|--------------|----------------------------|\n| bitcoin        | 177056                 | 164688                | 12368        | -6.99%                     |\n| bitcoin-cli    | 3273828                | 2688284               | 585544       | -17.89%                    |\n| bitcoind       | 13704300               | 13204764              | 499536       | -3.65%                     |\n| bitcoin-qt     | 35216384               | 34037176              | 1179208      | -3.35%                     |\n| bitcoin-tx     | 2663816                | 2606144               | 57672        | -2.17%                     |\n| bitcoin-util   | 478888                 | 458296                | 20592        | -4.30%                     |\n| bitcoin-wallet | 4528568                | 4408920               | 119648       | -2.64%                     |\n| Total          | 60042840               | 57568272              | 2474568      | -4.12%                     |\n\n### Guix hashes\n\nThis branch:\n\n```console\n$ git checkout --detach aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc\nHEAD is now at aa3bbe2ea2 guix: add -Wl,--icf=safe to darwin build\n$ ./contrib/guix/guix-build\n$ source contrib/shell/git-utils.bash && uname -m && find guix-build-$(git_head_version)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum\n```\n```\nx86_64\n55d2df2755f4533cb38d8cb13a02d5d3ff9f07416fb97597fc81679f610159ba  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/SHA256SUMS.part\n8d8861c3ffb2f841e4a6cd4c018d0f656f025fbc976be266f7532302bba26e36  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu-debug.tar.gz\nfe2cd08a58db5da330e70eca9bd2a29f6922686f7cab9c36599a683da81a3c47  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu.tar.gz\n89534395b221b0be8d076a34e147285b30636fe2fe4685df0c2ac5dd6244c8ae  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/SHA256SUMS.part\n9fa95a8d0990d270965dde7ab6e4465221ef1693ee60a6c6ba3b02fe3602e058  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf-debug.tar.gz\n0a58a126e4fc1150d76ec4ca9cd1fe864ccdaec1536055adb977c221801f2ef0  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf.tar.gz\n5a5bb6f80eb68eff565767d039d523555e715c620705c3329d4e240073a84799  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/SHA256SUMS.part\n753b9cccd5a4c20f4da34183533a385c52454facf4cb30c11956c1c8df4023eb  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-codesigning.tar.gz\n12b397bb76d18d5bd9cd21d91c78d64c58dc32b20823953f5f6909e40f26ef5b  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.tar.gz\n072d890fe500e86d59441778e8d1cc2b4a5a3bb5e1fa1fcaba443f713a2e3bb2  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.zip\n16c8ec7d7f16dfa24c1dd2b1f72d02207be3769e8b7ae57e31fd3285a22bf9d0  guix-build-aa3bbe2ea218/output/dist-archive/bitcoin-aa3bbe2ea218.tar.gz\na321e30a01ee92115eccd85e2dfc04a0853939a7396854e93d530f9bc7dd5feb  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/SHA256SUMS.part\nfcc07d881190898c1b5ec62d128ea1c920ab5b93141b27f5cbc4bbffdb955ae2  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu-debug.tar.gz\nd294b23f21efcb42b80cca6517a8ade2f551ff91cba9a1087551ebafefc5b579  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu.tar.gz\n7d767fd902ce82b913c232079125fb39e50a7fd3ea8716de53cd5e43f9097135  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/SHA256SUMS.part\nd6d9e2f7857e6ee07a3de4eb62f389210ec675a96f79da32870f49d4426a5800  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu-debug.tar.gz\n645437534011d3379e78ea2e725eb981c9239a54b2074c4dc475d666673e61fc  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu.tar.gz\n96bcf9374a0bac414c93ee7b10562dafee4b1ab8e6e26c70455de9ab895d4699  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/SHA256SUMS.part\na9b28e8b47c4a4763d884b35bda7d762baea62012b8a84d140052de1419fec9f  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-codesigning.tar.gz\n99a3c91cfb265ee54b92994a756f02da3a17c470b78ea449283b7ae331d80e0d  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.tar.gz\nb6378480d9340b3ea7359fd36a1e5d2596bd61b4f55af2c35bb66946aa8b9ea5  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.zip\n87d286a7d7a1a9d3314bdb119459c0929f8bd07a0b1057f142ef56de0ff03173  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/SHA256SUMS.part\n6bfec675c208926dc3a724b14a6243a04775973f756c28c0e6381e98b31c990b  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu-debug.tar.gz\n0deba9d8d6f822a46e0402bd4dd45ca1aaec3b2beda968078e9f80c8f1ed9fb5  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu.tar.gz\n501de61ed069dc2cb870f6b24233add5cf615b590163a3147557d89f9a8f2c98  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/SHA256SUMS.part\n64613dafb19a609574f3c2357aa5f7f8c6e596052a28d5b75fd1cb99229a82b2  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-codesigning.tar.gz\nb21b5f257847361ea46236eadc46f2fba5203ce3ce9404bcaa8b0784cdd6395d  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-debug.zip\n85f42938bc43eae94561b8b0ad929256b10015883538abc0a4c72568d38dbda0  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-setup-unsigned.exe\nd1cc3f18e7fbd064e593b8a15548bee9dc23a5d2e00ad1eaf7629f3780988497  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-unsigned.zip\n```\n\nParent of this branch:\n\n```console\n$ git checkout --detach aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc^\nPrevious HEAD position was aa3bbe2ea2 guix: add -Wl,--icf=safe to darwin build\nHEAD is now at ccbd00ab87 Merge bitcoin/bitcoin#35152: doc: clarify local IWYU workflow and pragmas\nx86_64\n$ ./contrib/guix/guix-build\n$ source contrib/shell/git-utils.bash && uname -m && find guix-build-$(git_head_version)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum\n```\n```\nx86_64\n6f01954a6da43e5030fb657bef9205e4a2e0b8570118057d1ef462945667c1ff  guix-build-ccbd00ab87c0/output/aarch64-linux-gnu/SHA256SUMS.part\nc1f705dbfa1a7a0448520e4b33beed49c3d7bc5c8aa0260fb3d1ea0e9fa6b738  guix-build-ccbd00ab87c0/output/aarch64-linux-gnu/bitcoin-ccbd00ab87c0-aarch64-linux-gnu-debug.tar.gz\n86f8807beb480ad9e498e8f3f188da2691043f57eacc13b938d820bc2104a4f5  guix-build-ccbd00ab87c0/output/aarch64-linux-gnu/bitcoin-ccbd00ab87c0-aarch64-linux-gnu.tar.gz\ne593543795635ad4abe6457cf4a644f64513bdf2353b86c91bfb42700ea645ab  guix-build-ccbd00ab87c0/output/arm-linux-gnueabihf/SHA256SUMS.part\nc9490fbd2d3257e3ac5e68952a1b285c41215e8cc9854bd5fe109a179f660fc6  guix-build-ccbd00ab87c0/output/arm-linux-gnueabihf/bitcoin-ccbd00ab87c0-arm-linux-gnueabihf-debug.tar.gz\n33c048240c8e39e997c99f5f1ad65ffadcfa87a27efa4d8cc31480c52df0a31e  guix-build-ccbd00ab87c0/output/arm-linux-gnueabihf/bitcoin-ccbd00ab87c0-arm-linux-gnueabihf.tar.gz\n836c5266792a1af4bbbd41cbd64e6e39cbb5ae07f24bddc4361aec865e93edf0  guix-build-ccbd00ab87c0/output/arm64-apple-darwin/SHA256SUMS.part\n35037e8539e06b0295a500738972adfd51ce19714735c27a60f9e9152a117458  guix-build-ccbd00ab87c0/output/arm64-apple-darwin/bitcoin-ccbd00ab87c0-arm64-apple-darwin-codesigning.tar.gz\nf0e207e846478dbac5369c446968a845095d0a446279d12fc0ee12b1c122bc92  guix-build-ccbd00ab87c0/output/arm64-apple-darwin/bitcoin-ccbd00ab87c0-arm64-apple-darwin-unsigned.tar.gz\n6a1c2a10d64be5e8ebafb95ab4bd6fd660ff799e179f1bf4580fa5ac12235382  guix-build-ccbd00ab87c0/output/arm64-apple-darwin/bitcoin-ccbd00ab87c0-arm64-apple-darwin-unsigned.zip\n6970241efc463e6d6c381552d0441371ccacf8ce2ff33d8e02d45d8cc8c06bdb  guix-build-ccbd00ab87c0/output/dist-archive/bitcoin-ccbd00ab87c0.tar.gz\n566ea369d7bce1181312dfb59786e18eaa71b926d90eea4dd71fbdf39f515954  guix-build-ccbd00ab87c0/output/powerpc64-linux-gnu/SHA256SUMS.part\nf5abb3102db6f4b3190401fa53ebe9d7ce5ee7cc77d287f2c2427361255d4f2d  guix-build-ccbd00ab87c0/output/powerpc64-linux-gnu/bitcoin-ccbd00ab87c0-powerpc64-linux-gnu-debug.tar.gz\n083e483c8acacf5917c562482c1542ade311694a0d55242ac741362e47efc3c2  guix-build-ccbd00ab87c0/output/powerpc64-linux-gnu/bitcoin-ccbd00ab87c0-powerpc64-linux-gnu.tar.gz\nf60d0fcab94d8a31bf3425b826ce846288c3dd67bc00cd9786ee4422c8e325f0  guix-build-ccbd00ab87c0/output/riscv64-linux-gnu/SHA256SUMS.part\n81dc5307effbbc1bae53a716c479fee4ad17e7509a1104c6f600007409c41f58  guix-build-ccbd00ab87c0/output/riscv64-linux-gnu/bitcoin-ccbd00ab87c0-riscv64-linux-gnu-debug.tar.gz\n418bbed5862d9580ab883c4680de72b3baff174698e2ddd70401137d47a73286  guix-build-ccbd00ab87c0/output/riscv64-linux-gnu/bitcoin-ccbd00ab87c0-riscv64-linux-gnu.tar.gz\n3d7d4ef5f6e5249a7dca655d876fda778a5db8da93db2151841c2110f93fbfb1  guix-build-ccbd00ab87c0/output/x86_64-apple-darwin/SHA256SUMS.part\n7b6fafd0fff00dde6c20472d303af8e855186ee800733d137e1d10cd26fca320  guix-build-ccbd00ab87c0/output/x86_64-apple-darwin/bitcoin-ccbd00ab87c0-x86_64-apple-darwin-codesigning.tar.gz\n3833fcb1f92a47a4dc8aca6d78d2e7bdb6a397add6cb2a915261337e096b3e9a  guix-build-ccbd00ab87c0/output/x86_64-apple-darwin/bitcoin-ccbd00ab87c0-x86_64-apple-darwin-unsigned.tar.gz\ndd5387f86e2ef96bbd4fd7df123e1db1c682a86de2c74df6b4db576608f0d920  guix-build-ccbd00ab87c0/output/x86_64-apple-darwin/bitcoin-ccbd00ab87c0-x86_64-apple-darwin-unsigned.zip\n230942ba6fcf51284ea0c3a2938c99941468889608deac3dc244bf5ee66109d4  guix-build-ccbd00ab87c0/output/x86_64-linux-gnu/SHA256SUMS.part\ne742b6cf36cc3b67fcc21ad81595a9af5d92bff9b42422ee1a25fc687300360f  guix-build-ccbd00ab87c0/output/x86_64-linux-gnu/bitcoin-ccbd00ab87c0-x86_64-linux-gnu-debug.tar.gz\n3d464ea0075b1a4f6f636142bae079913c350e38554d37dab2c27674ba3db40f  guix-build-ccbd00ab87c0/output/x86_64-linux-gnu/bitcoin-ccbd00ab87c0-x86_64-linux-gnu.tar.gz\n6abf1ed4ac46caaeb195bb138bc2464cdfb75dc87a71dc4bb71cb8ce6139cf67  guix-build-ccbd00ab87c0/output/x86_64-w64-mingw32/SHA256SUMS.part\nf6c5969dc830a5916b5a166096d9374f787534da7c1026d6060032effc5df9c3  guix-build-ccbd00ab87c0/output/x86_64-w64-mingw32/bitcoin-ccbd00ab87c0-win64-codesigning.tar.gz\neebc0a0a58585056fba7b3d1aee3fed231ba2de7acc191a88867b2f5643e8de9  guix-build-ccbd00ab87c0/output/x86_64-w64-mingw32/bitcoin-ccbd00ab87c0-win64-debug.zip\na9c0578c04efb43dca5b8206649e8d25ed7ea3da5386890df1d1563acdf1105f  guix-build-ccbd00ab87c0/output/x86_64-w64-mingw32/bitcoin-ccbd00ab87c0-win64-setup-unsigned.exe\nc3f147cb64e7c5be56749ff764620b00356180ed372ca4f696619fcf4be99ce6  guix-build-ccbd00ab87c0/output/x86_64-w64-mingw32/bitcoin-ccbd00ab87c0-win64-unsigned.zip\n```\n\n[^1]: From the Safe ICF paper (https://static.googleusercontent.com/media/research.google.com/en/us/pubs/archive/36912.pdf) :\n        \"profiling and debugging binaries with merged functions can be confusing, as the PC values of merged functions cannot be always disambiguated to point to the correct function.\" The paper proposes a mitigation but my (limited) understanding is that this is not implemented anywhere."
  },
  {
   "t": "2026-05-14T08:04:08Z",
   "kind": "comment",
   "who": "sedited",
   "assoc": "CONTRIBUTOR",
   "text": "Guix build (aarch64):\n\n```\n55d2df2755f4533cb38d8cb13a02d5d3ff9f07416fb97597fc81679f610159ba  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/SHA256SUMS.part\n8d8861c3ffb2f841e4a6cd4c018d0f656f025fbc976be266f7532302bba26e36  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu-debug.tar.gz\nfe2cd08a58db5da330e70eca9bd2a29f6922686f7cab9c36599a683da81a3c47  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu.tar.gz\n89534395b221b0be8d076a34e147285b30636fe2fe4685df0c2ac5dd6244c8ae  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/SHA256SUMS.part\n9fa95a8d0990d270965dde7ab6e4465221ef1693ee60a6c6ba3b02fe3602e058  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf-debug.tar.gz\n0a58a126e4fc1150d76ec4ca9cd1fe864ccdaec1536055adb977c221801f2ef0  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf.tar.gz\n5a5bb6f80eb68eff565767d039d523555e715c620705c3329d4e240073a84799  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/SHA256SUMS.part\n753b9cccd5a4c20f4da34183533a385c52454facf4cb30c11956c1c8df4023eb  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-codesigning.tar.gz\n12b397bb76d18d5bd9cd21d91c78d64c58dc32b20823953f5f6909e40f26ef5b  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.tar.gz\n072d890fe500e86d59441778e8d1cc2b4a5a3bb5e1fa1fcaba443f713a2e3bb2  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.zip\n16c8ec7d7f16dfa24c1dd2b1f72d02207be3769e8b7ae57e31fd3285a22bf9d0  guix-build-aa3bbe2ea218/output/dist-archive/bitcoin-aa3bbe2ea218.tar.gz\na321e30a01ee92115eccd85e2dfc04a0853939a7396854e93d530f9bc7dd5feb  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/SHA256SUMS.part\nfcc07d881190898c1b5ec62d128ea1c920ab5b93141b27f5cbc4bbffdb955ae2  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu-debug.tar.gz\nd294b23f21efcb42b80cca6517a8ade2f551ff91cba9a1087551ebafefc5b579  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu.tar.gz\n7d767fd902ce82b913c232079125fb39e50a7fd3ea8716de53cd5e43f9097135  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/SHA256SUMS.part\nd6d9e2f7857e6ee07a3de4eb62f389210ec675a96f79da32870f49d4426a5800  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu-debug.tar.gz\n645437534011d3379e78ea2e725eb981c9239a54b2074c4dc475d666673e61fc  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu.tar.gz\n96bcf9374a0bac414c93ee7b10562dafee4b1ab8e6e26c70455de9ab895d4699  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/SHA256SUMS.part\na9b28e8b47c4a4763d884b35bda7d762baea62012b8a84d140052de1419fec9f  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-codesigning.tar.gz\n99a3c91cfb265ee54b92994a756f02da3a17c470b78ea449283b7ae331d80e0d  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.tar.gz\nb6378480d9340b3ea7359fd36a1e5d2596bd61b4f55af2c35bb66946aa8b9ea5  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.zip\n87d286a7d7a1a9d3314bdb119459c0929f8bd07a0b1057f142ef56de0ff03173  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/SHA256SUMS.part\n6bfec675c208926dc3a724b14a6243a04775973f756c28c0e6381e98b31c990b  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu-debug.tar.gz\n0deba9d8d6f822a46e0402bd4dd45ca1aaec3b2beda968078e9f80c8f1ed9fb5  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu.tar.gz\n501de61ed069dc2cb870f6b24233add5cf615b590163a3147557d89f9a8f2c98  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/SHA256SUMS.part\n64613dafb19a609574f3c2357aa5f7f8c6e596052a28d5b75fd1cb99229a82b2  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-codesigning.tar.gz\nb21b5f257847361ea46236eadc46f2fba5203ce3ce9404bcaa8b0784cdd6395d  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-debug.zip\n85f42938bc43eae94561b8b0ad929256b10015883538abc0a4c72568d38dbda0  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-setup-unsigned.exe\nd1cc3f18e7fbd064e593b8a15548bee9dc23a5d2e00ad1eaf7629f3780988497  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-unsigned.zip\n```"
  },
  {
   "t": "2026-05-14T11:19:31Z",
   "kind": "comment",
   "who": "0xB10C",
   "assoc": "CONTRIBUTOR",
   "text": "```\nx86_64\n55d2df2755f4533cb38d8cb13a02d5d3ff9f07416fb97597fc81679f610159ba  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/SHA256SUMS.part\n8d8861c3ffb2f841e4a6cd4c018d0f656f025fbc976be266f7532302bba26e36  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu-debug.tar.gz\nfe2cd08a58db5da330e70eca9bd2a29f6922686f7cab9c36599a683da81a3c47  guix-build-aa3bbe2ea218/output/aarch64-linux-gnu/bitcoin-aa3bbe2ea218-aarch64-linux-gnu.tar.gz\n89534395b221b0be8d076a34e147285b30636fe2fe4685df0c2ac5dd6244c8ae  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/SHA256SUMS.part\n9fa95a8d0990d270965dde7ab6e4465221ef1693ee60a6c6ba3b02fe3602e058  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf-debug.tar.gz\n0a58a126e4fc1150d76ec4ca9cd1fe864ccdaec1536055adb977c221801f2ef0  guix-build-aa3bbe2ea218/output/arm-linux-gnueabihf/bitcoin-aa3bbe2ea218-arm-linux-gnueabihf.tar.gz\n5a5bb6f80eb68eff565767d039d523555e715c620705c3329d4e240073a84799  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/SHA256SUMS.part\n753b9cccd5a4c20f4da34183533a385c52454facf4cb30c11956c1c8df4023eb  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-codesigning.tar.gz\n12b397bb76d18d5bd9cd21d91c78d64c58dc32b20823953f5f6909e40f26ef5b  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.tar.gz\n072d890fe500e86d59441778e8d1cc2b4a5a3bb5e1fa1fcaba443f713a2e3bb2  guix-build-aa3bbe2ea218/output/arm64-apple-darwin/bitcoin-aa3bbe2ea218-arm64-apple-darwin-unsigned.zip\n16c8ec7d7f16dfa24c1dd2b1f72d02207be3769e8b7ae57e31fd3285a22bf9d0  guix-build-aa3bbe2ea218/output/dist-archive/bitcoin-aa3bbe2ea218.tar.gz\na321e30a01ee92115eccd85e2dfc04a0853939a7396854e93d530f9bc7dd5feb  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/SHA256SUMS.part\nfcc07d881190898c1b5ec62d128ea1c920ab5b93141b27f5cbc4bbffdb955ae2  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu-debug.tar.gz\nd294b23f21efcb42b80cca6517a8ade2f551ff91cba9a1087551ebafefc5b579  guix-build-aa3bbe2ea218/output/powerpc64-linux-gnu/bitcoin-aa3bbe2ea218-powerpc64-linux-gnu.tar.gz\n7d767fd902ce82b913c232079125fb39e50a7fd3ea8716de53cd5e43f9097135  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/SHA256SUMS.part\nd6d9e2f7857e6ee07a3de4eb62f389210ec675a96f79da32870f49d4426a5800  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu-debug.tar.gz\n645437534011d3379e78ea2e725eb981c9239a54b2074c4dc475d666673e61fc  guix-build-aa3bbe2ea218/output/riscv64-linux-gnu/bitcoin-aa3bbe2ea218-riscv64-linux-gnu.tar.gz\n96bcf9374a0bac414c93ee7b10562dafee4b1ab8e6e26c70455de9ab895d4699  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/SHA256SUMS.part\na9b28e8b47c4a4763d884b35bda7d762baea62012b8a84d140052de1419fec9f  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-codesigning.tar.gz\n99a3c91cfb265ee54b92994a756f02da3a17c470b78ea449283b7ae331d80e0d  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.tar.gz\nb6378480d9340b3ea7359fd36a1e5d2596bd61b4f55af2c35bb66946aa8b9ea5  guix-build-aa3bbe2ea218/output/x86_64-apple-darwin/bitcoin-aa3bbe2ea218-x86_64-apple-darwin-unsigned.zip\n87d286a7d7a1a9d3314bdb119459c0929f8bd07a0b1057f142ef56de0ff03173  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/SHA256SUMS.part\n6bfec675c208926dc3a724b14a6243a04775973f756c28c0e6381e98b31c990b  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu-debug.tar.gz\n0deba9d8d6f822a46e0402bd4dd45ca1aaec3b2beda968078e9f80c8f1ed9fb5  guix-build-aa3bbe2ea218/output/x86_64-linux-gnu/bitcoin-aa3bbe2ea218-x86_64-linux-gnu.tar.gz\n501de61ed069dc2cb870f6b24233add5cf615b590163a3147557d89f9a8f2c98  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/SHA256SUMS.part\n64613dafb19a609574f3c2357aa5f7f8c6e596052a28d5b75fd1cb99229a82b2  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-codesigning.tar.gz\nb21b5f257847361ea46236eadc46f2fba5203ce3ce9404bcaa8b0784cdd6395d  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-debug.zip\n85f42938bc43eae94561b8b0ad929256b10015883538abc0a4c72568d38dbda0  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-setup-unsigned.exe\nd1cc3f18e7fbd064e593b8a15548bee9dc23a5d2e00ad1eaf7629f3780988497  guix-build-aa3bbe2ea218/output/x86_64-w64-mingw32/bitcoin-aa3bbe2ea218-win64-unsigned.zip\n```"
  },
  {
   "t": "2026-05-15T15:45:57Z",
   "kind": "comment",
   "who": "Sjors",
   "assoc": "MEMBER",
   "text": "Same x86_64 hashes a @0xB10C and @davidgumberg above.\n\nLightly tested the binary on a MacBook Pro M4 with macOS 26.4.1.\n\nI tried a build with `--icf=all` too, but there's no size difference (for arm64)"
  },
  {
   "t": "2026-05-15T16:36:29Z",
   "kind": "comment",
   "who": "Sjors",
   "assoc": "MEMBER",
   "text": "My LLM friend thinks that `--icf=safe` is not actually safe, because without an  address-significance table ([`-faddrsig`](https://clang.llvm.org/docs/UsersManual.html#cmdoption-faddrsig)) it's equivalent to `--icf=all`.\n\nFresh numbers from the rebuilt artifacts:\n\n| variant | commit | `bin/` total | `libexec/` total | tar.gz savings |\n|---|---|---:|---:|---:|\n| `master @ ccbd00ab87c0` | ccbd00ab87c09779e9edc589af6df5c967687a2f | 55,277,340 | 76,844,864 | 0.00 MB |\n| `-faddrsig --icf=safe` | 55ea6999c8618438649800c674faee721278169b | 52,617,668 | 72,106,840 | 1.84 MB |\n| `--icf=all` | 22d9baefb1af13300d5d6f423a6ffc28b1218428 | 52,468,852 | 71,892,200 | 1.92 MB |\n| `-faddrsig --icf=all` | 64bb33a8ab0846698982143e8e16b51848c9e617 | 52,468,852 | 71,892,200 | 1.92 MB |\n| `--icf=safe` | aa3bbe2ea218c9645fe43d0df3aa2cbdf30a99cc | 52,468,852 | 71,892,200 | 1.92 MB |\n\nBranch with the above combinations: [codex/icf-combinations](https://github.com/Sjors/bitcoin/commits/codex/icf-combinations/)\n\nUpdate: numbers are for `HOSTS=\"arm64-apple-darwin\"`"
  },
  {
   "t": "2026-05-15T16:44:03Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nCan you elaborate? According to what you linked, -faddrsig only has an effect on ELF targets. We are only using the flag for Darwin (MACHO) targets here."
  },
  {
   "t": "2026-05-15T16:49:33Z",
   "kind": "comment",
   "who": "Sjors",
   "assoc": "MEMBER",
   "text": "I don't know, but the table shows a difference between just `--icf=safe` and `-faddrsig --icf=safe` for the macOS arm64 target (I updated my comment above to specify `arm64-apple-darwin`).\n\nI had it generate an example:\n\n```cpp\nvoid f(void) {}\nvoid g(void) {}\nvoid (*p)(void) = f;\nint main(void) { return p == g; }\n```\n\nTry this on a guix machine:\n\n```\nmkdir -p tmp/addrsig-check\n\nHOST=arm64-apple-darwin \\\nguix time-machine \\\n  --url=https://codeberg.org/guix/guix.git \\\n  --commit=c5eee3336cc1d10a3cc1c97fde2809c3451624d3 \\\n  -- shell \\\n  --manifest=contrib/guix/manifest.scm \\\n  --pure \\\n  -- bash -lc '\nset -eu\n\ncat > tmp/addrsig-check/test.c <<EOF\nvoid f(void) {}\nvoid g(void) {}\nvoid (*p)(void) = f;\nint main(void) { return p == g; }\nEOF\n\nclang --target=arm64-apple-darwin -c tmp/addrsig-check/test.c -o tmp/addrsig-check/no-addrsig.o\nclang --target=arm64-apple-darwin -faddrsig -c tmp/addrsig-check/test.c -o tmp/addrsig-check/with-addrsig.o\n\necho \"clang version:\"\nclang --version | head -1\n\necho\necho \"driver passes -faddrsig to cc1:\"\nclang --target=arm64-apple-darwin -faddrsig -### -c tmp/addrsig-check/test.c -o /dev/null 2>&1 | grep -- -faddrsig || true\n\necho\necho \"without -faddrsig:\"\nllvm-objdump --macho --section-headers tmp/addrsig-check/no-addrsig.o | grep llvm_addrsig || true\n\necho\necho \"with -faddrsig:\"\nllvm-objdump --macho --section-headers tmp/addrsig-check/with-addrsig.o | grep llvm_addrsig || true\n'\n```\n\nIt outputs:\n\n```\nwithout -faddrsig:\n\nwith -faddrsig:\n  3 __llvm_addrsig   00000008 0000000000000098 DATA\n```\n\nSo I guess that help page I linked to is wrong."
  },
  {
   "t": "2026-05-20T15:15:33Z",
   "kind": "comment",
   "who": "theuni",
   "assoc": "MEMBER",
   "text": "Hmm. A few things...\n\n- The docs/whitepaper say to use this with `-ffunction-sections`. Weirdly, (using x86-64-linux as a test) I don't see any difference with that vs `-fno-function-sections`. I can't explain that.\n- Without messing with `-ffunction-sections` I see mostly removals of `.gcc_except_table.*`. From a quick search, that seems fine.\n\nMy main concern though.. why not add this to `CMakeLists.txt` and turn it on by default? I worry that if any linker tricks like this cause any trouble, we'd only see it in guix binaries."
  },
  {
   "t": "2026-05-26T13:27:43Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "[quoted text omitted]\n\nOne reason is that it could have side-effects for debug builds. Do you see this being rolled into `REDUCE_EXPORTS` (although I feel like it'd been discussed to remove that entirely)? There's also a (newer) `--icf=safe_thunks`, which we could test/use specifically for arm64 darwin, and then test/use `--icf=safe` generically for any other target that supports it."
  },
  {
   "t": "2026-05-27T13:48:51Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "ec9a205c3c2d0e0e8d98d87b253b2f69f5ad7309"
  },
  {
   "t": "2026-06-11T08:28:17Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "9c54372108ea38fb77e57f5d4ce3f4efb33e7510"
  },
  {
   "t": "2026-06-15T12:35:15Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "d2a92323f7defc32119bbaff9c769ae4cd17a6c0"
  },
  {
   "t": "2026-06-16T15:08:25Z",
   "kind": "comment",
   "who": "theuni",
   "assoc": "MEMBER",
   "text": "Hmm, that's tempting, but I'm not sure we want to conflate those things. Especially if, as you mention, we might eventually just get rid of the option and make the `REDUCE_EXPORTS` behavior default.\n\nFor darwin, there's now `--keep-icf-stabs`, which would (in theory) make it safe to turn on for everyone.\n\nSadly, I don't see an equivalent for ELF targets :("
  },
  {
   "t": "2026-07-03T11:43:54Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "48cd8fa16dad1e8fe9434c0bef48a84e635e2ae9"
  },
  {
   "t": "2026-07-03T11:44:18Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "I've pulled this back out of `REDUCE_EXPORTS`, into the general flags. We try `safe_thunks` first, and then try `safe`."
  },
  {
   "t": "2026-07-10T10:33:25Z",
   "kind": "force_push",
   "who": "fanquake",
   "commit": "24ad7419dea40e647b10791105a0659df143e014"
  },
  {
   "t": "2026-07-10T13:35:58Z",
   "kind": "comment",
   "who": "Sjors",
   "assoc": "MEMBER",
   "text": "I wrote earlier:\n\n[quoted text omitted]\nThat seems to be fixed here: https://github.com/llvm/llvm-project/pull/188400\n\n[quoted text omitted]\n@fanquake wrote:\n\n[quoted text omitted]\nIt does, since https://reviews.llvm.org/D123751\n\n[quoted text omitted]\nThe issue applies to both `safe_thunks` and `safe`, so still relevant as of 24ad7419dea40e647b10791105a0659df143e014.\n\nMaybe it's not realistic to actually run into this, but if you throw enough tokens at it:\n\nOn the guix machine:\n\n```sh\nmkdir -p ~/icf-demo\n```\n\nAdd `audit.h`:\n\n```cpp\n#pragma once\n\nusing Validator = bool (*)(const char*);\n\nnamespace reqlib {\n//! The library's built-in default policy.\nbool PermitAll(const char*);\nvoid SetValidator(Validator v);\n//! Returns true if the audit trail was wrongly skipped.\nbool HandleRequest(const char* req);\n} // namespace reqlib\n```\n\nAdd `lib.cpp`:\n\n```cpp\n#include \"audit.h\"\n\n#include <cstdio>\n\nnamespace reqlib {\n\nbool PermitAll(const char*) { return true; }\n\nstatic Validator g_validator{PermitAll};\n\nvoid SetValidator(Validator v) { g_validator = v; }\n\nbool HandleRequest(const char* req)\n{\n    // Fast path: the built-in default needs no audit trail.\n    if (g_validator != PermitAll) {\n        std::printf(\"AUDIT: '%s' checked by custom policy\\n\", req);\n        g_validator(req);\n        return false;\n    }\n    std::printf(\"(no audit: library believes the default policy is installed)\\n\");\n    g_validator(req);\n    return true;\n}\n\n} // namespace reqlib\n```\n\nAdd `app.cpp`:\n\n```cpp\n#include \"audit.h\"\n\n#include <cstdio>\n\nint main()\n{\n    // Ops policy: permissive for now, to be tightened later.\n    // Nobody duplicated any code -- this is just a lambda.\n    Validator ops_policy = [](const char*) { return true; };\n\n    reqlib::SetValidator(ops_policy);\n    const bool bug{reqlib::HandleRequest(\"withdraw 100 BTC\")};\n\n    // volatile: keep the compiler from folding the comparison itself --\n    // it is entitled to assume distinct functions have distinct addresses.\n    Validator volatile a{ops_policy};\n    Validator volatile b{reqlib::PermitAll};\n    std::printf(\"\\nops_policy (lambda) = %p\\nreqlib::PermitAll   = %p\\n\", (void*)a, (void*)b);\n    std::printf(\"at runtime they are: %s\\n\", a == b ? \"THE SAME FUNCTION\" : \"distinct\");\n\n    if (bug) {\n        std::printf(\"\\nFAIL: the linker folded the app's lambda into the library's default,\\n\"\n                    \"      so the \\\"has the default been replaced?\\\" check is dead code\\n\"\n                    \"      and the audit trail was silently skipped.\\n\");\n        return 1;\n    }\n    std::printf(\"\\nPASS: function identity preserved; audit trail intact.\\n\");\n    return 0;\n}\n```\n\nBuild the broken version:\n\n```sh\nexport SDK_PATH=${SDK_PATH:-$HOME/macOS-SDKs}\nSDK=\"$SDK_PATH/Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers\"\n\nHOST=arm64-apple-darwin guix time-machine \\\n  --url=https://codeberg.org/guix/guix.git \\\n  --commit=c5eee3336cc1d10a3cc1c97fde2809c3451624d3 \\\n  -- shell --manifest=contrib/guix/manifest_build.scm --share=\"$SDK_PATH\" --pure \\\n  -- clang++ --target=arm64-apple-darwin -isysroot\"$SDK\" -nostdlibinc \\\n       -iwithsysroot/usr/include/c++/v1 \\\n       -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks \\\n       -mmacos-version-min=14.0 -mlinker-version=711 -Xclang -fno-cxx-modules \\\n       -std=c++20 -O2 -fuse-ld=lld \\\n       -Wl,-platform_version,macos,14.0,14.0 -Wl,--icf=safe \\\n       ~/icf-demo/lib.cpp ~/icf-demo/app.cpp -o ~/icf-demo/icf-broken\n```\n\nBuild correct version by adding  `-faddrsig` added and `-o ~/icf-demo/icf-fixed`\n\nCopy and to macOS (arm64) and run:\n\n```sh\nscp guix:icf-demo/icf-broken guix:icf-demo/icf-fixed .\n./icf-broken; echo \"exit=$?\"     # exit=1, audit silently skipped\n./icf-fixed;  echo \"exit=$?\"     # exit=0, audit intact\n```"
  },
  {
   "t": "2026-07-26T12:22:49Z",
   "kind": "review_comment",
   "who": "hebasto",
   "assoc": "MEMBER",
   "path": "CMakeLists.txt",
   "commit": "24ad7419dea40e647b10791105a0659df143e014",
   "in_reply_to": null,
   "text": "[quoted text omitted]\n\nThis prioritizes `--icf=safe` over `--icf=safe_thunks` on the linker command line. However, shouldn't it be the other way around, since `safe_thunks` does not rely on the address-significance table?"
  },
  {
   "t": "2026-07-26T12:23:17Z",
   "kind": "review",
   "who": "hebasto",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "24ad7419dea40e647b10791105a0659df143e014",
   "text": "Concept ACK on using the \"Identical Code Folding\" linker feature where possible.\n\nI agree with @Sjors. The address-significance table emitted by `-faddrsig` is the only thing that makes `-Wl,--icf=safe` different form `-Wl,--icf=all`. And it must be enabled explicitly for macOS targets."
  },
  {
   "t": "2026-07-26T13:21:22Z",
   "kind": "review",
   "who": "hebasto",
   "assoc": "MEMBER",
   "state": "COMMENTED",
   "commit": "24ad7419dea40e647b10791105a0659df143e014",
   "text": "[quoted text omitted]\n\nTested this using the following snapshot:\n```\n$ clang --version\nUbuntu clang version 23.0.0 (++20260707081847+70646dd3eda3-1~exp1~20260707082012.1709)\nTarget: x86_64-pc-linux-gnu\nThread model: posix\nInstalledDir: /usr/lib/llvm-23/bin\n```\n\nFor `bitcoind` (the `arm64-apple-darwin` target), `--icf=safe` without `-faddrsig` results in the same binary size as `--icf=none`."
  },
  {
   "t": "2026-07-30T22:28:12Z",
   "kind": "comment",
   "who": "151henry151",
   "assoc": "CONTRIBUTOR",
   "text": "Reviewed at 24ad7419dea4. Not an ACK in its current shape \u2014 on the pinned Guix toolchain, `--icf=safe` behaves like `--icf=all` for the Darwin release binaries. Adding `-faddrsig` fixes that and keeps most of the size win (measured below).\n\nThis settles the `-faddrsig` question in the thread: on Mach-O with ld64.lld 19.1.7, `--icf=safe` without `-faddrsig` folds address-taken functions. Objects built without the flag carry no `__llvm_addrsig` section, and lld 19's Mach-O port then treats every function as foldable \u2014 the conservative \"no table, don't fold\" fallback exists only on ELF/COFF, which is why `--icf=safe` is fine on Linux (clang emits the table by default there) but not on Darwin. The upstream fix @Sjors linked ([llvm/llvm-project#188400](https://github.com/llvm/llvm-project/pull/188400)) means a future toolchain turns this same configuration into a silent no-op instead. Either way, Darwin needs `-faddrsig` for `safe` to mean safe \u2014 and this is why `safe` and `all` produced identical sizes: today they do the same folding.\n\nRepro on the pinned toolchain (extends @Sjors' earlier example; clang/LLD 19.1.7 via <code>guix time-machine</code> + <code>manifest_build.scm</code>)\n\n```c\n#define N __attribute__((noinline))\nN int f(int x) { return x * 7 + 3; }\nN int g(int x) { return x * 7 + 3; }\nN int h(int x) { return x * 9 + 1; }\nN int k(int x) { return x * 9 + 1; }\ntypedef int (*fp)(int);\nvolatile fp pf = f;\nvolatile fp pg = g;\nint main(void) { return pf(1) + pg(2) + h(3) + k(4); }\n```\n\nCompiled with `clang --target=arm64-apple-darwin -O2 [-faddrsig]` against the extracted SDK, linked with `-fuse-ld=lld -Wl,--icf=safe` (or `all`), then `llvm-nm --numeric-sort | grep -E ' _(f|g|h|k)$'`:\n\n```\n--icf=safe, no -faddrsig:     --icf=safe, with -faddrsig:   --icf=all:\n00000001000003b0 T _f         00000001000003b0 T _f         00000001000003b0 T _f\n00000001000003b0 T _g         00000001000003c0 T _g         00000001000003b0 T _g\n00000001000003c0 T _h         00000001000003d0 T _h         00000001000003c0 T _h\n00000001000003c0 T _k         00000001000003d0 T _k         00000001000003c0 T _k\n```\n\n`f`/`g` are address-taken; `safe` without `-faddrsig` is indistinguishable from `all`.\n\nIt shows in the real artifacts. Taking `llvm-nm --defined-only` on the unstripped `arm64-apple-darwin` `bitcoind`, keeping text symbols, deduping identical (address, name) pairs, and counting addresses claimed by more than one name: 4,149 symbols share 678 addresses in my Guix build of this tip, versus zero in an identically processed build of the base (all three builds list the same 15,899 text symbols, so every collision is ICF). Rebuilt with `-faddrsig`, 614 fold groups remain (legitimate folding of non-address-taken code); the other 70 are address-significant and should not have folded \u2014 including `std::variant` visitation dispatchers, whose addresses sit in `std::visit` dispatch tables, and distinct `tinyformat::format` instantiations.\n\nTo measure the true `safe` win \u2014 and whether it survives on the depends static libraries, whose objects also need the table \u2014 I rebuilt `arm64-apple-darwin` with `-faddrsig` added to `darwin_CFLAGS`/`darwin_CXXFLAGS` in `depends/hosts/darwin.mk` (propagates to depends and core via `toolchain.cmake`). `bin/` sizes in bytes from the extracted `-unsigned.tar.gz` (stripped release binaries):\n\n| Binary | Parent (297fd1489bbf) | Branch as-is (\u2248 `--icf=all`) | Branch + `-faddrsig` (true `safe`) |\n|---|--:|--:|--:|\n| bitcoin | 209512 | 193040 (\u22127.86%) | 193064 (\u22127.85%) |\n| bitcoin-cli | 3626584 | 2884432 (\u221220.46%) | 2901008 (\u221220.01%) |\n| bitcoind | 12583620 | 11939980 (\u22125.11%) | 11989516 (\u22124.72%) |\n| bitcoin-qt | 32453708 | 31080876 (\u22124.23%) | 31248148 (\u22123.71%) |\n| bitcoin-tx | 2409480 | 2343496 (\u22122.74%) | 2343552 (\u22122.74%) |\n| bitcoin-util | 388496 | 355584 (\u22128.47%) | 372000 (\u22124.25%) |\n| bitcoin-wallet | 4179668 | 4014700 (\u22123.95%) | 4031228 (\u22123.55%) |\n| Total | 55851068 | 52812108 (\u22125.44%) | 53078516 (\u22124.96%) |\n\nSo the fix is cheap overall: 4.96% total reduction under true `safe` versus 5.44% now. The exception is `bitcoin-util`, which keeps only half its win \u2014 the binary where address-significant folding was doing the most work, i.e. exactly the folds `safe` exists to prevent. Sizes are scoped to `arm64-apple-darwin`; my base control covered `x86_64-linux-gnu`, `x86_64-w64-mingw32` and `arm64-apple-darwin` only, so I have no x86_64 Darwin baseline.\n\n@hebasto on the probe order: moot today, but it arms on the next toolchain bump. On the pinned toolchain the `safe_thunks` probe fails \u2014 `LINKER_SUPPORTS__WL___ICF_SAFE_THUNKS` is empty in the release build's `CMakeCache.txt`, so only `--icf=safe` is appended. That matches the source: LLD 19's Mach-O driver accepts only `none`/`safe`/`all` and warns-then-defaults-to-`none` on anything else ([`getICFLevel`](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.7/lld/MachO/Driver.cpp#L845-L858)); Mach-O `safe_thunks` landed in LLVM 20. Once the toolchain reaches 20+, I'd expect both probes to pass and both flags to land on the link line \u2014 and since the driver takes the last `--icf=` (`getLastArgValue`, verified on 19 by reversing the flag order), `safe` would permanently shadow `safe_thunks`. Guarding the second probe avoids that:\n\n```cmake\ntry_append_linker_flag(\"-Wl,--icf=safe_thunks\" VAR CMAKE_EXE_LINKER_FLAGS RESULT_VAR linker_supports_icf_safe_thunks)\nif(NOT linker_supports_icf_safe_thunks)\n  try_append_linker_flag(\"-Wl,--icf=safe\" VAR CMAKE_EXE_LINKER_FLAGS)\nendif()\n```\n\nMoving the probes into the root `CMakeLists.txt` doesn't change non-Darwin output: a control build of the base (`297fd1489bbf`, `FORCE_VERSION`/`SOURCE_DATE_EPOCH` pinned to this tip's) produced `x86_64-linux-gnu` and `x86_64-w64-mingw32` binaries whose only differing bytes were the three known version-carrying artifacts \u2014 embedded commit-id strings, `.gnu_debuglink` CRCs, and the PE header checksum; after normalizing those, the extracted trees compare byte-identical. `riscv64-linux-gnu` built clean with the exemption in place.\n\nAll of the Darwin work above was cross-compiled and analyzed on an x86_64 Linux machine \u2014 I haven't run these binaries on macOS hardware. The only functional testing of the ICF-folded binaries so far remains @Sjors' earlier smoke test on his MacBook.\n\nGuix build (x86_64)\n\n```\n79cdcb0b524218c92c4e55b8a8580b7a282a208f64e63cbb906496fa286fe8e4  guix-build-24ad7419dea4/output/aarch64-linux-gnu/SHA256SUMS.part\n1dacd2082a4ea38ca9d9f3ca6d179c4a796fe4ab7dd58f48413e8321f5a88889  guix-build-24ad7419dea4/output/aarch64-linux-gnu/bitcoin-24ad7419dea4-aarch64-linux-gnu-debug.tar.gz\ncf139f9381d62b7af34e9f869e6444062cc8439435505b9d3e06b1a36e77d752  guix-build-24ad7419dea4/output/aarch64-linux-gnu/bitcoin-24ad7419dea4-aarch64-linux-gnu.tar.gz\na1a64bf02505833eb74064bad185251ccfeb090a8260e5b4a6ebda8acfb37e37  guix-build-24ad7419dea4/output/arm-linux-gnueabihf/SHA256SUMS.part\n14f4780436cea32591cd4fa8fef3b5e9359ff4751b116f5c804779a694db6d3c  guix-build-24ad7419dea4/output/arm-linux-gnueabihf/bitcoin-24ad7419dea4-arm-linux-gnueabihf-debug.tar.gz\ne3081a1fc9f3509208b4ac362895b486c87b5c1f8a1b0153358eed8536d62d25  guix-build-24ad7419dea4/output/arm-linux-gnueabihf/bitcoin-24ad7419dea4-arm-linux-gnueabihf.tar.gz\nf791c9c9a06dea1356ba2b130b84befd8d5982969a21216c75d53a41597c5aa9  guix-build-24ad7419dea4/output/arm64-apple-darwin/SHA256SUMS.part\n4624a97304b3196b046cc49a32a161d1b114ad364ac3041503f33385f4ef5dc2  guix-build-24ad7419dea4/output/arm64-apple-darwin/bitcoin-24ad7419dea4-arm64-apple-darwin-codesigning.tar.gz\n25d08506235ed48c27abc8cceecd28ec659ccda761317afed3c6c6f59f1574c2  guix-build-24ad7419dea4/output/arm64-apple-darwin/bitcoin-24ad7419dea4-arm64-apple-darwin-unsigned.tar.gz\n4e5353512546db8be1ab295120ca8bec6aa7282d6aa485a40065e18988223221  guix-build-24ad7419dea4/output/arm64-apple-darwin/bitcoin-24ad7419dea4-arm64-apple-darwin-unsigned.zip\n91bf75abc2acc3e3eca85d159a8cc150f6a275b07fc293514eefd71c0b13e7dc  guix-build-24ad7419dea4/output/dist-archive/bitcoin-24ad7419dea4.tar.gz\naf7f449030a4270321e3c635cea6b7cb93e05acdb73128efd6ee764b373d49ec  guix-build-24ad7419dea4/output/powerpc64-linux-gnu/SHA256SUMS.part\n27106f27a2b8a2873de820cea76efcbb51bd88f40589b3e47175ee5226411b0d  guix-build-24ad7419dea4/output/powerpc64-linux-gnu/bitcoin-24ad7419dea4-powerpc64-linux-gnu-debug.tar.gz\n158232ece4c292a996a3d4574ed47b6b9273d6c58dc2dd0f95782211933fa26a  guix-build-24ad7419dea4/output/powerpc64-linux-gnu/bitcoin-24ad7419dea4-powerpc64-linux-gnu.tar.gz\na6480bb08234f20396f7273ea8b77a986da40f28d1a87e5779284de38904c4ab  guix-build-24ad7419dea4/output/riscv64-linux-gnu/SHA256SUMS.part\n1640b6a6832264e7e048c3b43fd2b8b52b0a07ee031a8ab7cf24268aa2468285  guix-build-24ad7419dea4/output/riscv64-linux-gnu/bitcoin-24ad7419dea4-riscv64-linux-gnu-debug.tar.gz\n6614b05ba1a112b96e717dd417db1f0d929dc4ac993d2c59d99c3d9ebd1ed653  guix-build-24ad7419dea4/output/riscv64-linux-gnu/bitcoin-24ad7419dea4-riscv64-linux-gnu.tar.gz\n93d9483b63fa600ad8c519ae55f284e89160c06057e85a0f7d6563ce9366eb1f  guix-build-24ad7419dea4/output/x86_64-apple-darwin/SHA256SUMS.part\n090ce10c5b6f23bbbf5412e34f9c93da688ba2b587814d2e672720ab9567d413  guix-build-24ad7419dea4/output/x86_64-apple-darwin/bitcoin-24ad7419dea4-x86_64-apple-darwin-codesigning.tar.gz\n98171e4be2690aa3ca382cb62d9bda331b787a8c5a3ad6c0a5ea3b7138bb6949  guix-build-24ad7419dea4/output/x86_64-apple-darwin/bitcoin-24ad7419dea4-x86_64-apple-darwin-unsigned.tar.gz\nf603e0e566dedd051333727c1f60d9bc96884410a279b63b728904bc6810e6f1  guix-build-24ad7419dea4/output/x86_64-apple-darwin/bitcoin-24ad7419dea4-x86_64-apple-darwin-unsigned.zip\nc49278c62f9435eaa9766ba31e6719bfd83c69a5b918ba895f41f43f0576aa75  guix-build-24ad7419dea4/output/x86_64-linux-gnu/SHA256SUMS.part\n5c52f4e89f0962944ca015d49fe138e1542db7cce0a9e22196b300292333450c  guix-build-24ad7419dea4/output/x86_64-linux-gnu/bitcoin-24ad7419dea4-x86_64-linux-gnu-debug.tar.gz\nc6ef006f60f3c111c442ee6f6fee41a3bffa05c92f8e1b356e3ef8d28df740cb  guix-build-24ad7419dea4/output/x86_64-linux-gnu/bitcoin-24ad7419dea4-x86_64-linux-gnu.tar.gz\nf29b432b8f92f4b2d88c714c812f8a0654b691daedcd41d8dc8848849781a54a  guix-build-24ad7419dea4/output/x86_64-w64-mingw32/SHA256SUMS.part\ned6de4310b9de743a07210c4b6826f3f1d75bfceeb6988d6c05a24ae48d477da  guix-build-24ad7419dea4/output/x86_64-w64-mingw32/bitcoin-24ad7419dea4-win64-codesigning.tar.gz\nb01a96d25ab20e8301b621f2e4882e2da58afba80d31eec025d5f200263e307d  guix-build-24ad7419dea4/output/x86_64-w64-mingw32/bitcoin-24ad7419dea4-win64-debug.zip\n1c286ad25dba26e70771ed615f98bd157261cefd7ee819db8481c273a47607de  guix-build-24ad7419dea4/output/x86_64-w64-mingw32/bitcoin-24ad7419dea4-win64-setup-unsigned.exe\n39025c9504ab7ec2400a40dacacf28d35169e5d4c9c6cce8d21d572ae6fc50d1  guix-build-24ad7419dea4/output/x86_64-w64-mingw32/bitcoin-24ad7419dea4-win64-unsigned.zip\n```\n\nNo other attestations at this tip yet (the earlier ones in the thread are for aa3bbe2ea218)."
  },
  {
   "t": "2026-08-10T10:16:53Z",
   "kind": "comment",
   "who": "fanquake",
   "assoc": "MEMBER",
   "text": "Opened https://github.com/llvm/llvm-project/pull/212793 to try and clarify the docs upstream."
  }
 ],
 "labels_log": [
  {
   "t": "2026-05-03T09:39:04Z",
   "action": "labeled",
   "label": "Build system",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-03T10:55:39Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-05-06T13:02:16Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [
  {
   "t": "2026-05-11T10:29:36Z",
   "kind": "ready_for_review",
   "who": "fanquake"
  }
 ],
 "text_chars": 42576,
 "text_tokens_estimate": 10644,
 "changed_paths": [
  "CMakeLists.txt"
 ],
 "files": [
  {
   "path": "CMakeLists.txt",
   "add": 5,
   "del": 0
  }
 ],
 "test_lines": 0,
 "git": {
  "head": "24ad7419dea40e647b10791105a0659df143e014",
  "head_matches_backup": true,
  "base": "297fd1489bbf9cd9085570d854b4545e6e5f7566",
  "commits": [
   {
    "sha": "24ad7419de",
    "subject": "build: add -Wl,--icf=safe(thunks)",
    "files": 1,
    "add": 5,
    "del": 0
   }
  ],
  "patch_truncated": false
 },
 "input_hash": "6ae5e8d2e15552af",
 "extracted_at": "2026-09-17T16:15:31+00:00"
}