diff --exclude=CVS --exclude='.#*' --exclude='obj.*' --exclude='makeBuild*' -uNr src.orig/gnu/usr.bin/gcc4/arch/i386/configargs.h src/gnu/usr.bin/gcc4/arch/i386/configargs.h
--- src.orig/gnu/usr.bin/gcc4/arch/i386/configargs.h	2010-05-15 07:15:22.000000000 +0900
+++ src/gnu/usr.bin/gcc4/arch/i386/configargs.h	2011-06-23 11:44:46.000000000 +0900
@@ -3,9 +3,9 @@
 /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp  */
 
 /* Generated automatically. */
-static const char configuration_arguments[] = "/usr/src/tools/gcc/../../gnu/dist/gcc4/configure --target=i486--netbsdelf --enable-long-long --enable-threads --enable-__cxa_atexit --with-arch=i486 --with-tune=nocona --disable-multilib --disable-symvers --build=x86_64-unknown-netbsd5.0. --host=i486--netbsdelf";
+static const char configuration_arguments[] = "/usr/src/tools/gcc/../../gnu/dist/gcc4/configure --target=i686--netbsdelf --enable-long-long --enable-threads --enable-__cxa_atexit --with-arch=i686 --with-tune=nocona --disable-multilib --disable-symvers --build=x86_64-unknown-netbsd5.0. --host=i686--netbsdelf";
 static const char thread_model[] = "posix";
 
 static const struct {
   const char *name, *value;
-} configure_default_options[] = { { "cpu", "i486" }, { "arch", "i486" }, { "tune", "nocona" } };
+} configure_default_options[] = { { "cpu", "i686" }, { "arch", "i686" }, { "tune", "nocona" } };
diff --exclude=CVS --exclude='.#*' --exclude='obj.*' --exclude='makeBuild*' -uNr src.orig/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h src/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h
--- src.orig/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h	2011-07-20 21:29:07.000000000 +0900
+++ src/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h	2011-07-20 21:37:38.000000000 +0900
@@ -8,4 +8,4 @@
 
 static const struct {
   const char *name, *value;
-} configure_default_options[] = { { "cpu", "i486" }, { "arch", "i486" }, { "tune", "nocona" } };
+} configure_default_options[] = { { "cpu", "i686" }, { "arch", "i686" }, { "tune", "nocona" } };
diff --exclude=CVS --exclude='.#*' --exclude='obj.*' --exclude='makeBuild*' -uNr src.orig/lib/libc/arch/i386/SYS.h src/lib/libc/arch/i386/SYS.h
--- src.orig/lib/libc/arch/i386/SYS.h	2008-04-29 11:37:06.000000000 +0900
+++ src/lib/libc/arch/i386/SYS.h	2011-05-29 16:40:48.000000000 +0900
@@ -103,9 +103,9 @@
 
 #ifdef PIC
 #define _SYSCALL_ERR							\
-	PIC_PROLOGUE;							\
+	SYSCALL_PIC_PROLOGUE;						\
 	mov PIC_GOT(CERROR), %ecx;					\
-	PIC_EPILOGUE;							\
+	SYSCALL_PIC_EPILOGUE;						\
 	jmp *%ecx
 #else
 #define _SYSCALL_ERR							\
--- src.orig/sys/arch/i386/include/asm.h	2011-06-16 22:19:37.000000000 +0900
+++ src/sys/arch/i386/include/asm.h	2011-06-16 22:19:49.000000000 +0900
@@ -42,18 +42,48 @@
 #endif
 
 #ifdef PIC
+#define SYSCALL_PIC_PROLOGUE	\
+	pushl	%ebx;		\
+	call	1f;		\
+1:				\
+	popl	%ebx;		\
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#define SYSCALL_PIC_EPILOGUE	\
+	popl	%ebx
+#ifdef __i686
+#undef __i686
+#define PIC_PROLOGUE							\
+	.ifndef __i686.get_pc_thunk.bx;					\
+	.section .text.__i686.get_pc_thunk.bx,"axG",@progbits,__i686.get_pc_thunk.bx,comdat; \
+.globl __i686.get_pc_thunk.bx;						\
+	.hidden	__i686.get_pc_thunk.bx;					\
+	.type	__i686.get_pc_thunk.bx,@function;			\
+__i686.get_pc_thunk.bx:							\
+	movl	(%esp), %ebx;						\
+	ret;								\
+	.size	__i686.get_pc_thunk.bx, . - __i686.get_pc_thunk.bx;	\
+	.previous;							\
+	.endif;								\
+	pushl	%ebx;							\
+	call	__i686.get_pc_thunk.bx;					\
+	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+#define	__i686	__i686
+#else	/* !__i686 */
 #define PIC_PROLOGUE	\
 	pushl	%ebx;	\
 	call	1f;	\
 1:			\
 	popl	%ebx;	\
 	addl	$_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#endif	/* __i686 */
 #define PIC_EPILOGUE	\
 	popl	%ebx
 #define PIC_PLT(x)	x@PLT
 #define PIC_GOT(x)	x@GOT(%ebx)
 #define PIC_GOTOFF(x)	x@GOTOFF(%ebx)
 #else
+#define SYSCALL_PIC_PROLOGUE
+#define SYSCALL_PIC_EPILOGUE
 #define PIC_PROLOGUE
 #define PIC_EPILOGUE
 #define PIC_PLT(x)	x
--- src.orig/share/mk/bsd.own.mk	2011-07-18 10:18:47.000000000 +0900
+++ src/share/mk/bsd.own.mk	2011-07-18 10:27:44.000000000 +0900
@@ -640,8 +640,8 @@
 # GNU sources and packages sometimes see architecture names differently.
 #
 GNU_ARCH.coldfire=m68k
-GNU_ARCH.i386=i486
-GCC_CONFIG_ARCH.i386=i486
+GNU_ARCH.i386=i686
+GCC_CONFIG_ARCH.i386=i686
 GCC_CONFIG_TUNE.i386=nocona
 GCC_CONFIG_TUNE.x86_64=nocona
 GNU_ARCH.m68000=m68010
--- src.orig/common/lib/libc/arch/i386/string/ffs.S	2005-12-21 04:28:49.000000000 +0900
+++ src/common/lib/libc/arch/i386/string/ffs.S	2011-06-20 12:53:54.000000000 +0900
@@ -10,6 +10,12 @@
 #endif
 
 ENTRY(ffs)
+#ifdef __i686
+	bsfl	4(%esp),%eax
+	cmovel	-1,%eax			/* ZF is set if all bits are 0 */
+	incl	%eax			/* bits numbered from 1, not 0 */
+	ret
+#else
 	bsfl	4(%esp),%eax
 	jz	L1	 		/* ZF is set if all bits are 0 */
 	incl	%eax			/* bits numbered from 1, not 0 */
@@ -18,3 +24,4 @@
 	_ALIGN_TEXT
 L1:	xorl	%eax,%eax		/* clear result */
 	ret
+#endif
