From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnm0v-0000Xt-Q5 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:11:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnm0r-0006A9-9L for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:11:29 -0500 From: Markus Armbruster References: <1385364460-24332-1-git-send-email-aik@ozlabs.ru> <1385364460-24332-3-git-send-email-aik@ozlabs.ru> <529429AA.1000403@ozlabs.ru> <529D5570.8060205@ozlabs.ru> Date: Tue, 03 Dec 2013 10:11:21 +0100 In-Reply-To: <529D5570.8060205@ozlabs.ru> (Alexey Kardashevskiy's message of "Tue, 03 Dec 2013 14:52:16 +1100") Message-ID: <87fvqaqoxy.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/5] machine: introduce get_fw_dev_path() callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Andreas =?utf-8?Q?F=C3=A4rber?= Alexey Kardashevskiy writes: > On 11/26/2013 03:55 PM, Alexey Kardashevskiy wrote: >> Hi! >> >> btw there is a problem with this patch - it does not compile for >> "linux-user" as there is no current-machine global variable defined in vl.c >> which is not compiled for linux-user. >> >> How to solve this problem correctly? [...] > Anyone, please? > > The only easy fix for this I can think of would be this: > > extern QEMUMachine *current_machine __attribute__((weak)); > > > But I suspect this is disgusting? :) Absolutely not. It's merely not portable to machines with object file formats and linkers stuck in the 80s. However, we routinely twist ourselves into knots for portability (observation, not endorsement), and at least one previous attempt[*] to introduce weak symbols got nowhere. [*] https://lists.nongnu.org/archive/html/qemu-devel/2012-07/msg03853.html