On 12/03/2013 08:11 PM, Markus Armbruster wrote: > Alexey Kardashevskiy <a...@ozlabs.ru> 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