Open nico opened 3 years ago
https://reviews.llvm.org/rG317e00dc54c74a2e0fd0c62bdc6a6d68b0d2ca7e is somewhat related.
Now that I'm actually trying this with the repro file, you need to do the following to get it to actually repro:
mkdir bin mv clang-14 bin # Update response.txt to write to here directly mkdir -p lib/clang/14.0.0 ln -s ~/src/llvm-project/clang/lib/Headers lib/clang/14.0.0/include
And then to get the crash:
bin/clang-14 -target x86_64-unknown-unknown -O2 -g -std=c++14 -fno-exceptions -fno-rtti -w -c pgo_training-1.ii pgo_training-1.ii
(See comment 0 for where to get the .ii file.)
https://bugs.chromium.org/p/chromium/issues/detail?id=1267227 comment 0 has full stack. (It's pretty long.)
Still happens without -dead_strip.
Extended Description
Repro file for linking clang: https://drive.google.com/file/d/1uoZnBDRWrG6HQUsPzXsG5yA6t-I0zAoL/view?usp=sharing
This is a clang that was built with -DLLVM_BUILD_INSTRUMENTED=IR.
Linking clang with the repro file with lld.ld64 and then running
bin/clang++ -target x86_64-unknown-unknown -O2 -g -std=c++14 -fno-exceptions -fno-rtti -w -c pgo_training-1.ii pgo_training-1.ii
makes clang crash after ~25s.clang doesn't crash if it's linked with ld64 (it succeeds after ~31s).
You can obtain pgo_training-1.ii by running
curl -L -O https://commondatastorage.googleapis.com/chromium-browser-clang/pgo_training-1.ii
.1: Full cmake invocation for producing the .o files:
This is with a "normally" built clang as stage0 compiler, but it might repro when just using system clang as host compiler.