From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZdpD-0002Ii-9I for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZdp8-0000cH-9K for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:46:03 -0400 Received: from mx2.parallels.com ([199.115.105.18]:57235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZdp8-0000bO-4O for qemu-devel@nongnu.org; Wed, 09 Sep 2015 07:45:58 -0400 Message-ID: <55F016E1.7030500@odin.com> Date: Wed, 9 Sep 2015 14:24:17 +0300 From: Pavel Butsykin MIME-Version: 1.0 References: <1441696197-22265-1-git-send-email-den@openvz.org> <1441696197-22265-3-git-send-email-den@openvz.org> <55EEB066.5040304@redhat.com> <20150908101304.GA8863@ad.nay.redhat.com> In-Reply-To: <20150908101304.GA8863@ad.nay.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] monitor: remove target-specific code from monitor.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , Paolo Bonzini Cc: "Denis V. Lunev" , Pavel Butsykin , Luiz Capitulino , qemu-devel@nongnu.org, Peter Maydell On 08.09.2015 13:13, Fam Zheng wrote: > On Tue, 09/08 11:54, Paolo Bonzini wrote: >> >> On 08/09/2015 09:09, Denis V. Lunev wrote: >>> qemu-monitor-info.texi | 151 +++++++ >> This should be added in patch 4, not now. >> >>> +const MonitorDef *target_monitor_defs(void) __attribute__((weak)); >>> + >>> +const MonitorDef *target_monitor_defs(void) >>> +{ >>> + return NULL; >>> +} >> Weak symbols do not work on all platforms. Luckily, making libqemustub >> a static library gets exactly the same result without the need for weak >> symbols: the definition from the QEMU object files will hide the stub. >> >> You just need to remove __attribute__((weak)), and it should just work. >> >> Otherwise, the patches look good to me. Luiz, do you have time to post >> a pull request for v4, or do you want to pass HMP maintainership as well >> to someone else? > Didn't look at the patch, but Patchew is catching this for cross build: > > running command: /tmp/qemu-build/configure --prefix=/var/tmp/qemu-build-install --cross-prefix=x86_64-w64-mingw32- --target-list=x86_64-softmmu,aarch64-softmmu ... > running command: make -j2 ... > Failed: > [snip] > CC aarch64-softmmu/target-arm/kvm-stub.o > CC aarch64-softmmu/target-arm/translate.o > CC aarch64-softmmu/target-arm/op_helper.o > CC aarch64-softmmu/target-arm/helper.o > CC aarch64-softmmu/target-arm/cpu.o > CC aarch64-softmmu/target-arm/neon_helper.o > CC aarch64-softmmu/target-arm/iwmmxt_helper.o > CC aarch64-softmmu/target-arm/gdbstub.o > CC aarch64-softmmu/target-arm/psci.o > CC aarch64-softmmu/target-arm/cpu64.o > CC aarch64-softmmu/target-arm/translate-a64.o > CC aarch64-softmmu/target-arm/helper-a64.o > CC aarch64-softmmu/target-arm/gdbstub64.o > CC aarch64-softmmu/target-arm/crypto_helper.o > GEN trace/generated-helpers.c > CC aarch64-softmmu/gdbstub-xml.o > CC aarch64-softmmu/trace/generated-helpers.o > LINK aarch64-softmmu/qemu-system-aarch64w.exe > monitor.o: In function `get_monitor_def': > /tmp/qemu-build/monitor.c:2091: undefined reference to `target_monitor_defs' > collect2: error: ld returned 1 exit status > Makefile:184: recipe for target 'qemu-system-aarch64w.exe' failed > make[1]: *** [qemu-system-aarch64w.exe] Error 1 > Makefile:179: recipe for target 'subdir-aarch64-softmmu' failed > make: *** [subdir-aarch64-softmmu] Error 2 As it turned out, this reaction occurs when using a weak symbol.