[EABI] add support for EABI/linux toolchains

pretty much a hack right now, more or less testing for
arm-none-linux-eabi- in the toolchain prefix and adding some routines
that have to be implemented.
diff --git a/arch/arm/rules.mk b/arch/arm/rules.mk
index c8e3d5d..8630f52 100644
--- a/arch/arm/rules.mk
+++ b/arch/arm/rules.mk
@@ -1,10 +1,7 @@
 LOCAL_DIR := $(GET_LOCAL_DIR)
 
-TOOLCHAIN_PREFIX ?= arm-elf-
-
-ENABLE_THUMB ?= true
-
-CFLAGS += -finline
+# can override this in local.mk
+ENABLE_THUMB?=true
 
 DEFINES += \
 	ARM_CPU_$(ARM_CPU)=1
@@ -22,8 +19,8 @@
 	ARM_WITH_THUMB2=1 \
 	ARM_WITH_CACHE=1 \
 	ARM_WITH_L2=1
-#CFLAGS += -mcpu=$(ARM_CPU)
-CFLAGS += -mcpu=arm1136jf-s # compiler doesn't understand cortex yet
+CFLAGS += -mcpu=$(ARM_CPU)
+#CFLAGS += -mcpu=arm1136jf-s # compiler doesn't understand cortex yet
 HANDLED_CORE := true
 #CFLAGS += -mfpu=vfp -mfloat-abi=softfp
 endif
@@ -72,8 +69,6 @@
 THUMBINTERWORK := -mthumb-interwork
 endif
 
-CFLAGS += $(THUMBINTERWORK)
-
 INCLUDES += \
 	-I$(LOCAL_DIR)/include
 
@@ -91,6 +86,22 @@
 	$(LOCAL_DIR)/mmu.o \
 	$(LOCAL_DIR)/thread.o
 
+# set the default toolchain to arm elf and set a #define
+TOOLCHAIN_PREFIX ?= arm-elf-
+ifeq ($(TOOLCHAIN_PREFIX),arm-none-linux-gnueabi-)
+DEFINES += \
+	WITH_LINUX_EABI_TOOLCHAIN=1
+
+# eabi compilers dont need this
+THUMBINTERWORK:=
+else
+
+# XXX hack to work around lack of cortex support in regular compilers
+CFLAGS := $(subst cortex-a8,arm1136jf-s,$(CFLAGS))
+endif
+
+CFLAGS += $(THUMBINTERWORK)
+
 # make sure some bits were set up
 MEMVARS_SET := 0
 ifneq ($(MEMBASE),)