)]}'
{
  "commit": "19a3cc83353e3bb4bc28769f8606139a3d350d2d",
  "tree": "b58a21b5ec4880b56dd4005cb9cfcf8c2f8a2821",
  "parents": [
    "810361b9f65daa6144922ac88087a8426eeae817"
  ],
  "author": {
    "name": "Andi Kleen",
    "email": "ak@linux.intel.com",
    "time": "Wed Apr 02 21:49:27 2014 +0200"
  },
  "committer": {
    "name": "Michal Marek",
    "email": "mmarek@suse.cz",
    "time": "Mon Apr 07 21:51:13 2014 +0200"
  },
  "message": "Kbuild, lto: Add Link Time Optimization support v3\n\nWith LTO gcc will do whole program optimizations for\nthe whole kernel and each module. This increases compile time,\nbut can generate faster and smaller code and allows\nthe compiler to do global checking. For example the compiler\ncan complain now about type mismatches for symbols between\ndifferent files.\n\nLTO allows gcc to inline functions between different files and\ndo various other optimization across the whole binary.\n\nIt might also trigger bugs due to more aggressive optimizations.\nIt allows gcc to drop unused code. It also allows it to check\ntypes over the whole program.\n\nThe compile time is definitely slower. For gcc 4.8 on a\ntypical monolithic config it is about 58% slower. 4.9\ndrastically improved performance, with slowdown being\n38% or so. Also incremenential rebuilds are somewhat\nslower, as the whole kernel always needs to be reoptimized.\nVery modular kernels have less build time slow down, as\nthe LTO will run for each module individually.\n\nThis adds the basic Kbuild plumbing for LTO:\n\n- In Kbuild add a new scripts/Makefile.lto that checks\nthe tool chain (note the checks may not be fully bulletproof)\nand when the tests pass sets the LTO options\nCurrently LTO is very finicky about the tool chain.\n- Add a new LDFINAL variable that controls the final link\nfor vmlinux or module. In this case we call gcc-ld instead\nof ld, to run the LTO step.\n- For slim LTO builds (object files containing no backup\nexecutable) force AR to gcc-ar\n- Theoretically LTO should pass through compiler options from\nthe compiler to the link step, but this doesn\u0027t work for all options.\nSo the Makefile sets most of these options manually.\n- Kconfigs:\nSince LTO with allyesconfig needs more than 4G of memory (~8G)\nand has the potential to makes people\u0027s system swap to death.\nI used a nested config that ensures that a simple\nallyesconfig disables LTO. It has to be explicitely\nenabled.\n- Some depencies on other Kconfigs:\nMODVERSIONS, GCOV, FUNCTION_TRACER, KALLSYMS_ALL, single chain WCHAN are\nincompatible with LTO currently, mostly because they\nthey require setting special compiler options\nfor specific files, which LTO currently doesn\u0027t support.\nMODVERSIONS should in principle work with gcc 4.9, but still disabled.\nFUNCTION_TRACER/GCOV can be fixed with a unmerged gcc patch.\n- Also disable strict copy user checks because they trigger\nerrors with LTO.\n- modpost symbol checking is downgraded to a warning,\nas in some cases modpost runs before the final link\nand it cannot resolve LTO symbols at this point.\n\nFor more information see Documentation/lto-build\n\nThanks to HJ Lu, Joe Mario, Honza Hubicka, Richard Guenther,\nDon Zickus, Changlong Xie who helped with this project\n(and probably some more who I forgot, sorry)\n\nv2:\nMerge documentation file into this patch\nImprove documentation and Kconfig, fix a lot of obsolete comments.\nExclude READABLE_ASM\nSome random fixes\nv3:\nRemove CONFIG_LTO_SLIM, is on by default.\nSigned-off-by: Andi Kleen \u003cak@linux.intel.com\u003e\nSigned-off-by: Michal Marek \u003cmmarek@suse.cz\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5dcce1e9cc2563f2118c138c6aea643859f01d22",
      "new_mode": 33188,
      "new_path": "Documentation/lto-build"
    },
    {
      "type": "modify",
      "old_id": "81dca6680f1ef614e92bc004c21325b3cc13d2f5",
      "old_mode": 33188,
      "old_path": "Makefile",
      "new_id": "dbc509f4348e96da6ce0db435dcd408d67ea20a9",
      "new_mode": 33188,
      "new_path": "Makefile"
    },
    {
      "type": "modify",
      "old_id": "8453fe1342eaf137bcf2c707bc93ac4717ee27db",
      "old_mode": 33188,
      "old_path": "arch/x86/Kconfig",
      "new_id": "0d742ad6e675da3ae3824243d01199c7ba3a32a3",
      "new_mode": 33188,
      "new_path": "arch/x86/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "d56cb03c1b491036c981582568d780303d3ca250",
      "old_mode": 33188,
      "old_path": "init/Kconfig",
      "new_id": "fe9e546a010bd27a7abedfbab770de7196d9ebf5",
      "new_mode": 33188,
      "new_path": "init/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "d04ce8ac4399260c8e127bd800a5a12dc91f5044",
      "old_mode": 33188,
      "old_path": "kernel/gcov/Kconfig",
      "new_id": "32f65b7aed46ab5becded08e1942377b0b8815a3",
      "new_mode": 33188,
      "new_path": "kernel/gcov/Kconfig"
    },
    {
      "type": "modify",
      "old_id": "dd7f8858188a6ac92ac19bb7ae032d62786ee612",
      "old_mode": 33188,
      "old_path": "lib/Kconfig.debug",
      "new_id": "6ed8f51b85386efd89ee76069150de2fb840022e",
      "new_mode": 33188,
      "new_path": "lib/Kconfig.debug"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b8e9e4836f4b559181db6d640f35a13d79e75f77",
      "new_mode": 33188,
      "new_path": "scripts/Makefile.lto"
    },
    {
      "type": "modify",
      "old_id": "69f0a1417e9a47669f5568af2097f031c247e607",
      "old_mode": 33188,
      "old_path": "scripts/Makefile.modpost",
      "new_id": "9c40daea846cdbe932328d73b789f2a634c8f8c6",
      "new_mode": 33188,
      "new_path": "scripts/Makefile.modpost"
    },
    {
      "type": "modify",
      "old_id": "2dcb37736d8469a0e18e4c1ba262281e3fd8cf37",
      "old_mode": 33188,
      "old_path": "scripts/link-vmlinux.sh",
      "new_id": "774145df731c2a5767a4381236e3913f64065700",
      "new_mode": 33188,
      "new_path": "scripts/link-vmlinux.sh"
    }
  ]
}
