llvm-mingw icon indicating copy to clipboard operation
llvm-mingw copied to clipboard

-O2 -flto -fcs-profile-generate cause undefined symbol

Open Andarwinux opened this issue 1 year ago • 0 comments

clang  -fuse-ld=lld -target x86_64-pc-windows-gnu -O2 -flto -fcs-profile-generate test.c
ld.lld: error: undefined symbol: __llvm_profile_filename
>>> referenced by libclang_rt.profile-x86_64.a(InstrProfilingFile.c.obj):(.refptr.__llvm_profile_filename)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

llvm 16/17/18 all reproduce the problem, but -O1 -flto has no problem, nor does non-LTO. test.c is arbitrary.

-O2 -flto -fcs-profile-generate fail -O1 -flto -fcs-profile-generate success -O2 -fcs-profile-generate success

Andarwinux avatar Mar 14 '24 08:03 Andarwinux