llvm / llvm-project

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

Coverage option(--coverage) makes a compile error when the souce-code requires -mcmodel=large. #38900

Open ce0850b8-0b77-4c06-bf81-4071c8426082 opened 5 years ago

ce0850b8-0b77-4c06-bf81-4071c8426082 commented 5 years ago
Bugzilla Link 39552
Version unspecified
OS Linux
Attachments The log of compile-error and options
CC @rnk

Extended Description

The libclang_rt.profile-x86_64.a that is used by --coverage is not available when the date of user program exceeds 2GB. When generating this library should I use -mcmodel=large or generate as a dynamic library? Are there any problem when use -mcmodel=large or generate/use dynamic library? (I think the execution performance will be deteriorated if using -mcmodel=large. Any other problems?)

The attached file contains the log of compile-error and options.

ce0850b8-0b77-4c06-bf81-4071c8426082 commented 5 years ago

Thanks for your advice.

How about generating dynamic library (like libclang_rt.profile-x86_64.so)? Using dynamic library can solve this problem as well.

rnk commented 5 years ago

Makes sense. As a workaround, you can recompile compiler-rt with the large code model. The large code model is very rarely used and is full of bugs anyway. I don't think it makes sense for us to package runtime libraries for it, given that.

I do think it makes sense to invest more in the medium code model, which addresses your real use case, of more than 2GB of data, not code. It would be reasonable for us to compile compiler-rt in the medium code model, if we first made it work well.