$OpenBSD: patch-erts_emulator_Makefile_in,v 1.10 2012/05/26 09:08:57 jasper Exp $
--- erts/emulator/Makefile.in.orig	Sun Apr  1 20:15:00 2012
+++ erts/emulator/Makefile.in	Tue May 22 09:22:15 2012
@@ -231,13 +231,7 @@ ifeq (@EMU_LOCK_CHECKING@,yes)
 NO_INLINE_FUNCTIONS=true
 endif
 
-ifneq ($(filter tile-%,$(TARGET)), )
-# -O2 generally produces faster for tile-cc, because the code is smaller.
-# Since tile-cc looks like gcc, we need to override the normal gcc -O3 setting.
 OPT_LEVEL = -O2
-else
-OPT_LEVEL = -O3
-endif
 
 ifeq ($(GCC),yes)
 ifeq ($(NO_INLINE_FUNCTIONS),true)
@@ -651,7 +645,7 @@ $(OBJDIR)/beam_emu.o: beam/beam_emu.c
 endif
 
 $(OBJDIR)/%.o: beam/%.c
-	$(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
+	$(CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
 
 $(OBJDIR)/%.o: $(TARGET)/%.c
 	$(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
