From 6e0b3ebac07c8564cc8f0ed1e4fb5fb66e4458f7 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Mon, 27 Nov 2006 07:48:46 +0000 Subject: [PATCH] Bug 336183 [arm build] undefined reference _PrepareAndDispatch in xpcom_core This is a GCC3.4 fix over a previous GCC fix it obsoletes the poorlly designed patch which was written for bug 307418 moa=timeless git-svn-id: svn://10.0.0.236/trunk@215857 18797224-902f-48f8-a5cc-f745e15eee43 --- .../reflect/xptcall/src/md/unix/xptcstubs_arm.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp index 1aa6bdc8f62..1a9bbe78ef7 100644 --- a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp +++ b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp @@ -44,9 +44,21 @@ #error "This code is for Linux ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour." #endif +#if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) +/* 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 methodIndex, PRUint32* args) asm("_PrepareAndDispatch") -__attribute__((used)); +DONT_DROP_OR_WARN; static nsresult PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint32* args)