)]}'
{
  "commit": "6d49460de1e5ee87de94d48fd72cf3cf3d5bfc5a",
  "tree": "1b25b3b1ab97c424974ed03d8119074763f45906",
  "parents": [
    "16f02c0940d6ee783c38ca27b44fc158d77e7567"
  ],
  "author": {
    "name": "Mateusz Mikuła",
    "email": "oss@mateuszmikula.dev",
    "time": "Thu Apr 09 08:18:43 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Apr 09 09:18:43 2026 +0300"
  },
  "message": "[Clang] [MinGW] Handle `-nolibc` argument (#182062)\n\nThis implementation differs from GCC, but arguably more in line with\nUnix systems, because it stops linking of default Win32 system\nlibraries.\n\nOn GCC it works like this:\n```\n❯ /ucrt64/bin/gcc -### /dev/null -nolibc 2\u003e\u00261 | tr \u0027 \u0027 \u0027\\n\u0027 | rg \u0027^\\-l\u0027 | sort -u\n-lgcc\n-lgcc_eh\n-lkernel32\n-lmingw32\n-lmingwex\n-lmsvcrt\n\n❯ /ucrt64/bin/gcc -### /dev/null 2\u003e\u00261 | tr \u0027 \u0027 \u0027\\n\u0027 | rg \u0027^\\-l\u0027 | sort -u\n-ladvapi32\n-lgcc\n-lgcc_eh\n-lkernel32\n-lmingw32\n-lmingwex\n-lmsvcrt\n-lpthread\n-lshell32\n-luser32\n```\nClang with this PR:\n```\n❯ ./bin/clang -### /dev/null -nolibc 2\u003e\u00261 | tr \u0027 \u0027 \u0027\\n\u0027 | rg \u0027^\"\\-l\u0027 | sort -u\n\"-lgcc\"\n\"-lgcc_eh\"\n```\n\nThe motivation for supporting this argument comes from Rust, which wants\nto control what is linked, but still utilize compiler builtins. With GCC\nthat is done by supplying `-nodefaultlibs` and `-lgcc`, but LLVM\u0027s\ncompiler-rt cannot be added back as easily.\n`-nolibc --unwindlib\u003dnone` that skips Win32 libs would give the parity\nwith GCC\u0027s `-nodefaultlibs -lgcc`.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2c9a174069f70c92f0e1c6bea731ce09e956fb3b",
      "old_mode": 33188,
      "old_path": "clang/lib/Driver/ToolChains/MinGW.cpp",
      "new_id": "7c01d49dd778ed27a253067e54a3a4772afb12e2",
      "new_mode": 33188,
      "new_path": "clang/lib/Driver/ToolChains/MinGW.cpp"
    },
    {
      "type": "modify",
      "old_id": "f43fa177e2905908d5e597622bf22106824a51c8",
      "old_mode": 33188,
      "old_path": "clang/test/Driver/mingw.cpp",
      "new_id": "9affd3ba6d5dba52e8efab0b93875c375f4ca38f",
      "new_mode": 33188,
      "new_path": "clang/test/Driver/mingw.cpp"
    }
  ]
}
