{
  "id": "cmake/check-ipos-supported-false",
  "signature": "CMake Error: check_ipo_supported() failed - LTO not supported by compiler / toolchain",
  "signature_zh": "CMake 错误：check_ipo_supported() 失败 - 编译器/工具链不支持 LTO",
  "regex": "CMake Error: check_ipo_supported\\(\\) failed - LTO not supported by compiler / toolchain",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "The compiler or linker does not support Link-Time Optimization (LTO) for the current build configuration, or the check_ipo_supported() call detected incompatibility.",
  "root_cause_type": "generic",
  "root_cause_zh": "编译器或链接器不支持当前构建配置的链接时优化 (LTO)，或者 check_ipo_supported() 调用检测到不兼容。",
  "versions": [
    {
      "version": "cmake 3.21.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cmake 3.22.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cmake 3.23.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Set CMAKE_INTERPROCEDURAL_OPTIMIZATION to TRUE manually",
      "why_fails": "Overrides the check but may cause linker errors if the toolchain genuinely lacks LTO support; build will fail later.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Upgrade CMake to the latest version",
      "why_fails": "LTO support depends on the compiler, not CMake version; upgrading CMake does not add LTO to an unsupported compiler.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Disable LTO for the affected target by setting the property explicitly:\n\nset_target_properties(mytarget PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE)\n\nOr set globally:\n\nset(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)",
      "success_rate": 0.95,
      "how": "Disable LTO for the affected target by setting the property explicitly:\n\nset_target_properties(mytarget PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE)\n\nOr set globally:\n\nset(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a compiler that supports LTO (e.g., GCC 4.9+ or Clang 3.9+). For GCC, ensure the 'gold' linker is available:\n\nsudo apt-get install binutils-gold\n\nThen reconfigure with:\n\ncmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_LINKER=/usr/bin/ld.gold /path/to/source",
      "success_rate": 0.8,
      "how": "Use a compiler that supports LTO (e.g., GCC 4.9+ or Clang 3.9+). For GCC, ensure the 'gold' linker is available:\n\nsudo apt-get install binutils-gold\n\nThen reconfigure with:\n\ncmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_LINKER=/usr/bin/ld.gold /path/to/source",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "通过显式设置属性来禁用受影响目标的 LTO：\n\nset_target_properties(mytarget PROPERTIES INTERPROCEDURAL_OPTIMIZATION FALSE)\n\n或全局设置：\n\nset(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE)",
    "使用支持 LTO 的编译器（例如 GCC 4.9+ 或 Clang 3.9+）。对于 GCC，确保 'gold' 链接器可用：\n\nsudo apt-get install binutils-gold\n\n然后使用以下命令重新配置：\n\ncmake -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE -DCMAKE_LINKER=/usr/bin/ld.gold /path/to/source"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-05-08",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}