~ubuntu-branches/ubuntu/trusty/gcc-snapshot/trusty

« back to all changes in this revision

Viewing changes to debian/patches/arm-sanitizer.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-12 14:56:42 UTC
  • mfrom: (1.20.14) (135.1.29 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130512145642-jkg0131tyv5io67o
Tags: 20130512-0ubuntu1
Snapshot, taken from the trunk (20130512)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Enable libsanitizer on ARM.
 
2
 
 
3
--- a/src/gcc/config/arm/arm.c  2013-02-28 10:26:41 +0000
 
4
+++ b/src/gcc/config/arm/arm.c  2013-03-04 08:39:02 +0000
 
5
@@ -280,6 +280,8 @@
 
6
 
 
7
 static void arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
 
8
                                         bool op0_preserve_value);
 
9
+static unsigned HOST_WIDE_INT arm_asan_shadow_offset (void);
 
10
+
 
11
 
 
12
 /* Table of machine attributes.  */
 
13
 static const struct attribute_spec arm_attribute_table[] =
 
14
@@ -649,6 +651,9 @@
 
15
 #define TARGET_CANONICALIZE_COMPARISON \
 
16
   arm_canonicalize_comparison
 
17
 
 
18
+#undef TARGET_ASAN_SHADOW_OFFSET
 
19
+#define TARGET_ASAN_SHADOW_OFFSET arm_asan_shadow_offset
 
20
+
 
21
 struct gcc_target targetm = TARGET_INITIALIZER;
 
22
 
 
23
 /* Obstack for minipool constant handling.  */
 
24
@@ -27393,4 +27398,12 @@
 
25
 
 
26
 }
 
27
 
 
28
+/* Implement the TARGET_ASAN_SHADOW_OFFSET hook.  */
 
29
+
 
30
+static unsigned HOST_WIDE_INT
 
31
+arm_asan_shadow_offset (void)
 
32
+{
 
33
+  return (unsigned HOST_WIDE_INT) 1 << 29;
 
34
+}
 
35
+
 
36
 #include "gt-arm.h"
 
37
 
 
38
--- a/src/gcc/config/arm/linux-eabi.h   2013-01-10 20:38:27 +0000
 
39
+++ b/src/gcc/config/arm/linux-eabi.h   2013-03-26 09:59:11 +0000
 
40
@@ -84,10 +84,14 @@
 
41
   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,                         \
 
42
                       LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
 
43
 
 
44
+#undef  ASAN_CC1_SPEC
 
45
+#define ASAN_CC1_SPEC "%{fsanitize=*:-funwind-tables}"
 
46
+
 
47
 #undef  CC1_SPEC
 
48
 #define CC1_SPEC                                                       \
 
49
-  LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC,                       \
 
50
-                      GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
 
51
+  LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC,     \
 
52
+                      GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " "   \
 
53
+                      ANDROID_CC1_SPEC)
 
54
 
 
55
 #define CC1PLUS_SPEC \
 
56
   LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
 
57
 
 
58
--- a/src/libsanitizer/configure.tgt    2013-02-11 23:13:37 +0000
 
59
+++ b/src/libsanitizer/configure.tgt    2013-03-04 08:39:02 +0000
 
60
@@ -29,6 +29,8 @@
 
61
        ;;
 
62
   sparc*-*-linux*)
 
63
        ;;
 
64
+  arm*-*-linux*)
 
65
+       ;;
 
66
   x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
 
67
        TSAN_SUPPORTED=no
 
68
        ;;
 
69