Opened 3 years ago

Last modified 10 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)
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 (9)

comment:1 Changed 3 years ago by kencu (Ken)

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.

comment:2 Changed 3 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 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: snowflake added

Dave, legacy support already implements clock_gettime and CLOCK_MONOTONIC.

comment:4 Changed 3 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:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In 4df3cf479782aef353d2e3ad44197679ad81cd0b/macports-ports (master):

php-xdebug: Remove legacy support portgroup

Remove legacy support portgroup which does not fix the build failure on
El Capitan and earlier.

See: #61691
See: #63350

comment:7 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In 0ddb8ae2e33029bdaf936e3c0755693707dd1c4d/macports-ports (master):

php-xdebug: Downgrade to 2.9.8 for OS X <= 10.11

Downgrade to 2.9.8 for OS X 10.11 and earlier since xdebug 3 and later
use clock_gettime_nsec_np on macOS which is not in 10.11 or earlier nor
in legacy support.

See: #61691
See: #63350

comment:8 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)

Port: libbson added

libbson is now affected by this as well.

comment:9 Changed 10 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.

Note: See TracTickets for help on using tickets.