[PATCH] gprofng: a new GNU profiler

Joseph Myers joseph@codesourcery.com
Thu Aug 12 14:50:39 GMT 2021


On Thu, 12 Aug 2021, Joseph Myers wrote:

> I'm concerned about the definitions such as -D__i386 that you're using 
> based on the target, because there might be host headers using such 
> defines to test whether the *host* is i386.  I think you need to avoid any 

And, in any case, an i386 compiler predefines __i386 itself.  So the 
effect of this patch is that "#ifdef __i386" conditionals in gprofng 
itself will be active both for i386 host (possibly with a non-i386 
target), where the compiler predefines the macro and for i386 target 
(possibly with a non-i386 host), where configure.ac defines the macro.  
That seems unlikely to be correct.

You'll need to figure out, for each such conditional in gprofng, whether 
(a) it should be a host conditional (there should be very few if any host 
conditionals in portable code), (b) it should be a target conditional or 
(c) the code it's in is native-only and shouldn't be built at all if host 
!= target.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Binutils mailing list