aboutsummaryrefslogtreecommitdiff
blob: 77a0220186bd7d3ee8e5b298b77575f4deba118a (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
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp	2017-12-21 09:01:06.826992829 -0800
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp	2017-12-21 09:03:21.110929312 -0800
@@ -12,9 +12,21 @@
 #error "This code is for Linux/iOS ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour."
 #endif
 
+#ifdef __GNUC__
+/* This tells gcc3.4+ not to optimize away symbols.
+ * @see http://gcc.gnu.org/gcc-3.4/changes.html
+ */
+#define DONT_DROP_OR_WARN __attribute__((used))
+#else
+/* This tells older gccs not to warn about unused vairables.
+ * @see http://docs.freebsd.org/info/gcc/gcc.info.Variable_Attributes.html
+ */
+#define DONT_DROP_OR_WARN __attribute__((unused))
+#endif
+
 /* Specify explicitly a symbol for this function, don't try to guess the c++ mangled symbol.  */
 static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args) asm("_PrepareAndDispatch")
-ATTRIBUTE_USED;
+DONT_DROP_OR_WARN;
 
 #ifdef __ARM_EABI__
 #define DOUBLEWORD_ALIGN(p) ((uint32_t *)((((uint32_t)(p)) + 7) & 0xfffffff8))