提交 3142255c 编写于 作者: B blueswir1

Sparc host update (Ben Taylor, Martin Bochnig)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2689 c046a42c-6fe2-441c-8c8c-71466251a162
上级 6083f933
...@@ -8,10 +8,9 @@ include config-host.mak ...@@ -8,10 +8,9 @@ include config-host.mak
BASE_CFLAGS= BASE_CFLAGS=
BASE_LDFLAGS= BASE_LDFLAGS=
BASE_CFLAGS += $(OS_CFLAGS) BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
ifeq ($(ARCH),sparc) BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
BASE_CFLAGS += -mcpu=ultrasparc
endif
CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LIBS= LIBS=
TOOLS=qemu-img$(EXESUF) TOOLS=qemu-img$(EXESUF)
......
...@@ -132,25 +132,25 @@ BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld ...@@ -132,25 +132,25 @@ BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif endif
ifeq ($(ARCH),sparc) ifeq ($(ARCH),sparc)
ifeq ($(CONFIG_SOLARIS),yes) BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
BASE_LDFLAGS+=-m32 ifeq ($(CONFIG_SOLARIS),yes)
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 OP_CFLAGS+=-fno-omit-frame-pointer
else else
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
BASE_LDFLAGS+=-m32 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 # -static is used to avoid g1/g3 usage by the dynamic linker
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
# -static is used to avoid g1/g3 usage by the dynamic linker endif
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
endif
endif endif
ifeq ($(ARCH),sparc64) ifeq ($(ARCH),sparc64)
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
BASE_LDFLAGS+=-m64 OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld ifneq ($(CONFIG_SOLARIS),yes)
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
endif
endif endif
ifeq ($(ARCH),alpha) ifeq ($(ARCH),alpha)
...@@ -202,8 +202,10 @@ ifdef CONFIG_DARWIN_USER ...@@ -202,8 +202,10 @@ ifdef CONFIG_DARWIN_USER
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
endif endif
BASE_CFLAGS+=$(OS_CFLAGS) BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
OP_CFLAGS+=$(OS_CFLAGS) BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
######################################################### #########################################################
...@@ -500,8 +502,10 @@ VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld ...@@ -500,8 +502,10 @@ VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
endif endif
ifeq ($(ARCH),sparc64) ifeq ($(ARCH),sparc64)
VL_LDFLAGS+=-m64 VL_LDFLAGS+=-m64
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld ifneq ($(CONFIG_SOLARIS),yes)
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
endif endif
ifdef CONFIG_WIN32 ifdef CONFIG_WIN32
......
...@@ -56,7 +56,7 @@ case "$cpu" in ...@@ -56,7 +56,7 @@ case "$cpu" in
s390) s390)
cpu="s390" cpu="s390"
;; ;;
sparc|sun4[muv]) sparc|sun4[cdmuv])
cpu="sparc" cpu="sparc"
;; ;;
sparc64) sparc64)
...@@ -266,6 +266,18 @@ for opt do ...@@ -266,6 +266,18 @@ for opt do
;; ;;
--enable-uname-release=*) uname_release="$optarg" --enable-uname-release=*) uname_release="$optarg"
;; ;;
--sparc_cpu=*)
sparc_cpu="$optarg"
case $sparc_cpu in
v7|v8) SP_CFLAGS="-m32 -mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
target_cpu="sparc"; cpu="sparc" ;;
v8plus|v8plusa) SP_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m32"
target_cpu="sparc"; cpu="sparc" ;;
v9) SP_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_${sparc_cpu}__"; SP_LDFLAGS="-m64"
target_cpu="sparc64"; cpu="sparc64" ;;
*) echo "undefined SPARC architecture. Exiting";exit 1;;
esac
;;
esac esac
done done
...@@ -279,6 +291,29 @@ fi ...@@ -279,6 +291,29 @@ fi
CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing" CFLAGS="$CFLAGS -Wall -O2 -g -fno-strict-aliasing"
LDFLAGS="$LDFLAGS -g" LDFLAGS="$LDFLAGS -g"
#
# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right
# ARCH_CFLAGS/ARCH_LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit)
#
case $cpu in
sparc) if test -z "$sparc_cpu" ; then
ARCH_CFLAGS="-m32 -mcpu=ultrasparc -D__sparc_v8plus__"
ARCH_LDFLAGS="-m32"
else
ARCH_CFLAGS="${SP_CFLAGS}"
ARCH_LDFLAGS="${SP_LDFLAGS}"
fi
;;
sparc64) if test -z "$sparc_cpu" ; then
ARCH_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__"
ARCH_LDFLAGS="-m64"
else
ARCH_CFLAGS="${SP_CFLAGS}"
ARCH_LDFLAGS="${SP_LDFLAGS}"
fi
;;
esac
if test x"$show_help" = x"yes" ; then if test x"$show_help" = x"yes" ; then
cat << EOF cat << EOF
...@@ -320,6 +355,7 @@ echo " --disable-darwin-user disable all darwin usermode emulation targets" ...@@ -320,6 +355,7 @@ echo " --disable-darwin-user disable all darwin usermode emulation targets"
echo " --fmod-lib path to FMOD library" echo " --fmod-lib path to FMOD library"
echo " --fmod-inc path to FMOD includes" echo " --fmod-inc path to FMOD includes"
echo " --enable-uname-release=R Return R for uname -r in usermode emulation" echo " --enable-uname-release=R Return R for uname -r in usermode emulation"
echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9"
echo "" echo ""
echo "NOTE: The object files are built at the place where configure is launched" echo "NOTE: The object files are built at the place where configure is launched"
exit 1 exit 1
...@@ -635,6 +671,9 @@ else ...@@ -635,6 +671,9 @@ else
fmod_support="" fmod_support=""
fi fi
echo "FMOD support $fmod $fmod_support" echo "FMOD support $fmod $fmod_support"
if test -n "$sparc_cpu"; then
echo "Target Sparc Arch $sparc_cpu"
fi
echo "kqemu support $kqemu" echo "kqemu support $kqemu"
echo "Documentation $build_docs" echo "Documentation $build_docs"
[ ! -z "$uname_release" ] && \ [ ! -z "$uname_release" ] && \
...@@ -668,6 +707,9 @@ echo "HOST_CC=$host_cc" >> $config_mak ...@@ -668,6 +707,9 @@ echo "HOST_CC=$host_cc" >> $config_mak
echo "AR=$ar" >> $config_mak echo "AR=$ar" >> $config_mak
echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak
echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak
echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak
echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak
echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak
echo "CFLAGS=$CFLAGS" >> $config_mak echo "CFLAGS=$CFLAGS" >> $config_mak
echo "LDFLAGS=$LDFLAGS" >> $config_mak echo "LDFLAGS=$LDFLAGS" >> $config_mak
echo "EXESUF=$EXESUF" >> $config_mak echo "EXESUF=$EXESUF" >> $config_mak
...@@ -712,7 +754,7 @@ elif test "$cpu" = "m68k" ; then ...@@ -712,7 +754,7 @@ elif test "$cpu" = "m68k" ; then
echo "ARCH=m68k" >> $config_mak echo "ARCH=m68k" >> $config_mak
echo "#define HOST_M68K 1" >> $config_h echo "#define HOST_M68K 1" >> $config_h
else else
echo "Unsupported CPU" echo "Unsupported CPU = $cpu"
exit 1 exit 1
fi fi
if test "$bigendian" = "yes" ; then if test "$bigendian" = "yes" ; then
...@@ -744,6 +786,10 @@ if test "$solaris" = "yes" ; then ...@@ -744,6 +786,10 @@ if test "$solaris" = "yes" ; then
echo "#define NEEDS_LIBSUNMATH 1" >> $config_h echo "#define NEEDS_LIBSUNMATH 1" >> $config_h
fi fi
fi fi
if test -n "$sparc_cpu"; then
echo "CONFIG__sparc_${sparc_cpu}__=yes" >> $config_mak
echo "#define __sparc_${sparc_cpu}__ 1" >> $config_h
fi
if test "$gdbstub" = "yes" ; then if test "$gdbstub" = "yes" ; then
echo "CONFIG_GDBSTUB=yes" >> $config_mak echo "CONFIG_GDBSTUB=yes" >> $config_mak
echo "#define CONFIG_GDBSTUB 1" >> $config_h echo "#define CONFIG_GDBSTUB 1" >> $config_h
......
...@@ -1000,7 +1000,7 @@ static inline int64_t cpu_get_real_ticks(void) ...@@ -1000,7 +1000,7 @@ static inline int64_t cpu_get_real_ticks(void)
return val; return val;
} }
#elif defined(__sparc_v9__) #elif defined(__sparc_v8plus__) || defined(__sparc_v8plusa__) || defined(__sparc_v9__)
static inline int64_t cpu_get_real_ticks (void) static inline int64_t cpu_get_real_ticks (void)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册