fix gettimeofday() on alpha (see https://bugs.debian.org/890813)#147
Merged
wolfcw merged 1 commit intowolfcw:masterfrom Feb 19, 2018
Merged
fix gettimeofday() on alpha (see https://bugs.debian.org/890813)#147wolfcw merged 1 commit intowolfcw:masterfrom
wolfcw merged 1 commit intowolfcw:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In https://bugs.debian.org/890813, Michael Cree mcree@orcon.net.nz
reports: