Package: faketime / 0.9.7-2

Metadata

Package Version Patches format
faketime 0.9.7-2 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 Fix 114 as suggested by niraizik.patch | (download)

src/libfaketime.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 fix #114 as suggested by @niraizik

(cherry picked from commit a79f5330f4f983c4714f466a1f40c2c389696c1b)

0002 fix gettimeofday on alpha see https bugs.debian.org .patch | (download)

src/libfaketime.c | 8 8 + 0 - 0 !
1 file changed, 8 insertions(+)

 fix gettimeofday() on alpha (see https://bugs.debian.org/890813)

In https://bugs.debian.org/890813, Michael Cree <mcree@orcon.net.nz>
reports:

>  The faketime package fails to work correctly on the Alpha
>  architecture. This failure of faketime to work correctly is the
>  reason for the mbedtls FTBFS, which uses faketime in its test
>  suite [1].
>
>  Consider the following test program (which I call "time-test"):
>
>  #include <stdio.h>
>  #include <sys/time.h>
>  #include <unistd.h>
>
>  int main(void)
>  {
>      struct timeval tv;
>
>      for (int j=0; j<5; j++) {
>          usleep(10000);
>          gettimeofday(&tv, NULL);
>          printf("s=%ld    us=%ld\n", tv.tv_sec, tv.tv_usec);
>      }
>      return 0;
>  }
>
>  When run it produces output like:
>
>  s=1519025990    us=838219
>  s=1519025990    us=848965
>  s=1519025990    us=859711
>  s=1519025990    us=870456
>  s=1519025990    us=881202
>
>  But when run as (with faketime built in its source directory):
>
>  LD_PRELOAD=faketime-0.9.7/src/libfaketime.so.1 FAKETIME="-1d" ./time-test
>
>  the output is:
>
>  s=2199023743604    us=0
>  s=2199023657204    us=0
>  s=2199023570804    us=0
>  s=2199023484404    us=0
>  s=2199023398004    us=0
>
>  which is definitely not correct.
>
>  The reason for the incorrect behaviour is that there are two
>  gettimeofday symbols in libc on Alpha and the dlsym() call to link
>  to the gettimeofday() is picking up the function with the wrong ABI.
>  I attach a patch to fix that.  Faketime built with the attached
>  patch works correctly and with a fixed faketime the mbedtls source
>  package builds to completion on Alpha.

0003 Use CPPFLAGS during compilation.patch | (download)

src/Makefile | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 use cppflags during compilation

CPPFLAGS is traditionally used to include C preprocessor flags.  While
faketime doesn't apply anything to CPPFLAGS directly, it is good form
to adopt standard settings that might be externally applied.