qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 1/2] target/arm: Add stubs to build with CON


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] target/arm: Add stubs to build with CONFIG_SEMIHOSTING disabled
Date: Mon, 17 Jun 2019 16:19:55 +0100
User-agent: mu4e 1.3.2; emacs 26.1

Philippe Mathieu-Daudé <address@hidden> writes:

> If a distribution wants to build QEMU without semihosting support,
> it currently gets this build failure:
>
>   $ ./configure --target-list=aarch64-softmmu --without-default-devices
>   $ sed -i 
> s/CONFIG_SEMIHOSTING=y/CONFIG_SEMIHOSTING=n/default-configs/arm-softmmu.mak

I'm still not convinced we should be adding support for stuff being done
outside the normal build process... that said...

>   $ make subdir-aarch64-softmmu
>   [...]
>     LINK    aarch64-softmmu/qemu-system-aarch64
>   /usr/bin/ld: target/arm/arm-semi.o: in function `do_arm_semihosting':
>   ./target/arm/arm-semi.c:321: undefined reference to 
> `qemu_semihosting_console_out'
>   /usr/bin/ld: ./target/arm/arm-semi.c:318: undefined reference to 
> `qemu_semihosting_console_out'
>   collect2: error: ld returned 1 exit status
>   make[1]: *** [Makefile:204: qemu-system-aarch64] Error 1
>   make: *** [Makefile:472: subdir-aarch64-softmmu] Error 2
>
> Fix it by providing a stub when semihosting is disabled.
>
> Reported-by: Miroslav Rezanina <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  target/arm/Makefile.objs    |  3 ++-
>  target/arm/arm-semi-stubs.c | 21 +++++++++++++++++++++
>  2 files changed, 23 insertions(+), 1 deletion(-)
>  create mode 100644 target/arm/arm-semi-stubs.c
>
> diff --git a/target/arm/Makefile.objs b/target/arm/Makefile.objs
> index 6bdcc65c2c..39b02b1fa4 100644
> --- a/target/arm/Makefile.objs
> +++ b/target/arm/Makefile.objs
> @@ -1,4 +1,5 @@
> -obj-y += arm-semi.o
> +obj-$(CONFIG_SEMIHOSTING) += arm-semi.o
> +obj-$(call lnot,$(CONFIG_SEMIHOSTING)) += arm-semi-stubs.o
>  obj-$(CONFIG_SOFTMMU) += machine.o psci.o arch_dump.o monitor.o
>  obj-$(CONFIG_KVM) += kvm.o
>  obj-$(call land,$(CONFIG_KVM),$(call lnot,$(TARGET_AARCH64))) += kvm32.o
> diff --git a/target/arm/arm-semi-stubs.c b/target/arm/arm-semi-stubs.c
> new file mode 100644
> index 0000000000..a91ecbd9d5
> --- /dev/null
> +++ b/target/arm/arm-semi-stubs.c
> @@ -0,0 +1,21 @@
> +/*
> + *  Arm "Angel" semihosting stubs
> + *
> + * Copyright (c) 2019 Red Hat, Inc.
> + *
> + * Author:
> + *   Philippe Mathieu-Daudé <address@hidden>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +#include "qemu/osdep.h"
> +#include "cpu.h"
> +
> +target_ulong do_arm_semihosting(CPUARMState *env)
> +{
> +    g_assert_not_reached();
> +}

Could this not just be added to arm-semi.c in an

  #ifndef CONFIG_SEMIHOSTING
  target_ulong do_arm_semihosting(CPUARMState *env)
  {
      g_assert_not_reached();
  }
  #else
  ... rest of arm-semi.c....
  #endif


--
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]