File gcc48-bnc1028744.patch of Package gcc48.23509
Note this is a hack since offset zero is a valid shadow offset but not
used by any target supporting asan in GCC 4.8
Index: gcc/toplev.c
===================================================================
--- gcc/toplev.c (revision 235439)
+++ gcc/toplev.c (working copy)
@@ -1533,7 +1533,8 @@ process_options (void)
/* Address Sanitizer needs porting to each target architecture. */
if (flag_asan
&& (targetm.asan_shadow_offset == NULL
- || !FRAME_GROWS_DOWNWARD))
+ || !FRAME_GROWS_DOWNWARD
+ || targetm.asan_shadow_offset () == 0))
{
warning (0, "-fsanitize=address not supported for this target");
flag_asan = 0;
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 235439)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -31667,6 +31667,9 @@ rs6000_final_prescan_insn (rtx insn, rtx
static unsigned HOST_WIDE_INT
rs6000_asan_shadow_offset (void)
{
+ /* Runtime is not supported on powerpc*le yet. */
+ if (DEFAULT_ABI == ABI_ELFv2)
+ return 0;
return (unsigned HOST_WIDE_INT) 1 << (TARGET_64BIT ? 41 : 29);
}
#endif