[PATCH v2] gcov: Add GCOV_TYPE_SIZE target macro

Sebastian Huber sebastian.huber@embedded-brains.de
Tue Aug 10 18:03:32 GMT 2021

On 10/08/2021 19:30, Joseph Myers wrote:
> On Tue, 10 Aug 2021, Sebastian Huber wrote:
>> If -fprofile-update=atomic is used, then the target must provide atomic
>> operations for the counters of the type returned by get_gcov_type().
>> This is a 64-bit type for targets which have a 64-bit long long type.
>> On 32-bit targets this could be an issue since they may not provide
>> 64-bit atomic operations.  Allow targets to override the default type
>> size with the new GCOV_TYPE_SIZE target macro.
> Any target macro needs to be documented in tm.texi.in (and tm.texi
> regenerated).
> Please don't add new target macros that are used in both host and target
> code; every such macro is an obstruction to removing inclusion of the host
> tm.h from libgcc.  The appropriate way to handle sharing such
> configuration information is to provide a target hook in the host compiler
> code, and then make c-cppbuiltin.c:c_cpp_builtins define a corresponding
> predefined macro under the "if (flag_building_libgcc)" conditional.
> (Although a target hook is generally preferable to a target macro for
> host-side configuration, when a target macro is used on the host it's
> still desirable not to use it directly in target libraries but to use a
> predefined macro instead.)

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



embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:

More information about the Gcc-patches mailing list