target/mips: only build mips-semi for softmmu
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 14 May 2019 12:50:45 +0000 (13:50 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 28 May 2019 09:28:51 +0000 (10:28 +0100)
The is_uhi gates all semihosting calls and always returns false for
CONFIG_USER_ONLY builds. There is no reason to build and link
mips-semi for these builds so lets fix that.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/mips/Makefile.objs
target/mips/helper.h
target/mips/translate.c

index 651f36f51763953ba9b3ae9a123b13272497d3a4..3448ad5e193cfbc1ccb4f20092a94ae830791d97 100644 (file)
@@ -1,4 +1,5 @@
 obj-y += translate.o dsp_helper.o op_helper.o lmi_helper.o helper.o cpu.o
-obj-y += gdbstub.o msa_helper.o mips-semi.o
+obj-y += gdbstub.o msa_helper.o
+obj-$(CONFIG_SOFTMMU) += mips-semi.o
 obj-$(CONFIG_SOFTMMU) += machine.o cp0_timer.o
 obj-$(CONFIG_KVM) += kvm.o
index a6d687e3405696b7768f91414d57a288ede09473..90ab03b76e3162e2e37f3b22cd3238f61ff4189a 100644 (file)
@@ -2,7 +2,9 @@ DEF_HELPER_3(raise_exception_err, noreturn, env, i32, int)
 DEF_HELPER_2(raise_exception, noreturn, env, i32)
 DEF_HELPER_1(raise_exception_debug, noreturn, env)
 
+#ifndef CONFIG_USER_ONLY
 DEF_HELPER_1(do_semihosting, void, env)
+#endif
 
 #ifdef TARGET_MIPS64
 DEF_HELPER_4(sdl, void, env, tl, tl, int)
index 3cd5b11b16b9b05c052b4fbdc00eaf616895a070..fb905c88b5715dba84d695054f2abd99c727708b 100644 (file)
@@ -13726,6 +13726,14 @@ static inline bool is_uhi(int sdbbp_code)
 #endif
 }
 
+#ifdef CONFIG_USER_ONLY
+/* The above should dead-code away any calls to this..*/
+static inline void gen_helper_do_semihosting(void *env)
+{
+    g_assert_not_reached();
+}
+#endif
+
 static int decode_mips16_opc (CPUMIPSState *env, DisasContext *ctx)
 {
     int rx, ry;