summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.housekeeping8
-rw-r--r--src/arch/i386/Makefile8
2 files changed, 14 insertions, 2 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 7054cdcf..067ac826 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -54,6 +54,14 @@ echo :
###############################################################################
#
+# Determine host OS
+#
+HOST_OS := $(shell uname -s)
+hostos :
+ @$(ECHO) $(HOST_OS)
+
+###############################################################################
+#
# Check for tools that can cause failed builds
#
.toolcheck :
diff --git a/src/arch/i386/Makefile b/src/arch/i386/Makefile
index dac53493..7d3e7639 100644
--- a/src/arch/i386/Makefile
+++ b/src/arch/i386/Makefile
@@ -38,8 +38,12 @@ CFLAGS += -freg-struct-return
# Force 32-bit code even on an x86-64 machine
#
CFLAGS += -m32
-ASFLAGS += --32
-LDFLAGS += -m elf_i386
+ASFLAGS += --32
+ifeq ($(HOST_OS),FreeBSD)
+LDFLAGS += -m elf_i386_fbsd
+else
+LDFLAGS += -m elf_i386
+endif
# EFI requires -fshort-wchar, and nothing else currently uses wchar_t
#