On Thu, Dec 06, 2012 at 08:46:20AM -0600, Peter Bergner wrote: > On Thu, 2012-12-06 at 09:39 -0500, David Edelsohn wrote: > > On Wed, Dec 5, 2012 at 5:34 PM, Peter Bergner <berg...@vnet.ibm.com> wrote: > > > * config/rs6000/rs6000.c (TARGET_ASAN_SHADOW_OFFSET): Define. > > > (rs6000_asan_shadow_offset): New function. > > > * config/rs6000/rs6000.h (FRAME_GROWS_DOWNWARD): Define to > > > flag_stack_protect != 0 || flag_asan != 0. > > > > The definition of TARGET_ASAN_SHADOW_OFFSET and > > rs6000_asan_shadow_offset need to be limited to TARGET_ELF or ! > > TARGET_XCOFF (Does it work on PPC BSD or PPC Darwin?). > > That's a good question. Having no way to test that myself, I > think limiting it to TARGET_ELF for now is the right solution > and if someone wants it to work on BSD or Darwin, they can > make the requisite changes and test it.
On i?86/x86_64 it is provided for all targets, but only some of the targets build libsanitizer then. Either users get errors at compile time (missing compiler support), or at link time (missing library support). I think the compiler side should error out if the compiler can't support it for some reason, if the only reason is missing library support, you should get a link error. > > That macro determines if GCC thinks -fsanitze=address is supported, > > which it is not on AIX. The macro probably should be defined in sysv4.h, > > not rs6000.c, and the function should not be defined appropriately. > > Ok, I can move the macro there. And by the function being defined > appropriately, do you mean wrapping it in a: > > #ifdef TARGET_ASAN_SHADOW_OFFSET > > or ??? You can also provide the function always, and set targetm.asan_shadow_offset = NULL; for AIX/etc. in some option post-processing target function (somewhere before process_options will try to error out on missing asan support). Jakub