summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2012-03-28 20:57:41 +0000
committermiod <miod@openbsd.org>2012-03-28 20:57:41 +0000
commitbc3a335ebd3dfd59aea8307e32de2b9715b8381d (patch)
treee76b60caa005a1dbd75af37c390ab095a6150081
parentregen (diff)
downloadwireguard-openbsd-bc3a335ebd3dfd59aea8307e32de2b9715b8381d.tar.xz
wireguard-openbsd-bc3a335ebd3dfd59aea8307e32de2b9715b8381d.zip
Default to -mfix-r4000 -mfix-r4400 when building in big endian mode. This is
a lifesaver for R4000 and R4400 operation; without these, every int->long promotion occuring shortly after an integer multiplication (such as an array element access when the array item size is not a power of two) loses horribly, and panic^Whilarity ensues. This mostly causes assembly insns to be shuffled, but almost no code size growth and no noticeable performance hit on processors which do not need these insn placement workarounds.
-rw-r--r--gnu/gcc/gcc/config/mips/openbsd.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/gcc/gcc/config/mips/openbsd.h b/gnu/gcc/gcc/config/mips/openbsd.h
index e8fe656a01e..c62789e84d9 100644
--- a/gnu/gcc/gcc/config/mips/openbsd.h
+++ b/gnu/gcc/gcc/config/mips/openbsd.h
@@ -205,3 +205,14 @@ Boston, MA 02110-1301, USA. */
#define LIB_SPEC OBSD_LIB_SPEC
#undef ENABLE_EXECUTE_STACK
+
+/* Default to -mfix-r4000 -mfix-r4400 when compiling big endian. */
+#undef OVERRIDE_OPTIONS
+#define OVERRIDE_OPTIONS \
+ do { \
+ if (TARGET_BIG_ENDIAN) \
+ { \
+ target_flags |= MASK_FIX_R4000 | MASK_FIX_R4400; \
+ } \
+ override_options (); \
+ } while (0)