gdb: workaround sparc memcpy fortify error
authorMike Frysinger <vapier@gentoo.org>
Wed, 21 Apr 2010 20:13:41 +0000 (20:13 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 21 Apr 2010 20:13:41 +0000 (20:13 +0000)
Building on an x86_64-linux system with --enable-targets=all fails on the
sparc code with a fortify error:

cc1: warnings being treated as errors
In file included from /usr/include/string.h:640,
                 from gnulib/string.h:23,
                 from ../../gdb/gdb_string.h:25,
                 from ../../gdb/vec.h:25,
                 from ../../gdb/memattr.h:24,
                 from ../../gdb/target.h:60,
                 from ../../gdb/exec.h:23,
                 from ../../gdb/gdbcore.h:31,
                 from ../../gdb/sparc-tdep.c:29:
In function 'memcpy',
    inlined from 'sparc32_store_return_value' at ../../gdb/sparc-tdep.c:1112,
    inlined from 'sparc32_return_value' at ../../gdb/sparc-tdep.c:1170:
/usr/include/bits/string3.h:52: error: call to __builtin___memcpy_chk will
        always overflow destination buffer
make: *** [sparc-tdep.o] Error 1

This is due to the gcc optimizer bug PR37060, so tweak the gdb_assert ()
to avoid the issue.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
gdb/ChangeLog
gdb/sparc-tdep.c

index 0ea0d8aec3c5f6118eec09a9090280525fc67251..2ba55a2694232caf5678bbad716b9468e83d6da3 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-21  Mike Frysinger  <vapier@gentoo.org>
+
+       * gdb/sparc-tdep.c (sparc32_store_return_value): Add gdb_assert ()
+       for len <= 8.
+
 2010-04-21  Chris Moller  <cmoller@redhat.com>
 
        PR 9167
index f129a55003dc86640825b901cd834df6e598ad56..a2bae9f0f5890cae485bd561fba47fc034838abb 100644 (file)
@@ -1105,6 +1105,7 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
 
   gdb_assert (!sparc_structure_or_union_p (type));
   gdb_assert (!(sparc_floating_p (type) && len == 16));
+  gdb_assert (len <= 8);
 
   if (sparc_floating_p (type))
     {
This page took 0.026853 seconds and 4 git commands to generate.