Open zucchini.map, note ref to lto.tmp & thinlto-cache/Thin-*.tmp.o files.
cd thinlto-cache
ls # See llvmcache- files, but no lto.tmp or Thin-.tmp.o files.
########
Looks like the renaming code lives in .../llvm/lib/LTO/Cachine.cpp , but .map file is generated before rename occurs? Perhaps we should have .map refer to final file names, or also provide a map from temp files to final files?
This sounds more like an issue of LLVM LTO code than lld because it's not lld who manages the cache directory. Generated .o files should have correct pathnames before returned to lld.
Extended Description
If we use LTO and generate .map files, the resulting file contains links to files such as
However, these files don't exist, because they got renamed to files like
As a result, the data in .map file are not as useful as they should be.
For my specific case, the problem is encountered for Chromium (Linux) ######## Repro instructions ########
cd chrome/src # Wherever this is. gn gen out/test gn args out/test # Launches editor.
Paste the following into the
is_debug = false is_official_build = true generate_linker_map = true use_lld = true use_thin_lto = true
Save and close
ninja -j100 -l15 -C out/test zucchini
cd out/test gunzip zucchini.map.gz
Open zucchini.map, note ref to lto.tmp & thinlto-cache/Thin-*.tmp.o files.
cd thinlto-cache ls # See llvmcache- files, but no lto.tmp or Thin-.tmp.o files. ########
Looks like the renaming code lives in .../llvm/lib/LTO/Cachine.cpp , but .map file is generated before rename occurs? Perhaps we should have .map refer to final file names, or also provide a map from temp files to final files?