Opened 4 years ago
Last modified 3 months ago
#61691 new enhancement
legacy-support: add clock_gettime_nsec_np and CLOCK_UPTIME_RAW
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | snowflake (Dave Evans), mascguy (Christopher Nielsen), fhgwright (Fred Wright) | |
Port: | legacy-support, php-xdebug |
Description
php-xdebug 3.0.0 fails to build on OS X 10.11 and earlier, even when legacysupport is used:
src/lib/timing.c:111:9: warning: implicit declaration of function 'clock_gettime_nsec_np' is invalid in C99 [-Wimplicit-function-declaration] return clock_gettime_nsec_np(CLOCK_UPTIME_RAW); ^ src/lib/timing.c:111:31: error: use of undeclared identifier 'CLOCK_UPTIME_RAW' return clock_gettime_nsec_np(CLOCK_UPTIME_RAW); ^
Is adding support for clock_gettime_nsec_np
and CLOCK_UPTIME_RAW
feasible?
Change History (11)
comment:1 Changed 4 years ago by kencu (Ken)
comment:2 Changed 4 years ago by snowflake (Dave Evans)
Can I put in a request for these from sbcl?
runtime.c:401:5: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] clock_gettime( ^ runtime.c:405:9: error: use of undeclared identifier 'CLOCK_MONOTONIC' CLOCK_MONOTONIC ^
comment:3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | snowflake added |
---|
Dave, legacy support already implements clock_gettime and CLOCK_MONOTONIC.
comment:4 Changed 4 years ago by kencu (Ken)
making sbcl use legacysupport is hard, so I patched it instead...did I not push that patch yet? Silly me.
comment:5 Changed 4 years ago by kencu (Ken)
comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:7 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
comment:8 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)
Port: | libbson added |
---|
libbson is now affected by this as well.
comment:9 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)
Port: | libbson removed |
---|
Eh, only because their code is stupid. They also support clock_gettime
so including legacysupport fixed it.
comment:10 follow-up: 11 Changed 3 months ago by mascguy (Christopher Nielsen)
Cc: | mascguy fhgwright added |
---|
Fred, what are your thoughts on this?
comment:11 Changed 3 months ago by fhgwright (Fred Wright)
Replying to mascguy:
Fred, what are your thoughts on this?
Seems plausible in principle, though I haven't looked at the details yet. Feel free to assign it to me, though I don't want to worry about it for this release cycle. Given that it's a four-year old ticket, I don't imagine there's a rush. :-)
I was planning to review old tickets at some point. There's also one PR that's almost two years old, and may or may not still be relevant.
BTW, in spite of what's claimed in the "their code is stupid" link, clock_gettime
wasn't introduced until 10.12.
As of OS X 10.12, the clock handling in darwin became more finely resolved. There is also an issue now building libcxx-11 (which is part of building clang-11) on < 10.12 due to this clock issue.
The libcxx source code had a fallback that was used until recently, when it was deleted here here.
To get newer clangs building on older systems we'll have to reinstate that fallback, and perhaps it might in the end be done in legacysupport... have to look at it closely to see how it fits in with what we already have there, and whether it might serve as the basis for this missing function.