Opened 4 years ago
Last modified 3 weeks ago
#61691 assigned enhancement
legacy-support: add clock_gettime_nsec_np and CLOCK_UPTIME_RAW
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | fhgwright (Fred Wright) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | snowflake (Dave Evans), mascguy (Christopher Nielsen) | |
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 (13)
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 17 months ago by ryandesign (Ryan Carsten Schmidt)
Port: | libbson added |
---|
libbson is now affected by this as well.
comment:9 Changed 17 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 4 months ago by mascguy (Christopher Nielsen)
Cc: | mascguy fhgwright added |
---|
Fred, what are your thoughts on this?
comment:11 follow-up: 12 Changed 4 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.
comment:12 follow-up: 13 Changed 3 weeks ago by mascguy (Christopher Nielsen)
Cc: | fhgwright removed |
---|---|
Owner: | set to fhgwright |
Status: | new → assigned |
Replying to fhgwright:
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.
Support for this would definitely be useful, as we need it for new port mozjs128
:
mozjs128/work/mozjs-128.1.0/mozglue/misc/AwakeTimeStamp.cpp:64:25: error: use of undeclared identifier 'clock_gettime_nsec_np'
comment:13 Changed 3 weeks ago by fhgwright (Fred Wright)
Replying to mascguy:
Replying to fhgwright:
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.
Support for this would definitely be useful, as we need it for new port
mozjs128
:mozjs128/work/mozjs-128.1.0/mozglue/misc/AwakeTimeStamp.cpp:64:25: error: use of undeclared identifier 'clock_gettime_nsec_np'
My intent, after finishing some mostly "cleanup" changes, is to review the open tickets (and PR) to see which might be straightforward enough to include in this release cycle. One problem with anything clock-related is that it's hard to write an automated test for something that's a moving target, and the existing clock test is mainly just a manual test masquerading as an automated test, requiring manual scrutiny of the output for validity. At least the rewritten version no longer treats out-and-out failures of the functions being tested as a "pass" (exposing one real bug in the process). :-)
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.