llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28k stars 11.56k forks source link

split DWARF .dwo not saved/restored by ThinLTO cache #46037

Open Trass3r opened 4 years ago

Trass3r commented 4 years ago
Bugzilla Link 46692
Version trunk
OS Linux
CC @agrieve,@dwblaikie,@MaskRay

Extended Description

clang++ -O3 -flto=thin -gsplit-dwarf test.cpp -o test -fuse-ld=lld -Wl,--thinlto-cache-dir=/tmp/testltocache

or

clang++ -O3 -flto=thin -gsplit-dwarf test.cpp -o test -Wl,-plugin-opt,cache-dir=/tmp/testltocache

The first time it runs it does produce a test_dwo/1.dwo file but after that it fetches the object file from the cache and the .dwo is lost.

b078d2e7-9c2e-48c7-93df-05e63984c3e0 commented 2 years ago

Ran into this when trying to enable -gsplit-dwarf in chromium. There are also issues for incremental builds where stale .dwo files can exist, which I suspect might be the same root cause. Some details here: https://bugs.chromium.org/p/chromium/issues/detail?id=1263177

rnk commented 2 years ago

@dwblaikie @zmodem We should feed this into our bug review process.