Issue 167327
Summary Undefined symbols when using ThinLTO + cs-profile-generate
Labels new issue
Assignees
Reporter tru
    
This is my simple compile script. CC is clang-cl.exe, LD is lld-link.exe and PROFILE is the path to clang_rt.profile.lib

```
%CC% /c /Fotest_pgo.obj -fprofile-generate=pgo.profraw -flto=thin test.cpp
%LD% /out:test_pgo.exe test_pgo.obj %PROFILE%

.\test_pgo.exe
%PD% merge -o default.prof pgo.profraw

%CC% /c /Fotest.obj -fcs-profile-generate -fprofile-use=default.prof -flto=thin test.cpp
%LD% /out:test.exe test.obj %PROFILE% /lto-cs-profile-generate
```

This leads to the following error:

```
lld-link: error: undefined symbol: __llvm_profile_counter_bias
>>> referenced by clang_rt.profile.lib(InstrProfilingFile.c.obj):(mmapForContinuousMode)
```

In another project I also see that `__llvm_profile_filename` is undefined.

I tired to define these in the source but it doesn't seem to make a difference.

Anyone using CS PGO on Windows? @zmodem @teresajohnson 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to