# -*- makefile -*-
ifeq ($(target_cpu), sparc64)
+COMMON_CFLAGS += -mno-app-regs
COMMON_LDFLAGS += -mno-relax
endif
noinst_MODULES = emu-full.mod
emu_full_mod_SOURCES = kern/emu/full.c
emu_full_mod_CFLAGS = $(COMMON_CFLAGS)
+emu_full_mod_LDFLAGS = $(COMMON_LDFLAGS)
noinst_MODULES = emu-lite.mod
emu_lite_mod_SOURCES = kern/emu/lite.c kern/emu/cache.S symlist.c
emu_lite_mod_CFLAGS = $(COMMON_CFLAGS)
+emu_lite_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
pkglib_MODULES += halt.mod
grub_emu_LDFLAGS = $(LIBCURSES)
ifeq ($(target_cpu), sparc64)
-grub_emu_LDFLAGS += -m64 -mno-relax
+grub_emu_LDFLAGS += -m64 -melf64_sparc -mno-relax
endif
ifeq ($(enable_grub_emu_usb), yes)
machine_CPPFLAGS="$machine_CPPFLAGS -DMACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`"
CPPFLAGS="$CPPFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
-TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CPPFLAGS"
+TARGET_ASFLAGS="$TARGET_ASFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $cpu_CPPFLAGS $machine_CPPFLAGS"
AC_SUBST(host_cpu)