[PATCH v2] gcov: Add GCOV_TYPE_SIZE target macro

Joseph Myers joseph@codesourcery.com
Tue Aug 10 21:05:44 GMT 2021


On Tue, 10 Aug 2021, Sebastian Huber wrote:

> Ok, I understood how I can add a compiler provided define for libgcov. What is
> not clear to me is how I can add a target hook, set a default value, and
> customize it for a target/system. Is this described here
> 
> https://gcc.gnu.org/onlinedocs/gccint/Target-Structure.html

Yes.

It's simplest when the hook definition depends only on the target 
architecture and not the target OS, but you can work around that when the 
OS affects the definition (have an architecture-specific function used as 
the hook definition, with a #if condition inside that function based on 
definitions from architecture-and-OS-specific headers, for example).

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Gcc-patches mailing list