Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw-w64-x86_64-clang: can not build with coverage info. #2148

Closed
LebedevRI opened this issue Feb 2, 2017 · 2 comments
Closed

mingw-w64-x86_64-clang: can not build with coverage info. #2148

LebedevRI opened this issue Feb 2, 2017 · 2 comments

Comments

@LebedevRI
Copy link

I compile with -fprofile-arcs -ftest-coverage flags, and link with -fprofile-arcs -ftest-coverage --coverage flags, as stated everywhere.
On my local machine, with debian sid + clang 3.9 / 4.0 it does work, and the resulting binary does produce coverage data.
On appveyor ci, with msys2 + mingw-w64-x86_64-clang, linking step fails with messages like undefined reference to llvm_gcda_start_file'`" and so on.

Packages i install manually: mingw-w64-x86_64-{toolchain,gcc,clang,cmake,ninja,libxml2,pugixml,libjpeg-turbo,zlib}

What other information can i provide?

@mati865
Copy link
Collaborator

mati865 commented Feb 3, 2017

I worry one could say:

It's not a bug, it's a feature.

Feature reserved for UNIX like systems: in ToolChains.cpp there are void Darwin::addProfileRTLibs(...) and void Linux::addProfileRTLibs(...) functions but nothing like Windows.
Those functions add aguments to the linker so it can link GCOV/GCDA symbols.

Also MSVC Clang either dumps core or cannot link symbols (depends on tested code):

clang_rt.profile-x86_64.lib(GCDAProfiling.c.obj) : error LNK2019: unresolved external symbol __iob_func referenced in function llvm_gcda_start_file

Unless Clang upstream resolves it I wouldn't expect this feature on Windows.

@LebedevRI
Copy link
Author

Ah, ok then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants