summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2012-04-12 11:28:32 +0000
committerjsg <jsg@openbsd.org>2012-04-12 11:28:32 +0000
commit5db72d50120c7aa6e3bf540d4c9845bc08e685db (patch)
tree346d2569f65d9087bc27ac56d2ac1d5370909339 /lib
parentmove sh to gcc4 (diff)
downloadwireguard-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@
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/sh/crt0.c7
1 files changed, 5 insertions, 2 deletions
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;