On 23/09/2019 20.50, Peter Maydell wrote: > On Mon, 23 Sep 2019 at 19:36, Thomas Huth <th...@redhat.com> wrote: >> >> On 23/09/2019 20.27, Peter Maydell wrote: >>> On Mon, 23 Sep 2019 at 18:54, Thomas Huth <th...@redhat.com> wrote: >>>> Ok, then what would you suggest to solve the problem that this file has >>>> always to be linked into the binary? I can't use "obj-y += ..." in >>>> hw/intc/Makefile.objs since that would mean that the file also gets >>>> compiled for non-Arm boards. Would you prefer a bunch of stubs instead >>>> that get used if CONFIG_ARM_V7M is not set? >>> >>> I thought obj-y was for only-this-target and obj-common-y was >>> for all-boards ? >> >> Well, obj-y is for the current target that gets compiled. But if you use >> it in a Makefile that gets used by all targets, the file gets compiled >> for each target individually. >> >> Just try to change "obj-$(CONFIG_ARM_V7M) += armv7m_nvic.o" into >> "obj-y += armv7m_nvic.o" in hw/int/Makefile.objs, and you'll see it break: >> >> CC alpha-softmmu/hw/intc/armv7m_nvic.o >> In file included from include/hw/intc/armv7m_nvic.h:13, >> from hw/intc/armv7m_nvic.c:19: >> target/arm/cpu.h:1416: error: "FPCR_DZE" redefined [-Werror] >> #define FPCR_DZE (1 << 9) /* Divide by Zero exception trap enable */ > > Sure, so don't define CONFIG_ARM_V7M in a default-config for > a non-Arm architecture. Then you get the behaviour you want: > the file is compiled only for the arm targets.
Sigh, the point of this series is that it should also possible to compile *without* CONFIG_ARM_V7M in default-configs if you want (and yes, there are people out there who want to be able to compile a minimalistic QEMU). It's currently not possible to disable this switch. But ok, if you're not really interested in providing a possibility to make qemu-system-arm a little bit more flexible in this regard, never mind, I'll look into other issues instead. Thomas