Closed stefanalt closed 3 years ago
The problem there is that Makefile.PL wants to build and run tests to figure out what's supported, which is a no-go for cross builds. So instead top-level configure does a quick compile-only test for clock_gettime and sets $Config{d_clock_gettime} = 'define' to suppress testing in Time::HiRes Makefile.PL and force it to build clock_gettime support. That "unlikely" case is exactly what's supposed to happen during cross builds.
Something clearly isn't working as intended though. It's not building clock_gettime support for me either even though d_clock_gettime gets set correctly. Looking into this.
Should be fixed now.
I cross build with buildroot for an X86-linux-glibc platform. Perl 5.30.3, Perl-Cross 1.3.4, but the problem also occurs with older versions. I need clock_gettime to be able to use CLOCK_MONOTONIC. The built HiRes.so does not request clock_getttime() symbol. Hi-res time() is working properly. It looks like this:
But should look like this:
My investigation so far:
perl-5.30.3/dist/Time-HiRes/xdefine is missing:
-DTIME_HIRES_CLOCK_GETTIME
In dist/Time-HiRes/Makefile.PL
Seems the first if() is triggered by a pre-set $Config ? If I modify to if( 0 and ....), then Makefile.PL properly detects clock_gettime() and finally builds the .so file correctly.
However, for this to work
TIME_HIRES_DONT_RUN_PROBES=1
must be in the ENV.Or is there a better solution to this.