Added check for compiler support of -fno-stack-protector and changed toolchain prefix to i386-elf- for x86 port.
diff --git a/arch/x86/rules.mk b/arch/x86/rules.mk
index 943ccd8..d929cb6 100644
--- a/arch/x86/rules.mk
+++ b/arch/x86/rules.mk
@@ -18,11 +18,17 @@
$(LOCAL_DIR)/descriptor.o
# set the default toolchain to x86 elf and set a #define
-TOOLCHAIN_PREFIX ?= #x86-elf-
+TOOLCHAIN_PREFIX ?= i386-elf-
LIBGCC := $(shell $(TOOLCHAIN_PREFIX)gcc $(CFLAGS) -print-libgcc-file-name)
#$(info LIBGCC = $(LIBGCC))
+cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`"; \
+ then echo "$(2)"; else echo "$(3)"; fi ;)
+
+# disable SSP if the compiler supports it; it will break stuff
+CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+
# potentially generated files that should be cleaned out with clean make rule
GENERATED += \
$(BUILDDIR)/kernel.ld