summaryrefslogtreecommitdiff
path: root/patches/glibc/ports-2.14/090-Fix-ARM-build-with-GCC-trunk.patch
blob: 1a632fe4028b3a101ff2f7d8687a379934d5fe38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From 175cef4163dd60f95106cfd5f593b8a4e09d02c9 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 20 May 2014 21:27:13 +0000
Subject: [PATCH] Fix ARM build with GCC trunk.

sysdeps/unix/sysv/linux/arm/unwind-resume.c and
sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c have static
variables that are written in C code but only read from toplevel asms.
Current GCC trunk now optimizes away such apparently write-only static
variables, so causing a build failure.  This patch marks those
variables with __attribute_used__ to avoid that optimization.

Tested that this fixes the build for ARM.

	* sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c
	(libgcc_s_resume): Use __attribute_used__.
	* sysdeps/unix/sysv/linux/arm/unwind-resume.c (libgcc_s_resume):
	Likewise.
---
 sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c | 3 ++-
 sysdeps/unix/sysv/linux/arm/unwind-resume.c       | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -23,7 +23,8 @@
 #include <pthreadP.h>

 static void *libgcc_s_handle;
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+  __attribute_used__;
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
    struct _Unwind_Context *);
 static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
diff --git a/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/unwind-resume.c
index bff3e2b..1f1eb71 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
@@ -21,7 +21,8 @@
 #include <stdio.h>
 #include <unwind.h>

-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+  __attribute_used__;
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
    struct _Unwind_Context *);
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-forcedunwind.c
@@ -23,7 +23,8 @@
 #include <pthreadP.h>

 static void *libgcc_s_handle;
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+  __attribute_used__;
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
 static _Unwind_Reason_Code (*libgcc_s_forcedunwind)
--- a/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/eabi/nptl/unwind-resume.c
@@ -21,7 +21,8 @@
 #include <stdio.h>
 #include <unwind.h>

-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+  __attribute_used__;
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);