$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
$(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
-$(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
-
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
romsubdir-%:
# CPUs and machines.
obj-y = $(block-obj-y)
-obj-y += readline.o console.o host-utils.o
+obj-y += readline.o console.o
obj-y += irq.o ptimer.o
obj-y += i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
libqemu_common.a: $(obj-y)
-#######################################################################
-# user-obj-y is code used by qemu userspace emulation
-user-obj-y = cutils.o cache-utils.o path.o envlist.o host-utils.o
-
-libqemu_user.a: $(user-obj-y)
-
######################################################################
qemu-img.o: qemu-img-cmds.h
#########################################################
# cpu emulator library
-libobj-y = exec.o translate-all.o cpu-exec.o translate.o
+libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o
libobj-y += tcg/tcg.o tcg/tcg-runtime.o
libobj-$(CONFIG_SOFTFLOAT) += fpu/softfloat.o
libobj-$(CONFIG_NOSOFTFLOAT) += fpu/softfloat-native.o
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
-
obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \
elfload.o linuxload.o uaccess.o gdbstub.o gdbstub-xml.o
+obj-y += envlist.o path.o
obj-$(TARGET_HAS_BFLT) += flatload.o
obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o
obj-m68k-y += m68k-sim.o m68k-semi.o
-ARLIBS=../libqemu_user.a libqemu.a
+ARLIBS=libqemu.a
endif #CONFIG_LINUX_USER
#########################################################
obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \
gdbstub.o gdbstub-xml.o
+obj-y += envlist.o path.o
obj-i386-y += ioport-user.o
obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
gdbstub.o gdbstub-xml.o uaccess.o
+obj-y += envlist.o path.o
obj-i386-y += ioport-user.o
-ARLIBS=libqemu.a ../libqemu_user.a
+ARLIBS=libqemu.a
endif #CONFIG_BSD_USER
+ifdef CONFIG_USER_ONLY
+# hack to compile with -fpie for *-user targets
+obj-y += cutils-user.o cache-utils-user.o
+cutils-user.c cache-utils-user.c:
+ @echo " LN $(TARGET_DIR)$@"
+ @ln -s $(SRC_PATH)/$(@:%-user.c=%.c) $@
+endif
+
+
#########################################################
# System emulator target
ifdef CONFIG_SOFTMMU
blobs="yes"
pkgversion=""
check_utests="no"
+user_pie="no"
# OS specific
if check_define __linux__ ; then
;;
--disable-guest-base) guest_base="no"
;;
+ --enable-user-pie) user_pie="yes"
+ ;;
+ --disable-user-pie) user_pie="no"
+ ;;
--enable-uname-release=*) uname_release="$optarg"
;;
--sparc_cpu=*)
echo " --enable-guest-base enable GUEST_BASE support for usermode"
echo " emulation targets"
echo " --disable-guest-base disable GUEST_BASE support"
+echo " --enable-user-pie build usermode emulation targets as PIE"
+echo " --disable-user-pie do not build usermode emulation targets as PIE"
echo " --fmod-lib path to FMOD library"
echo " --fmod-inc path to FMOD includes"
echo " --oss-lib path to OSS library"
echo "uname -r $uname_release"
echo "NPTL support $nptl"
echo "GUEST_BASE $guest_base"
+echo "PIE user targets $user_pie"
echo "vde support $vde"
echo "IO thread $io_thread"
echo "Linux AIO support $linux_aio"
esac
fi
+if test "$target_user_only" = "yes" -a "$static" = "no" -a \
+ "$user_pie" = "yes" ; then
+ cflags="-fpie $cflags"
+ ldflags="-pie $ldflags"
+fi
+
if test "$target_softmmu" = "yes" -a \( \
"$TARGET_ARCH" = "microblaze" -o \
"$TARGET_ARCH" = "cris" \) ; then