Bug 684659 - Drop references to really old gcc versions.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Fri, 09 Sep 2011 19:38:28 -0400
changeset 76856 b08c94bd7f2e85a33292c7fec8d5a1c65e9cce89
parent 76855 f06272a4447f6dc59cf8cd5c76a299413694ea14
child 76857 d18ca8ae27627fb64e661c0c8611573b936d772f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
bugs684659
milestone9.0a1
Bug 684659 - Drop references to really old gcc versions.
xpcom/reflect/xptcall/src/md/unix/xptc_gcc_x86_unix.h
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s
xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
--- a/xpcom/reflect/xptcall/src/md/unix/xptc_gcc_x86_unix.h
+++ b/xpcom/reflect/xptcall/src/md/unix/xptc_gcc_x86_unix.h
@@ -50,43 +50,10 @@
 #endif
 
 #ifdef MOZ_NEED_LEADING_UNDERSCORE
 #define SYMBOL_UNDERSCORE "_"
 #else
 #define SYMBOL_UNDERSCORE
 #endif
 
-/*
-  What are those keeper functions?
 
-  The problem: gcc doesn't know that the assembler routines call
-  static functions so gcc may not emit the definition (i.e., the
-  code) for these functions. In gcc 3.1 and up
-    "__attribute__ ((used))" exists and solves the problem.
-  For older gcc versions it's not so easy. One could use the
-  -fkeep-inline-functions but that keeps a surprising number of
-  functions which bloats the compiled library. It seems otherwise
-  harmless, though. Alternatively, one could use
-  -fno-inline-functions which works right now but might cause a
-  slowdown under some circumstances. The problem with these methods
-  is that they do not automatically adapt to the compiler used.
-
-  The best solution seems to be to create dummy functions that
-  reference the appropriate static functions. It's then necessary
-  to "use" these functions in a way that gcc will not optimize
-  away. The keeper functions use assembly code to confuse gcc.
-
-  One drawback is that the keeper functions are externally visible
-  so they shouldn't do anything harmful.
-
-  With the right linker, one could make the keeper functions local
-  so they wouldn't be visible.
- */
-
-
-// gcc 3.1 and up
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define ATTRIBUTE_USED __attribute__ ((__used__))
-#else
-#define ATTRIBUTE_USED
-#endif
-
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_alpha_openbsd.cpp
@@ -157,21 +157,17 @@ invoke_copy_to_stack(PRUint64* d, PRUint
     "addq $30,48,$30\n\t"   /* remove params from stack */
 
     /*
      * Call the virtual function with the constructed stack frame.
      */
     "bis $16,$16,$1\n\t"    /* load "this" */
     "ldq $2,16($15)\n\t"    /* load "methodIndex" */
     "ldq $1,0($1)\n\t"      /* load vtable */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "s8addq $2,$31,$2\n\t"  /* vtable index = "methodIndex" * 8 */
-#else /* not G++ V3 ABI */
-    "s8addq $2,16,$2\n\t"   /* vtable index = "methodIndex" * 8 + 16 */
-#endif /* G++ V3 ABI */
     "addq $1,$2,$1\n\t"
     "ldq $27,0($1)\n\t"     /* load address of function */
     "jsr $26,($27),0\n\t"   /* call virtual function */
     "ldgp $29,0($26)\n\t"
 
     "bis $15,$15,$30\n\t"
     "ldq $26,0($30)\n\t"
     "ldq $15,8($30)\n\t"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp
@@ -182,21 +182,17 @@ NS_InvokeByIndex(nsISupports* that, PRUi
  * allocation of arguments is unsafe to be inlined in this function.
  */
   PRUint32 *stack_space = (PRUint32 *) __builtin_alloca(base_size * 8);
 
   invoke_copy_to_stack(stack_space, &stack_space[base_size * 2],
                        paramCount, params);
 
   vtable = *reinterpret_cast<vtable_func **>(that);
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
   func = vtable[methodIndex];
-#else /* non G++ V3 ABI */
-  func = vtable[2 + methodIndex];
-#endif
 
   return func(that, stack_space[base_size * 2 - 3],
                     stack_space[base_size * 2 - 2],
                     stack_space[base_size * 2 - 1]);
 }    
 
 #else /* __ARM_PCS_VFP */
 
@@ -381,21 +377,17 @@ invoke_copy_to_stack(PRUint32* stk, PRUi
 
 typedef PRUint32 (*vtable_func)(nsISupports *, PRUint32, PRUint32, PRUint32);
 
 EXPORT_XPCOM_API(nsresult)
 NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
                    PRUint32 paramCount, nsXPTCVariant* params)
 {
   vtable_func *vtable = *reinterpret_cast<vtable_func **>(that);
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
   vtable_func func = vtable[methodIndex];
-#else /* non G++ V3 ABI */
-  vtable_func func = vtable[2 + methodIndex];
-#endif
   // 'register PRUint32 result asm("r0")' could be used here, but it does not
   //  seem to be reliable in all cases: http://gcc.gnu.org/PR46164
   PRUint32 result;
   asm (
     "mov    r3, sp\n"
     "mov    %[stack_space_size], %[param_count_plus_2], lsl #3\n"
     "tst    r3, #4\n" /* check stack alignment */
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm_openbsd.cpp
@@ -186,22 +186,17 @@ NS_InvokeByIndex(nsISupports* that, PRUi
     "ldr	r2, [%1, #12]	\n\t"	/* =params				*/
     "ldr	ip, [%1, #20]	\n\t"	/* =invoke_copy_to_stack		*/
     "mov	lr, pc		\n\t"	/* copy args to the stack like the	*/
     "mov	pc, ip		\n\t"	/* compiler would.			*/
     "ldr	r0, [%1]	\n\t"	/* =that				*/
     "ldr	r1, [r0, #0]	\n\t"	/* get that->vtable offset		*/
     "ldr	r2, [%1, #4]	\n\t"
     "mov	r2, r2, lsl #2	\n\t"	/* a vtable_entry(x)=8 + (4 bytes * x)	*/
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "ldr        ip, [r1, r2]    \n\t"	/* get method adress from vtable        */
-#else /* non G++ V3 ABI */
-    "add	r2, r2, #8	\n\t"	/* with this compilers			*/
-    "ldr	ip, [r1, r2]	\n\t"	/* get method adress from vtable	*/
-#endif
     "cmp	r4, #12		\n\t"	/* more than 3 arguments???		*/
     "ldmgtia	sp!, {r1, r2, r3}\n\t"	/* yes: load arguments for r1-r3	*/
     "subgt	r4, r4, #12	\n\t"	/*      and correct the stack pointer	*/
     "ldmleia	sp, {r1, r2, r3}\n\t"	/* no:  load r1-r3 from stack		*/ 
     "addle	sp, sp, r4	\n\t"	/*      and restore stack pointer	*/
     "movle	r4, #0		\n\t"	/*	a mark for restoring sp		*/
     "ldr	r0, [%1, #0]	\n\t"	/* get (self)				*/
     "mov	lr, pc		\n\t"	/* call mathod				*/
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s
@@ -132,21 +132,17 @@ 1:	subu	sp, v0
 	# calculate the function we need to jump to, which must then be
 	# stored in t9
 	lw	a0, A0OFF(fp)	# a0 = set "that" to be "this"
 	lw	t0, A1OFF(fp)	# a1 = methodIndex
 	lw	t9, 0(a0)
 	# t0 = methodIndex << PTRLOG
 	sll	t0, t0, PTRLOG
 	addu	t9, t0
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 	lw	t9, (t9)
-#else /* not G++ V3 ABI */
-	lw	t9, 2*PTRSIZE(t9)
-#endif /* G++ V3 ABI */
 
 	# Set a1-a3 to what invoke_copy_to_stack told us. a0 is already
 	# the "this" pointer. We don't have to care about floating
 	# point arguments, the non-FP "this" pointer as first argument
 	# means they'll never be used.
 	lw	a1, 1*SZREG(sp)
 	lw	a2, 2*SZREG(sp)
 	lw	a3, 3*SZREG(sp)
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
@@ -108,21 +108,17 @@ NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
     # t1 = methodIndex * pow(2, PTRLOG)
     # (use shift instead of mult)
     sll      t1, a1, PTRLOG
 
     # calculate the function we need to jump to,
     # which must then be saved in t9
     lw       t9, 0(a0)
     addu     t9, t9, t1
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     lw       t9, (t9)
-#else /* not G++ V3 ABI */
-    lw       t9, 2*PTRSIZE(t9)
-#endif /* G++ V3 ABI */
 
     # get register save area from invoke_copy_to_stack
     subu     t1, t3, 64
 
     # a1..a7 and f13..f19 should now be set to what
     # invoke_copy_to_stack told us. skip a0 and f12
     # because that's the "this" pointer
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_linux.s
@@ -102,19 +102,16 @@ NS_InvokeByIndex_P:
 	lfd     f5,64(r30)  
 	lfd     f6,72(r30)  
 	lfd     f7,80(r30)  
 	lfd     f8,88(r30)
 #endif
 	lwz     r3,8(r31)			// r3 <= that
 	lwz     r4,12(r31)			// r4 <= methodIndex
 	lwz     r5,0(r3)			// r5 <= vtable ( == *that )
-#if !((__GNUC__ == 3 && __GNUC_MINOR__ < 2) || __GXX_ABI_VERSION  >= 100) // G++ pre-V3 ABI
-	addi	r4,r4,2				// skip first two vtable entries
-#endif
 	slwi    r4,r4,2				// convert to offset ( *= 4 )
 	lwzx    r0,r5,r4			// r0 <= methodpointer ( == vtable + offset )
 
         lwz     r4,4(r30)			// load GP regs with method parameters
 	lwz     r5,8(r30)   
 	lwz     r6,12(r30)  
 	lwz     r7,16(r30)  
 	lwz     r8,20(r30)  
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_ppc_openbsd.s
@@ -97,19 +97,16 @@ NS_InvokeByIndex_P:
 	lfd	f5,64(r30)
 	lfd	f6,72(r30)
 	lfd	f7,80(r30)
 	lfd	f8,88(r30)
 
 	lwz	r3,8(r31)			// r3 <= that
 	lwz	r4,12(r31)			// r4 <= methodIndex
 	lwz	r5,0(r3)			// r5 <= vtable ( == *that )
-#if !((__GNUC__ == 3 && __GNUC_MINOR__ < 2) || __GXX_ABI_VERSION >= 100) // G++ pre-V3 ABI
-	addi	r4,r4,2				// skip first two vtable entries
-#endif
 	slwi	r4,r4,2				// convert to offset ( *= 4 )
 	lwzx	r0,r5,r4			// r0 <= methodpointer ( == vtable + offset )
 
 	lwz	r4,4(r30)			// load GP regs with method parameters
 	lwz	r5,8(r30)
 	lwz	r6,12(r30)
 	lwz	r7,16(r30)
 	lwz	r8,20(r30)
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp
@@ -32,18 +32,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* Platform specific code to invoke XPCOM methods on native objects */
 
-#ifdef __GNUC__            /* Gnu compiler. */
-
 #include "xptcprivate.h"
 #include "xptc_platforms_unixish_x86.h"
 #include "xptc_gcc_x86_unix.h"
 
 extern "C" {
 #ifndef XP_WIN32
 static
 #endif
@@ -64,37 +62,16 @@ invoke_copy_to_stack(PRUint32 paramCount
         case nsXPTType::T_U64    : *((PRUint64*)d) = s->val.u64; d++;    break;
         case nsXPTType::T_DOUBLE : *((double*)  d) = s->val.d;   d++;    break;
         default                  : *((void**)d)    = s->val.p;           break;
         }
     }
 }
 } // extern "C"
 
-// NOTE! See xptc_gcc_x86_unix.h for the reason why this function exists.
-#if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0))
-PRUint32
-xptc_invoke_copy_to_stack_keeper (void)
-{
-    PRUint32 dummy1;
-    void ATTRIBUTE_USED __attribute__ ((regparm(3))) (*dummy2)
-	(PRUint32, nsXPTCVariant*, PRUint32*) = invoke_copy_to_stack;
-
-// dummy2 references invoke_copy_to_stack, now we have to "use" it
-    __asm__ __volatile__ (
-	""
-	: "=&a" (dummy1)
-	: "g"   (dummy2)
-    );
-
-    return dummy1 & 0xF0F00000;
-}
-#endif
-
-
 /*
   EXPORT_XPCOM_API(nsresult)
   NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
                    PRUint32 paramCount, nsXPTCVariant* params);
 
   Each param takes at most two 4-byte words.
   It doesn't matter if we push too many words, and calculating the exact
   amount takes time.
@@ -182,29 +159,21 @@ extern "C" {
 	"movswl (%edx), %eax\n\t"       /* 'this' offset */
 	"addl  %eax, %ecx\n\t"
 	"pushl %ecx\n\t"
 	"addl  $4, %edx\n\t"	        /* += 4, method pointer */
 #else /* THUNK_BASED_THIS_ADJUST */
 	"pushl %ecx\n\t"
 	"movl  (%ecx), %edx\n\t"
 	"movl  0x0c(%ebp), %eax\n\t"    /* function index */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 	"leal  (%edx,%eax,4), %edx\n\t"
-#else /* not G++ V3 ABI  */
-	"leal  8(%edx,%eax,4), %edx\n\t"
-#endif /* G++ V3 ABI */
 #endif
 	"call  *(%edx)\n\t"
 #ifdef MOZ_PRESERVE_PIC
 	"movl  -4(%ebp), %ebx\n\t"
 #endif
 	"movl  %ebp, %esp\n\t"
 	"popl  %ebp\n\t"
 	"ret\n"
 #if !defined(XP_WIN32) && !defined(XP_OS2)
 	".size " SYMBOL_UNDERSCORE "NS_InvokeByIndex_P, . -" SYMBOL_UNDERSCORE "NS_InvokeByIndex_P\n\t"
 #endif
 );
-
-#else
-#error "can't find a compiler to use"
-#endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_alpha.cpp
@@ -157,21 +157,17 @@ invoke_copy_to_stack(PRUint64* d, PRUint
     "addq $30,48,$30\n\t"   /* remove params from stack */
 
     /*
      * Call the virtual function with the constructed stack frame.
      */
     "bis $16,$16,$1\n\t"    /* load "this" */
     "ldq $2,16($15)\n\t"    /* load "methodIndex" */
     "ldq $1,0($1)\n\t"      /* load vtable */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "s8addq $2,$31,$2\n\t"  /* vtable index = "methodIndex" * 8 */
-#else /* not G++ V3 ABI */
-    "s8addq $2,16,$2\n\t"   /* vtable index = "methodIndex" * 8 + 16 */
-#endif /* G++ V3 ABI */
     "addq $1,$2,$1\n\t"
     "ldq $27,0($1)\n\t"     /* load address of function */
     "jsr $26,($27),0\n\t"   /* call virtual function */
     "ldgp $29,0($26)\n\t"
 
     "bis $15,$15,$30\n\t"
     "ldq $26,0($30)\n\t"
     "ldq $15,8($30)\n\t"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp
@@ -140,21 +140,17 @@ NS_InvokeByIndex_P(nsISupports* that, PR
     "subl  %5, %%sp\n\t"      /* make room for params */
     "movel %4, %%sp@-\n\t"
     "movel %3, %%sp@-\n\t"
     "pea   %%sp@(8)\n\t"
     "jbsr  invoke_copy_to_stack\n\t"   /* copy params */
     "addw  #12, %%sp\n\t"
     "movel %1, %%sp@-\n\t"
     "movel %1@, %%a0\n\t"
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "movel %%a0@(%2:l:4), %%a0\n\t"
-#else /* not V3 */
-    "movel %%a0@(8,%2:l:4), %%a0\n\t"
-#endif
     "jbsr  %%a0@\n\t"         /* safe to not cleanup sp */
     "lea   %%sp@(4,%5:l), %%sp\n\t"
     "movel %%d0, %0"
     : "=d" (result)         /* %0 */
     : "a" (that),           /* %1 */
       "d" (methodIndex),    /* %2 */
       "g" (paramCount),     /* %3 */
       "g" (params),         /* %4 */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp
@@ -200,21 +200,17 @@ invoke_copy_to_stack(PRUint32 paramCount
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
 NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
                  PRUint32 paramCount, nsXPTCVariant* params)
 {
     PRUint32 *vtable = *(PRUint32 **)that;
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     PRUint32 method = vtable[methodIndex];
-#else /* not G++ V3 ABI  */
-    PRUint32 method = vtable[methodIndex + 2];
-#endif /* G++ V3 ABI */ 
     PRUint32 overflow = invoke_count_words (paramCount, params);
     PRUint32 result;
 
     __asm__ __volatile__
     (
         "lr    7,15\n\t"
         "ahi   7,-32\n\t"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp
@@ -194,21 +194,17 @@ invoke_copy_to_stack(PRUint32 paramCount
     }
 }
 
 EXPORT_XPCOM_API(nsresult)
 NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
                  PRUint32 paramCount, nsXPTCVariant* params)
 {
     PRUint64 *vtable = *(PRUint64 **)that;
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     PRUint64 method = vtable[methodIndex];
-#else /* not G++ V3 ABI  */
-    PRUint64 method = vtable[methodIndex + 2];
-#endif /* G++ V3 ABI */
     PRUint64 overflow = invoke_count_words (paramCount, params);
     PRUint64 result;
 
     __asm__ __volatile__
     (
         "lgr    7,15\n\t"
         "aghi   7,-64\n\t"
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_nto_arm.cpp
@@ -189,22 +189,17 @@ XPTC_InvokeByIndex(nsISupports* that, PR
     "ldr	r2, [%1, #12]	\n\t"	/* =params				*/
     "ldr	ip, [%1, #20]	\n\t"	/* =invoke_copy_to_stack		*/
     "mov	lr, pc		\n\t"	/* copy args to the stack like the	*/
     "mov	pc, ip		\n\t"	/* compiler would.			*/
     "ldr	r0, [%1]	\n\t"	/* =that				*/
     "ldr	r1, [r0, #0]	\n\t"	/* get that->vtable offset		*/
     "ldr	r2, [%1, #4]	\n\t"
     "mov	r2, r2, lsl #2	\n\t"	/* a vtable_entry(x)=8 + (4 bytes * x)	*/
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "ldr        ip, [r1, r2]    \n\t"   /* get method adress from vtable        */
-#else /* non G++ V3 ABI */
-    "add	r2, r2, #8	\n\t"	/* with this compilers			*/
-    "ldr	ip, [r1, r2]	\n\t"	/* get method adress from vtable	*/
-#endif
     "cmp	r4, #12		\n\t"	/* more than 3 arguments???		*/
     "ldmgtia	sp!, {r1, r2, r3}\n\t"	/* yes: load arguments for r1-r3	*/
     "subgt	r4, r4, #12	\n\t"	/*      and correct the stack pointer	*/
     "ldmleia	sp, {r1, r2, r3}\n\t"	/* no:  load r1-r3 from stack		*/ 
     "addle	sp, sp, r4	\n\t"	/*      and restore stack pointer	*/
     "movle	r4, #0		\n\t"	/*	a mark for restoring sp		*/
     "ldr	r0, [%1, #0]	\n\t"	/* get (self)				*/
     "mov	lr, pc		\n\t"	/* call mathod				*/
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_unixish_x86.cpp
@@ -72,17 +72,16 @@ invoke_copy_to_stack(PRUint32 paramCount
 }
 
 }
 
 EXPORT_XPCOM_API(nsresult)
 NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
                  PRUint32 paramCount, nsXPTCVariant* params)
 {
-#ifdef __GNUC__            /* Gnu compiler. */
   PRUint32 result;
   /* Each param takes at most 2, 4-byte words
      It doesn't matter if we push too many words, and calculating the exact
      amount takes time. */
   PRUint32 n = paramCount << 3;
   void (*fn_copy) (unsigned int, nsXPTCVariant *, PRUint32 *) = invoke_copy_to_stack;
   int temp1, temp2;
  
@@ -137,21 +136,17 @@ NS_InvokeByIndex_P(nsISupports* that, PR
     "movswl (%%edx), %%eax\n\t" /* 'this' offset */
     "addl  %%eax, %%ecx\n\t"
     "pushl %%ecx\n\t"
     "addl  $4, %%edx\n\t"   /* += 4, method pointer */
 #else /* THUNK_BASED_THIS_ADJUST */
     "pushl %%ecx\n\t"
     "movl  (%%ecx), %%edx\n\t"
     "movl  %5, %%eax\n\t"   /* function index */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
     "leal  (%%edx,%%eax,4), %%edx\n\t"
-#else /* not G++ V3 ABI  */
-    "leal  8(%%edx,%%eax,4), %%edx\n\t"
-#endif /* G++ V3 ABI */
 #endif
     "call  *(%%edx)\n\t"    /* safe to not cleanup esp */
 #ifdef KEEP_STACK_16_BYTE_ALIGNED
     "movl  %3, %%esp\n\t"
 #else
     "addl  $4, %%esp\n\t"
     "addl  %8, %%esp"
 #endif
@@ -174,14 +169,9 @@ NS_InvokeByIndex_P(nsISupports* that, PR
 #else
       "g" (n),              /* %8 */
 #endif
       "0" (fn_copy)         /* %9 */
     : "memory"
     );
     
   return result;
-
-#else
-#error "can't find a compiler to use"
-#endif /* __GNUC__ */
-
 }    
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_alpha_openbsd.cpp
@@ -194,40 +194,29 @@ symbol ":"                    "\n\t" \
     ".frame $30,0,$26,0"      "\n\t" \
     "ldgp $29,0($27)"         "\n"   \
 "$" symbol "..ng:"            "\n\t" \
     ".prologue 1"             "\n\t" \
     "lda $1,"#n               "\n\t" \
     "br $31,$SharedStub..ng"  "\n\t" \
     ".end " symbol
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
-
 #define STUB_ENTRY(n) \
 __asm__( \
     ".if "#n" < 10"                                              "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase5Stub"#n"Ev")  "\n\t" \
     ".elseif "#n" < 100"                                         "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase6Stub"#n"Ev")  "\n\t" \
     ".elseif "#n" < 1000"                                        "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase7Stub"#n"Ev")  "\n\t" \
     ".else"                                                      "\n\t" \
     ".err \"Stub"#n" >= 1000 not yet supported.\""               "\n\t" \
     ".endif" \
     );
 
-#else /* not G++ V3 ABI */
-
-#define STUB_ENTRY(n) \
-__asm__( \
-    STUB_MANGLED_ENTRY(n, "Stub"#n"__14nsXPTCStubBase") \
-    );
-
-#endif /* G++ V3 ABI */
-
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_openbsd.cpp
@@ -151,17 +151,16 @@ PrepareAndDispatch(nsXPTCStubBase * self
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
 
     return result;
 }
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 // Linux/x86-64 uses gcc >= 3.1
 #define STUB_ENTRY(n) \
 asm(".section	\".text\"\n\t" \
     ".align	2\n\t" \
     ".if	" #n " < 10\n\t" \
     ".globl	_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".hidden	_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".type	_ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
@@ -227,12 +226,8 @@ asm(".section   \".text\"\n\t"
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
-
-#else
-#error "Unsupported compiler. Use gcc >= 3.1 for Linux/x86-64."
-#endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm.cpp
@@ -178,17 +178,17 @@ SharedStub:							\n\
 /*
  * Create sets of stubs to call the SharedStub.
  * We don't touch the stack here, nor any registers, other than IP.
  * IP is defined to be corruptable by a called function, so we are
  * safe to use it.
  *
  * This will work with or without optimisation.
  */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
+
 /*
  * Note : As G++3 ABI contains the length of the functionname in the
  *  mangled name, it is difficult to get a generic assembler mechanism like
  *  in the G++ 2.95 case.
  *  Create names would be like :
  *    _ZN14nsXPTCStubBase5Stub9Ev
  *    _ZN14nsXPTCStubBase6Stub13Ev
  *    _ZN14nsXPTCStubBase7Stub144Ev
@@ -232,29 +232,16 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 { \
   __asm__ (	  		        \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");                               \
   return 0; /* avoid warnings */                                \
 }
 #endif
 
-#else /* G++2.95 ABI */
-
-#define STUB_ENTRY(n)						\
-  __asm__(							\
-	".section \".text\"\n"					\
-"	.align\n"						\
-"	.globl	Stub"#n"__14nsXPTCStubBase\n"			\
-"	.type	Stub"#n"__14nsXPTCStubBase,#function\n\n"	\
-"Stub"#n"__14nsXPTCStubBase:\n"					\
-"	mov	ip, #"#n"\n"					\
-"	b	SharedStub\n\t");
-
-#endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm_openbsd.cpp
@@ -168,17 +168,17 @@ SharedStub:							\n\
 /*
  * Create sets of stubs to call the SharedStub.
  * We don't touch the stack here, nor any registers, other than IP.
  * IP is defined to be corruptable by a called function, so we are
  * safe to use it.
  *
  * This will work with or without optimisation.
  */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
+
 /*
  * Note : As G++3 ABI contains the length of the functionname in the
  *  mangled name, it is difficult to get a generic assembler mechanism like
  *  in the G++ 2.95 case.
  *  Create names would be like :
  *    _ZN14nsXPTCStubBase5Stub9Ev
  *    _ZN14nsXPTCStubBase6Stub13Ev
  *    _ZN14nsXPTCStubBase7Stub144Ev
@@ -222,29 +222,16 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 { \
   __asm__ (	  		        \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");                               \
   return 0; /* avoid warnings */                                \
 }
 #endif
 
-#else /* G++2.95 ABI */
-
-#define STUB_ENTRY(n)						\
-  __asm__(							\
-	".section \".text\"\n"					\
-"	.align\n"						\
-"	.globl	Stub"#n"__14nsXPTCStubBase\n"			\
-"	.type	Stub"#n"__14nsXPTCStubBase,#function\n\n"	\
-"Stub"#n"__14nsXPTCStubBase:\n"					\
-"	mov	ip, #"#n"\n"					\
-"	b	SharedStub\n\t");
-
-#endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s
@@ -44,17 +44,16 @@
 
 #define A0OFF (FRAMESZ + (0*SZREG))
 #define A1OFF (FRAMESZ + (1*SZREG))
 #define A2OFF (FRAMESZ + (2*SZREG))
 #define A3OFF (FRAMESZ + (3*SZREG))
 
 	.text
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 #define STUB_ENTRY(x)						\
 	.if x < 10;						\
 	.globl	_ZN14nsXPTCStubBase5Stub ##x ##Ev;		\
 	.type	_ZN14nsXPTCStubBase5Stub ##x ##Ev,@function;	\
 	.aent	_ZN14nsXPTCStubBase5Stub ##x ##Ev,0;		\
 _ZN14nsXPTCStubBase5Stub ##x ##Ev:;				\
 	SETUP_GP;						\
 	li	t0,x;						\
@@ -73,26 +72,16 @@
 	.aent	_ZN14nsXPTCStubBase7Stub ##x ##Ev,0;		\
 _ZN14nsXPTCStubBase7Stub ##x ##Ev:;				\
 	SETUP_GP;						\
 	li	t0,x;						\
 	b	sharedstub;					\
 	.else;							\
 	.err;							\
 	.endif
-#else /* not G++ V3 ABI */
-#define STUB_ENTRY(x)						\
-	.globl	Stub ##x ##__14nsXPTCStubBase;			\
-	.type	Stub ##x ##__14nsXPTCStubBase,@function;	\
-	.aent	Stub ##x ##__14nsXPTCStubBase,0;		\
-Stub ##x ##__14nsXPTCStubBase:;					\
-	SETUP_GP;						\
-	li	t0,x;						\
-	b	sharedstub
-#endif /* G++ V3 ABI */
 
 # SENTINEL_ENTRY is handled in the cpp file.
 #define SENTINEL_ENTRY(x)
 
 #
 # open a dummy frame for the function entries
 #
 	.align	2
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
@@ -56,31 +56,26 @@ F14OFF=FRAMESZ-(15*SZREG)
 F15OFF=FRAMESZ-(14*SZREG)
 F16OFF=FRAMESZ-(13*SZREG)
 F17OFF=FRAMESZ-(12*SZREG)
 F18OFF=FRAMESZ-(11*SZREG)
 F19OFF=FRAMESZ-(10*SZREG)
 
 #define SENTINEL_ENTRY(n)         /* defined in cpp file, not here */
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 #define STUB_ENTRY(x)                                   \
     .if x < 10;                                         \
     MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev);    \
     .elseif x < 100;                                    \
     MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev);    \
     .elseif x < 1000;                                   \
     MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev);    \
     .else;                                              \
     .err;                                               \
     .endif
-#else /* not G++ V3 ABI */
-#define STUB_ENTRY(x)                                   \
-    MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase)
-#endif /* G++ V3 ABI */
 
 #define MAKE_STUB(x, name)                              \
     .globl   name;                                      \
     .type    name,@function;                            \
     .aent    name,0;                                    \
 name:;                                                  \
     PTR_SUBU sp,FRAMESZ;                                \
     SETUP_GP64(GPOFF, name);                            \
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
@@ -32,18 +32,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /* Implement shared vtbl methods. */
 
-#ifdef __GNUC__         /* Gnu Compiler. */
-
 #include "xptcprivate.h"
 #include "xptiprivate.h"
 #include "xptc_platforms_unixish_x86.h"
 #include "xptc_gcc_x86_unix.h"
 
 extern "C" {
 static nsresult ATTRIBUTE_USED
 __attribute__ ((regparm (3)))
@@ -96,35 +94,16 @@ PrepareAndDispatch(uint32 methodIndex, n
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
 
     return result;
 }
 } // extern "C"
 
-// NOTE! See xptc_gcc_x86_unix.h for the reason this function exists.
-#if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0))
-PRUint32
-xptc_PrepareAndDispatch_keeper (void)
-{
-    PRUint32 dummy1;
-    nsresult ATTRIBUTE_USED __attribute__ ((regparm (3))) (*dummy2)
-        (uint32, nsXPTCStubBase *, PRUint32*) = PrepareAndDispatch;
-// dummy2 references PrepareAndDispatch, now "use" it
-    __asm__ __volatile__ (
-        ""
-        : "=&a" (dummy1)
-        : "g"   (dummy2)
-    );
-    return dummy1 & 0xF0F00000;
-}
-#endif
-
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 // gcc3 mangling tends to insert the length of the method name
 #define STUB_ENTRY(n) \
 asm(".text\n\t" \
     ".align	2\n\t" \
     ".if	" #n " < 10\n\t" \
     ".globl	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".hidden	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".type	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
@@ -146,28 +125,16 @@ asm(".text\n\t" \
     "jmp	" SYMBOL_UNDERSCORE "SharedStub\n\t" \
     ".if	" #n " < 10\n\t" \
     ".size	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".elseif	" #n " < 100\n\t" \
     ".size	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
     ".else\n\t" \
     ".size	" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev,.-" SYMBOL_UNDERSCORE "_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
     ".endif");
-#else
-#define STUB_ENTRY(n) \
-asm(".text\n\t" \
-    ".align	2\n\t" \
-    ".globl	" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase\n\t" \
-    ".hidden	" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase\n\t" \
-    ".type	" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase,@function\n" \
-    SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase:\n\t" \
-    "movl	$" #n ", %eax\n\t" \
-    "jmp	" SYMBOL_UNDERSCORE "SharedStub\n\t" \
-    ".size	" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase,.-" SYMBOL_UNDERSCORE "Stub" #n "__14nsXPTCStubBase");
-#endif
 
 // static nsresult SharedStub(PRUint32 methodIndex) __attribute__((regparm(1)))
 asm(".text\n\t"
     ".align	2\n\t"
     ".type	" SYMBOL_UNDERSCORE "SharedStub,@function\n\t"
     SYMBOL_UNDERSCORE "SharedStub:\n\t"
     "leal	0x08(%esp), %ecx\n\t"
     "movl	0x04(%esp), %edx\n\t"
@@ -182,12 +149,8 @@ nsresult nsXPTCStubBase::Sentinel##n() \
 }
 
 #include "xptcstubsdef.inc"
 
 void
 xptc_dummy()
 {
 }
-
-#else
-#error "can't find a compiler to use"
-#endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_alpha.cpp
@@ -191,39 +191,29 @@ symbol ":"                    "\n\t" \
     ".frame $30,0,$26,0"      "\n\t" \
     "ldgp $29,0($27)"         "\n"   \
 "$" symbol "..ng:"            "\n\t" \
     ".prologue 1"             "\n\t" \
     "lda $1,"#n               "\n\t" \
     "br $31,$SharedStub..ng"  "\n\t" \
     ".end " symbol
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
-
 #define STUB_ENTRY(n) \
 __asm__( \
     ".if "#n" < 10"                                              "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase5Stub"#n"Ev")  "\n\t" \
     ".elseif "#n" < 100"                                         "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase6Stub"#n"Ev")  "\n\t" \
     ".elseif "#n" < 1000"                                        "\n\t" \
         STUB_MANGLED_ENTRY(n, "_ZN14nsXPTCStubBase7Stub"#n"Ev")  "\n\t" \
     ".else"                                                      "\n\t" \
     ".err \"Stub"#n" >= 1000 not yet supported.\""               "\n\t" \
     ".endif" \
     );
 
-#else /* not G++ V3 ABI */
-
-#define STUB_ENTRY(n) \
-__asm__( \
-    STUB_MANGLED_ENTRY(n, "Stub"#n"__14nsXPTCStubBase") \
-    );
-
-#endif /* G++ V3 ABI */
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_nto_arm.cpp
@@ -161,17 +161,16 @@ SharedStub:							\n\
 /*
  * Create sets of stubs to call the SharedStub.
  * We don't touch the stack here, nor any registers, other than IP.
  * IP is defined to be corruptable by a called function, so we are
  * safe to use it.
  *
  * This will work with or without optimisation.
  */
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 /*
  * Note : As G++3 ABI contains the length of the functionname in the
  *  mangled name, it is difficult to get a generic assembler mechanism like
  *  in the G++ 2.95 case.
  *  Create names would be like :
  *    _ZN14nsXPTCStubBase5Stub9Ev
  *    _ZN14nsXPTCStubBase6Stub13Ev
  *    _ZN14nsXPTCStubBase7Stub144Ev
@@ -215,29 +214,16 @@ nsresult nsXPTCStubBase::Stub##n ()  \
 { \
   __asm__ (	  		        \
 "	mov	ip, #"#n"\n"					\
 "	b	SharedStub\n\t");                               \
   return 0; /* avoid warnings */                                \
 }
 #endif
 
-#else /* G++2.95 ABI */
-
-#define STUB_ENTRY(n)						\
-  __asm__(							\
-	".section \".text\"\n"					\
-"	.align\n"						\
-"	.globl	Stub"#n"__14nsXPTCStubBase\n"			\
-"	.type	Stub"#n"__14nsXPTCStubBase,#function\n\n"	\
-"Stub"#n"__14nsXPTCStubBase:\n"					\
-"	mov	ip, #"#n"\n"					\
-"	b	SharedStub\n\t");
-
-#endif
 
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc64_linux.cpp
@@ -170,19 +170,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 }
 
 // Load r11 with the constant 'n' and branch to SharedStub().
 //
 // XXX Yes, it's ugly that we're relying on gcc's name-mangling here;
 // however, it's quick, dirty, and'll break when the ABI changes on
 // us, which is what we want ;-).
 
-#if __GXX_ABI_VERSION < 100
-#error Prehistoric GCC not supported here
-#else
+
 // gcc-3 version
 //
 // As G++3 ABI contains the length of the functionname in the mangled
 // name, it is difficult to get a generic assembler mechanism like
 // in the G++ 2.95 case.
 // Create names would be like:
 // _ZN14nsXPTCStubBase5Stub1Ev
 // _ZN14nsXPTCStubBase6Stub12Ev
@@ -228,17 +226,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
                                                                         \
         ".else  \n\t"                                                   \
         ".err   \"stub number "#n" >= 1000 not yet supported\"\n"       \
         ".endif \n\t"                                                   \
                                                                         \
         "li     11,"#n" \n\t"                                           \
         "b      SharedStub \n"                                          \
 );
-#endif
 
 #define SENTINEL_ENTRY(n)                                               \
 nsresult nsXPTCStubBase::Sentinel##n()                                  \
 {                                                                       \
     NS_ERROR("nsXPTCStubBase::Sentinel called");                  \
     return NS_ERROR_NOT_IMPLEMENTED;                                    \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_linux.cpp
@@ -199,30 +199,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 }
 
 // Load r11 with the constant 'n' and branch to SharedStub().
 //
 // XXX Yes, it's ugly that we're relying on gcc's name-mangling here;
 // however, it's quick, dirty, and'll break when the ABI changes on
 // us, which is what we want ;-).
 
-#if __GXX_ABI_VERSION < 100
-// gcc-2 version
-# define STUB_ENTRY(n)                                       \
-__asm__ (                                                   \
-        ".section \".text\" \n\t"                           \
-        ".align 2 \n\t"                                     \
-	".globl  Stub"#n"__14nsXPTCStubBase \n\t"           \
-	".type   Stub"#n"__14nsXPTCStubBase,@function \n\n" \
-                                                            \
-"Stub"#n"__14nsXPTCStubBase: \n\t"                          \
-	"li     11,"#n" \n\t"                               \
-	"b      SharedStub@local \n"                        \
-);
-#else
 // gcc-3 version
 //
 // As G++3 ABI contains the length of the functionname in the mangled
 // name, it is difficult to get a generic assembler mechanism like
 // in the G++ 2.95 case.
 // Create names would be like:
 // _ZN14nsXPTCStubBase5Stub1Ev
 // _ZN14nsXPTCStubBase6Stub12Ev
@@ -251,17 +237,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 									\
 	".else \n\t"							\
 	".err	\"stub number "#n" >= 1000 not yet supported\"\n"	\
 	".endif \n\t"							\
 									\
 	"li	11,"#n" \n\t"						\
 	"b	SharedStub@local \n"					\
 );
-#endif
 
 #define SENTINEL_ENTRY(n)                            \
 nsresult nsXPTCStubBase::Sentinel##n()               \
 {                                                    \
   NS_ERROR("nsXPTCStubBase::Sentinel called"); \
   return NS_ERROR_NOT_IMPLEMENTED;                   \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_ppc_openbsd.cpp
@@ -179,30 +179,17 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 }
 
 // Load r11 with the constant 'n' and branch to SharedStub().
 //
 // XXX Yes, it's ugly that we're relying on gcc's name-mangling here;
 // however, it's quick, dirty, and'll break when the ABI changes on
 // us, which is what we want ;-).
 
-#if __GXX_ABI_VERSION < 100
-// gcc-2 version
-# define STUB_ENTRY(n)                                       \
-__asm__ (                                                   \
-        ".section \".text\" \n\t"                           \
-        ".align 2 \n\t"                                     \
-	".globl  Stub"#n"__14nsXPTCStubBase \n\t"           \
-	".type   Stub"#n"__14nsXPTCStubBase,@function \n\n" \
-                                                            \
-"Stub"#n"__14nsXPTCStubBase: \n\t"                          \
-	"li     11,"#n" \n\t"                               \
-	"b      SharedStub@local \n"                        \
-);
-#else
+
 // gcc-3 version
 //
 // As G++3 ABI contains the length of the functionname in the mangled
 // name, it is difficult to get a generic assembler mechanism like
 // in the G++ 2.95 case.
 // Create names would be like:
 // _ZN14nsXPTCStubBase5Stub1Ev
 // _ZN14nsXPTCStubBase6Stub12Ev
@@ -231,17 +218,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
 									\
 	".else \n\t"							\
 	".err	\"stub number "#n" >= 1000 not yet supported\"\n"	\
 	".endif \n\t"							\
 									\
 	"li	11,"#n" \n\t"						\
 	"b	SharedStub@local \n"					\
 );
-#endif
 
 #define SENTINEL_ENTRY(n)                            \
 nsresult nsXPTCStubBase::Sentinel##n()               \
 {                                                    \
   NS_ERROR("nsXPTCStubBase::Sentinel called"); \
   return NS_ERROR_NOT_IMPLEMENTED;                   \
 }
 
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_unixish_x86.cpp
@@ -93,18 +93,16 @@ PrepareAndDispatch(nsXPTCStubBase* self,
         CallMethod((PRUint16)methodIndex, info, dispatchParams);
 
     if(dispatchParams != paramBuffer)
         delete [] dispatchParams;
 
     return result;
 }
 
-#ifdef __GNUC__         /* Gnu Compiler. */
-
 #ifdef KEEP_STACK_16_BYTE_ALIGNED
 /* Make sure the stack is 16-byte aligned.  Do that by aligning to 16 bytes and
  * then subtracting 4 so the three subsequent pushes result in a 16-byte aligned
  * stack. */
 #define ALIGN_STACK_DECL \
   unsigned int saved_esp;
 
 #define ALIGN_STACK_SAVE \
@@ -157,20 +155,16 @@ nsresult nsXPTCStubBase::Stub##n() \
       ALIGN_STACK_REGS_IN \
     : "2" (method)      /* %2 */ \
       ALIGN_STACK_REGS_OUT \
     : "memory" \
 	); \
     return result; \
 }
 
-#else
-#error "can't find a compiler to use"
-#endif /* __GNUC__ */
-
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_darwin.cpp
@@ -154,17 +154,17 @@ PrepareAndDispatch(nsXPTCStubBase * self
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
 
     return result;
 }
 
 // Darwin/x86-64 uses gcc >= 4.2
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 1002
+
 #define STUB_ENTRY(n) \
 asm(".section	__TEXT,__text\n\t" \
     ".align	3\n\t" \
     ".if	" #n " < 10\n\t" \
     ".globl	__ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     "__ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
     ".elseif	" #n " < 100\n\t" \
     ".globl	__ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
@@ -214,12 +214,8 @@ asm(".section   __TEXT,__text\n\t"
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
-
-#else
-#error "Unsupported compiler. Use gcc >= 4.2 for Darwin/x86-64."
-#endif /* __GNUC__ */
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
@@ -153,17 +153,16 @@ PrepareAndDispatch(nsXPTCStubBase * self
     result = self->mOuter->CallMethod((PRUint16) methodIndex, info, dispatchParams);
 
     if (dispatchParams != paramBuffer)
         delete [] dispatchParams;
 
     return result;
 }
 
-#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
 // Linux/x86-64 uses gcc >= 3.1
 #define STUB_ENTRY(n) \
 asm(".section	\".text\"\n\t" \
     ".align	2\n\t" \
     ".if	" #n " < 10\n\t" \
     ".globl	_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".hidden	_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     ".type	_ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
@@ -229,12 +228,8 @@ asm(".section   \".text\"\n\t"
 #define SENTINEL_ENTRY(n) \
 nsresult nsXPTCStubBase::Sentinel##n() \
 { \
     NS_ERROR("nsXPTCStubBase::Sentinel called"); \
     return NS_ERROR_NOT_IMPLEMENTED; \
 }
 
 #include "xptcstubsdef.inc"
-
-#else
-#error "Unsupported compiler. Use gcc >= 3.1 for Linux/x86-64."
-#endif /* __GNUC__ */