Skip to contentSkip to conversation

qemu-io-cmds does not compile on macOS

Qemu-devel Peter Maydell 2 participants 2 messages Jun 23, 2019 – Jun 24, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Juan Rafael García Blanco

I think the latest changes to qemu-io-cmds.c make it impossible to compile under macOS. It now uses clock_gettime, which is not available in this OS. I’m using 10.9.5; I think this function is now included in 10.12.

I would step up to try to prepare a patch that uses a replacement in case it is being compiled in a macOS version that does not include that function. But I do not know if you want to support these ‘old' macOS versions…

Hi; thanks for this report. (This kind of bug report is better sent to qemu-devel or to the launchpad bug tracker -- qemu-discuss is mostly user-to-user conversations, and developers tend to be on -devel; I've cc'd -devel on this.)

Our official support policy is that we support building with the two most recent versions of macOS; in practice we might support building with some earlier versions; as of commit 5588840ff77800e839 we definitely dropped support for anything earlier than 10.10. So in theory we don't strongly care about anything before 10.13 at the moment; but if it's easy to avoid the problem it might be worth doing that.

Alex, it looks like the relevant commit was one of yours. Could you have a look at how easy it would be to support systems without clock_gettime/CLOCK_MONOTONIC ?
I notice that other places in QEMU have #ifdeffery for a lack of CLOCK_MONOTONIC, so we should ideally be consistent, and either support systems without it, or else say we require it and remove the remaining legacy ifdefs...

thanks
-- PMM

#2 lore raw
Quoted 19 lines · Peter Maydell
Quoted 3 lines · Juan Rafael García Blanco

I think the latest changes to qemu-io-cmds.c make it impossible to compile under macOS. It now uses clock_gettime, which is not available in this OS. I’m using 10.9.5; I think this function is now included in 10.12.

I would step up to try to prepare a patch that uses a replacement in case it is being compiled in a macOS version that does not include that function. But I do not know if you want to support these ‘old' macOS versions…

Hi; thanks for this report. (This kind of bug report is better sent to qemu-devel or to the launchpad bug tracker -- qemu-discuss is mostly user-to-user conversations, and developers tend to be on -devel; I've cc'd -devel on this.)

Our official support policy is that we support building with the two most recent versions of macOS; in practice we might support building with some earlier versions; as of commit 5588840ff77800e839 we definitely dropped support for anything earlier than 10.10. So in theory we don't strongly care about anything before 10.13 at the moment; but if it's easy to avoid the problem it might be worth doing that.

Quoted 1 line

Alex, it looks like the relevant commit was one of yours.

Which commit was that?

Quoted 6 lines

Could you have a look at how easy it would be to support systems without clock_gettime/CLOCK_MONOTONIC ?
I notice that other places in QEMU have #ifdeffery for a lack of CLOCK_MONOTONIC, so we should ideally be consistent, and either support systems without it, or else say we require it and remove the remaining legacy ifdefs...

Ahh was this the changes to qemu-iocmds to use proper monotonic clocks to avoid /0 that was occuring with gettimeofday?

In the main code we have comments about:

/* XXX: using gettimeofday leads to problems if the date
changes, so it should be avoided. */

Is this the only option for old MacOS?

Quoted 3 lines

thanks
-- PMM

--
Alex Bennée