diff mbox

[33/81] Refactor HELPER_CFLAGS

Message ID 84fbc31d8483e897ab6b2e8922349555149ae24d.1249301360.git.quintela@redhat.com
State Superseded
Headers show

Commit Message

Juan Quintela Aug. 3, 2009, 12:46 p.m. UTC
Calculate its value in ./configure.
Put together all its uses

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 Makefile.target |   28 ++++------------------------
 configure       |    4 ++++
 2 files changed, 8 insertions(+), 24 deletions(-)
diff mbox

Patch

diff --git a/Makefile.target b/Makefile.target
index 60eba31..d5e38b3 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -19,22 +19,10 @@  endif

 PROGS=$(QEMU_PROG)

-HELPER_CFLAGS=
-
-ifeq ($(ARCH),i386)
-HELPER_CFLAGS+=-fomit-frame-pointer
-endif
-
 ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
 translate.o: QEMU_CFLAGS := $(QEMU_CFLAGS) $(call cc-option, $(QEMU_CFLAGS), -fno-unit-at-a-time,)
 endif

-ifeq ($(ARCH),sparc)
-  ifneq ($(CONFIG_SOLARIS),y)
-    HELPER_CFLAGS+=-ffixed-i0
-  endif
-endif
-
 ifeq ($(ARCH),alpha)
 # Ensure there's only a single GP
 QEMU_CFLAGS+=-msmall-data
@@ -153,6 +141,10 @@  op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)

 cpu-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS)

+# Note: this is a workaround. The real fix is to avoid compiling
+# cpu_signal_handler() in cpu-exec.c.
+signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
+
 #########################################################
 # Linux user emulator target

@@ -188,10 +180,6 @@  obj-arm-y += arm-semi.o

 obj-m68k-y += m68k-sim.o m68k-semi.o

-# Note: this is a workaround. The real fix is to avoid compiling
-# cpu_signal_handler() in cpu-exec.c.
-signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
-
 ARLIBS=../libqemu_user.a libqemu.a
 endif #CONFIG_LINUX_USER

@@ -211,10 +199,6 @@  LIBS+=-lmx
 obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
         gdbstub.o gdbstub-xml.o ioport-user.o

-# Note: this is a workaround. The real fix is to avoid compiling
-# cpu_signal_handler() in cpu-exec.c.
-signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
-
 ARLIBS=libqemu.a

 endif #CONFIG_DARWIN_USER
@@ -231,10 +215,6 @@  obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \
         gdbstub.o gdbstub-xml.o ioport-user.o
 obj-y += uaccess.o

-# Note: this is a workaround. The real fix is to avoid compiling
-# cpu_signal_handler() in cpu-exec.c.
-signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
-
 ARLIBS=libqemu.a ../libqemu_user.a

 endif #CONFIG_BSD_USER
diff --git a/configure b/configure
index 01e667f..1a3ced7 100755
--- a/configure
+++ b/configure
@@ -44,6 +44,7 @@  make="make"
 install="install"
 objcopy="objcopy"
 ld="ld"
+helper_cflags=""

 # parse CC options first
 for opt do
@@ -533,6 +534,7 @@  case "$cpu" in
            QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS"
            if test "$solaris" = "no" ; then
              QEMU_CFLAGS="-ffixed-g1 -ffixed-g6 $QEMU_CFLAGS"
+             helper_cflags="-ffixed-i0"
            fi
            ;;
     sparc64)
@@ -549,6 +551,7 @@  case "$cpu" in
     i386)
            QEMU_CFLAGS="-m32 $QEMU_CFLAGS"
            LDFLAGS="-m32 $LDFLAGS"
+           helper_cflags="-fomit-frame-pointer"
            host_guest_base="yes"
            ;;
     x86_64)
@@ -1753,6 +1756,7 @@  echo "OBJCOPY=$objcopy" >> $config_host_mak
 echo "LD=$ld" >> $config_host_mak
 echo "CFLAGS=$CFLAGS" >> $config_host_mak
 echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
+echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
 echo "LDFLAGS=$LDFLAGS" >> $config_host_mak
 echo "ARLIBS_BEGIN=$arlibs_begin" >> $config_host_mak
 echo "ARLIBS_END=$arlibs_end" >> $config_host_mak