qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@linux.ibm.com>
To: muriloo@linux.ibm.com,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org
Cc: "Daniel Henrique Barboza" <danielhb413@gmail.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	mopsfelder@gmail.com, qemu-ppc@nongnu.org,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set
Date: Tue, 03 May 2022 11:06:08 -0300	[thread overview]
Message-ID: <87sfpqaey7.fsf@linux.ibm.com> (raw)
In-Reply-To: <9ec244e0-4c7c-69ff-08f8-da451f6da449@linux.ibm.com>

Murilo Opsfelder Araújo <muriloo@linux.ibm.com> writes:

> $ cat > configs/devices/rh-virtio.mak <<"EOF"
> CONFIG_VIRTIO=y
> CONFIG_VIRTIO_BALLOON=y
> CONFIG_VIRTIO_BLK=y
> CONFIG_VIRTIO_GPU=y
> CONFIG_VIRTIO_INPUT=y
> CONFIG_VIRTIO_INPUT_HOST=y
> CONFIG_VIRTIO_NET=y
> CONFIG_VIRTIO_RNG=y
> CONFIG_VIRTIO_SCSI=y
> CONFIG_VIRTIO_SERIAL=y
> EOF
>
> $ cat > configs/devices/ppc64-softmmu/ppc64-rh-devices.mak <<"EOF"
> include ../rh-virtio.mak
> CONFIG_DIMM=y
> CONFIG_MEM_DEVICE=y
> CONFIG_NVDIMM=y
> CONFIG_PCI=y
> CONFIG_PCI_DEVICES=y
> CONFIG_PCI_TESTDEV=y
> CONFIG_PCI_EXPRESS=y
> CONFIG_PSERIES=y
> CONFIG_SCSI=y
> CONFIG_SPAPR_VSCSI=y
> CONFIG_TEST_DEVICES=y
> CONFIG_USB=y
> CONFIG_USB_OHCI=y
> CONFIG_USB_OHCI_PCI=y
> CONFIG_USB_SMARTCARD=y
> CONFIG_USB_STORAGE_CORE=y
> CONFIG_USB_STORAGE_CLASSIC=y
> CONFIG_USB_XHCI=y
> CONFIG_USB_XHCI_NEC=y
> CONFIG_USB_XHCI_PCI=y
> CONFIG_VFIO=y
> CONFIG_VFIO_PCI=y
> CONFIG_VGA=y
> CONFIG_VGA_PCI=y
> CONFIG_VHOST_USER=y
> CONFIG_VIRTIO_PCI=y
> CONFIG_VIRTIO_VGA=y
> CONFIG_WDT_IB6300ESB=y
> CONFIG_XICS=y
> CONFIG_XIVE=y
> CONFIG_TPM=y
> CONFIG_TPM_SPAPR=y
> CONFIG_TPM_EMULATOR=y
> EOF
>
> $ mkdir build
> $ cd build
>

<snip>

> $ ../configure --without-default-devices --with-devices-ppc64=ppc64-rh-devices --target-list=ppc64-softmmu
> $ make -j
> ...
> /usr/bin/ld: libqemu-ppc64-softmmu.fa.p/monitor_misc.c.o:(.data.rel+0x3228): undefined reference to `hmp_info_via'
> collect2: error: ld returned 1 exit status
>
> Since TARGET_PPC is defined when building target ppc64-softmmu, the hmp_info_via will be referenced when processing the hmp-commands-info.hx.
> However, hmp_info_via implementation resides on hw/misc/mos6522.c, which is built only if CONFIG_MOS6522 is defined, as per hw/misc/meson.build.

I think this particular problem you hit is due to the 64 bit devices
file including 32 bit as well:

$ cat configs/devices/ppc64-softmmu/default.mak 
# Default configuration for ppc64-softmmu

# Include all 32-bit boards
include ../ppc-softmmu/default.mak <----- here

# For PowerNV
CONFIG_POWERNV=y

# For pSeries
CONFIG_PSERIES=y
---

So ppc64-softmmu doesn't quite do what it says on the tin. I think in
the long run we need to revisit the conversation about whether to keep
the 32 & 64 bit builds separate. It is misleading that you're explicitly
excluding ppc-softmmu from the `--target-list`, but a some 32 bit stuff
still comes along implicitly.

> If hmp_info_via is generic enough and not device-specific, it could be moved out of mos6522.c to somewhere else.

Perhaps it would be easier to just have a stub for the 64 bits build? Do
HMP commands get in any way enabled/disabled depending on the emulated
hw that is available? It might be ok to have a hmp_info_via that is a
noop in 64bit.


  reply	other threads:[~2022-05-03 14:07 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 23:31 [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set Murilo Opsfelder Araujo
2022-05-02  9:43 ` Mark Cave-Ayland
2022-05-02 13:36   ` Murilo Opsfelder Araújo
2022-05-03 14:06     ` Fabiano Rosas [this message]
2022-05-04  7:16       ` Mark Cave-Ayland
2022-05-04 14:26         ` Fabiano Rosas
2022-05-04 14:48           ` Mark Cave-Ayland
2022-05-10  8:03             ` QEMU 32-bit vs. 64-bit binaries (was: [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set) Thomas Huth
2022-05-10  8:26               ` Alistair Francis
2022-05-10  8:54               ` QEMU 32-bit vs. 64-bit binaries Markus Armbruster
2022-05-10  9:01                 ` Thomas Huth
2022-05-10  9:14                   ` Peter Maydell
2022-05-10  9:22                     ` Dr. David Alan Gilbert
2022-05-10  9:31                       ` Thomas Huth
2022-05-10  9:47                         ` Peter Maydell
2022-05-10 10:14                         ` BALATON Zoltan
2022-05-10 12:20                         ` Gerd Hoffmann
2022-05-10 12:25                           ` Peter Maydell
2022-05-04  7:10     ` [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set Mark Cave-Ayland
2022-05-04 13:16       ` Murilo Opsfelder Araújo
2022-05-04 14:32         ` Mark Cave-Ayland
2022-05-05  1:24           ` Murilo Opsfelder Araújo
2022-05-05  8:19             ` Mark Cave-Ayland
2022-05-10  8:40               ` QEMU with reduced amount of machines in the config (was: [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set) Thomas Huth
2022-05-06 23:44   ` [PATCH] mos6522: fix linking error when CONFIG_MOS6522 is not set Murilo Opsfelder Araújo
2022-05-08  9:30     ` Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfpqaey7.fsf@linux.ibm.com \
    --to=farosas@linux.ibm.com \
    --cc=clg@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mopsfelder@gmail.com \
    --cc=muriloo@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).