diff options
author | 2012-04-12 11:28:32 +0000 | |
---|---|---|
committer | 2012-04-12 11:28:32 +0000 | |
commit | 5db72d50120c7aa6e3bf540d4c9845bc08e685db (patch) | |
tree | 346d2569f65d9087bc27ac56d2ac1d5370909339 | |
parent | move sh to gcc4 (diff) | |
download | wireguard-openbsd-5db72d50120c7aa6e3bf540d4c9845bc08e685db.tar.xz wireguard-openbsd-5db72d50120c7aa6e3bf540d4c9845bc08e685db.zip |
the fpu control symbol on sh (__fpscr_values) suddenly becomes local
instead of global with gcc4 and this ends up breaking things in hard
to debug ways. So move the definition to csu instead of libgcc.
ok miod@
-rw-r--r-- | gnu/usr.bin/cc/libgcc/Makefile | 4 | ||||
-rw-r--r-- | lib/csu/sh/crt0.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile index 3ce6255173f..b3ddfbc13b7 100644 --- a/gnu/usr.bin/cc/libgcc/Makefile +++ b/gnu/usr.bin/cc/libgcc/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.58.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.21 2012/04/12 11:18:29 jsg Exp $ +# $OpenBSD: Makefile,v 1.22 2012/04/12 11:28:32 jsg Exp $ .include <bsd.own.mk> @@ -159,7 +159,7 @@ LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c .endif .if ${TARGET_ARCH} == "sh" -CFLAGS+= -fpic +CFLAGS+= -fpic -DNO_FPSCR_VALUES LIB1ASMSRC = sh/lib1funcs.asm LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movmem \ _movmem_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ diff --git a/lib/csu/sh/crt0.c b/lib/csu/sh/crt0.c index 6e08127090d..24599a9e17f 100644 --- a/lib/csu/sh/crt0.c +++ b/lib/csu/sh/crt0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crt0.c,v 1.3 2007/03/13 21:42:33 miod Exp $ */ +/* $OpenBSD: crt0.c,v 1.4 2012/04/12 11:28:32 jsg Exp $ */ /* $NetBSD: crt0.c,v 1.10 2004/08/26 21:16:41 thorpej Exp $ */ /* @@ -51,6 +51,10 @@ char * __progname = ""; char __progname_storage[NAME_MAX+1]; +#if defined(__SH4__) && !defined(__SH4_NOFPU__) +unsigned int __fpscr_values[2]; +#endif + #ifdef MCRT0 extern void monstartup(u_long, u_long); extern void _mcleanup(void); @@ -79,7 +83,6 @@ ___start(int argc, char **argv, char **envp, void *ps_strings, #if defined(__SH4__) && !defined(__SH4_NOFPU__) extern void __set_fpscr(unsigned int); - extern unsigned int __fpscr_values[2]; __set_fpscr(0); __fpscr_values[0] |= FPSCR_DN; |