--- 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-11-24 01:39:55.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" } }; --- src.orig/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h 2011-09-29 23:00:10.000000000 +0900 +++ src/external/gpl3/gcc/usr.bin/gcc/arch/i386/configargs.h 2011-11-24 01:39:37.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/src2/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20110620' --enable-__cxa_atexit --with-arch=i486 --with-tune=nocona --with-mpc=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --with-mpfr=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --with-gmp=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd5.99.55 --host=i486--netbsdelf"; +static const char configuration_arguments[] = "/usr/src2/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i686--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb1 20110620' --enable-__cxa_atexit --with-arch=i686 --with-tune=nocona --with-mpc=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --with-mpfr=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --with-gmp=/var/obj/mknative/i386/usr/src2/destdir.i386/usr --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd5.99.55 --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" } }; --- src.orig/lib/libc/arch/i386/SYS.h 2008-04-29 11:37:06.000000000 +0900 +++ src/lib/libc/arch/i386/SYS.h 2011-11-24 01:37:53.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-11-24 01:36:58.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/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-11-24 01:34:16.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 --- src.orig/share/mk/bsd.own.mk 2011-11-17 19:09:57.000000000 +0900 +++ src/share/mk/bsd.own.mk 2011-11-24 01:35:16.000000000 +0900 @@ -655,8 +655,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/share/mk/bsd.kmodule.mk 2011-09-29 23:03:21.000000000 +0900 +++ src/share/mk/bsd.kmodule.mk 2011-11-24 02:14:46.000000000 +0900 @@ -30,6 +30,8 @@ # resulting code would be much faster. .if ${MACHINE_CPU} == "arm" CFLAGS+= -mlong-calls +.elif ${MACHINE_CPU} == "i386" +CFLAGS+= -mno-sse -mno-sse2 -mno-sse3 .elif ${MACHINE_CPU} == "powerpc" CFLAGS+= -mlongcall .elif ${MACHINE_CPU} == "vax"