From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnmLE-0007rK-1p for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:32:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnmL8-0004hB-ID for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:32:28 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:60605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnmL8-0004gM-CH for qemu-devel@nongnu.org; Tue, 03 Dec 2013 04:32:22 -0500 Received: by mail-pd0-f181.google.com with SMTP id p10so19658743pdj.40 for ; Tue, 03 Dec 2013 01:32:21 -0800 (PST) Message-ID: <529DA51F.1050806@ozlabs.ru> Date: Tue, 03 Dec 2013 20:32:15 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 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> <87fvqaqoxy.fsf@blackfin.pond.sub.org> In-Reply-To: <87fvqaqoxy.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Markus Armbruster Cc: Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= On 12/03/2013 08:11 PM, Markus Armbruster wrote: > 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 Since that GCC_WEAK patch did not make it to upstream, there must be another way of fixing my issue :) -- Alexey