Skip to content

Commit

Permalink
[build] Fix building on FreeBSD
Browse files Browse the repository at this point in the history
FreeBSD requires the object format to be specified as elf_i386_fbsd,
rather than elf_i386.

Based on a patch from Eygene Ryabinkin <rea-fbsd@codelabs.ru>
  • Loading branch information
Michael Brown committed Oct 17, 2008
1 parent 5600955 commit d9c38d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/Makefile.housekeeping
Expand Up @@ -52,6 +52,14 @@ VERYCLEANUP += .echocheck
echo :
@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""

###############################################################################
#
# Determine host OS
#
HOST_OS := $(shell uname -s)
hostos :
@$(ECHO) $(HOST_OS)

###############################################################################
#
# Check for tools that can cause failed builds
Expand Down
8 changes: 6 additions & 2 deletions src/arch/i386/Makefile
Expand Up @@ -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
#
Expand Down

0 comments on commit d9c38d1

Please sign in to comment.