qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 05/11] osdep: build with non-working system() function


From: Paolo Bonzini
Subject: Re: [PATCH v7 05/11] osdep: build with non-working system() function
Date: Mon, 25 Jan 2021 09:04:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 23/01/21 14:45, Peter Maydell wrote:
On Sat, 23 Jan 2021 at 03:18, Joelle van Dyne <j@getutm.app> wrote:
On Fri, Jan 22, 2021 at 3:17 PM Peter Maydell <peter.maydell@linaro.org> wrote:
Can we do the "does system() exist?" check in meson.build ?

config_host_data.set('HAVE_SYSTEM_FUNCTION', cc.has_function('system'))

Unfortunately, this doesn't work for iOS, which defines system() but
throws a compile time error if you try to call it.

That's odd -- as far as I can tell the meson implementation
of has_function() does what I expected it to do, ie
"try to compile and link a little program that uses the
function, and see if it successfully links":
https://github.com/mesonbuild/meson/blob/39ede12aa5b27376341df85bc9ec254913f044bd/mesonbuild/compilers/mixins/clike.py#L791
There's some initial cleverness there too, so I guess some
part of that must be what's tripping us up.

In any case, I think we should be doing new checks in
meson.build, not configure.  Paolo, what's the right
way to do a meson "really compile this program and
check it built" test?

One possibility is that you have to specify the #include in the "prefix" argument of cc.has_function for the test to behave as the QEMU code?

If cc.has_function doesn't work, there's cc.compiles() and cc.links().

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]