Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftime #48

Closed
0-wiz-0 opened this issue Jan 23, 2015 · 5 comments
Closed

ftime #48

0-wiz-0 opened this issue Jan 23, 2015 · 5 comments

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Jan 23, 2015

frametest.c and fuzzer.c need to be adapted in the same way that fullbench and bench already are wrt. sys/timeb.h and the ftime syscall.

Currently, they fail to build e.g. on NetBSD with:

# gmake frametest
cc      -I../lib  -O3 -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"r126\"  ../lib/lz4frame.c ../lib/lz4.c ../lib/lz4hc.c ../lib/xxhash.c frametest.c -o frametest
/var/tmp//ccDdJ0OZ.o: In function `fuzzerTests':
frametest.c:(.text+0x1152): undefined reference to `ftime'
frametest.c:(.text+0x13e4): undefined reference to `ftime'
/var/tmp//ccDdJ0OZ.o: In function `main':
frametest.c:(.text.startup+0x2a5): undefined reference to `ftime'
Makefile:90: recipe for target 'frametest' failed
gmake: *** [frametest] Error 1
# gmake fuzzer
cc      -I../lib  -O3 -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -pedantic -DLZ4_VERSION=\"r126\"  ../lib/lz4.c ../lib/lz4hc.c ../lib/xxhash.c fuzzer.c -o fuzzer
/var/tmp//ccMMIjtu.o: In function `FUZ_test':
fuzzer.c:(.text+0x539): undefined reference to `ftime'
fuzzer.c:(.text+0x585): undefined reference to `ftime'
/var/tmp//ccMMIjtu.o: In function `FUZ_unitTests':
fuzzer.c:(.text+0x2d4e): undefined reference to `ftime'
fuzzer.c:(.text+0x2d93): undefined reference to `ftime'
/var/tmp//ccMMIjtu.o: In function `main':
fuzzer.c:(.text.startup+0x3bc): undefined reference to `ftime'
Makefile:84: recipe for target 'fuzzer' failed
gmake: *** [fuzzer] Error 1
@Cyan4973
Copy link
Member

ok, thanks for notification

@Cyan4973
Copy link
Member

Cyan4973 commented Mar 7, 2015

I'm wondering if there is a way to test that.
I can certainly do the requested modification,
but would feel safer if it can be tested automatically,
rather than wait for 3rd party to notify when/if it breaks.

@0-wiz-0
Copy link
Author

0-wiz-0 commented Mar 7, 2015

Well, the usual way is to write configure tests.
I suggest using gettimeofday instead of ftime, it's more portable; or possibly clock_gettime, if you prefer.

Cyan4973 added a commit that referenced this issue Mar 7, 2015
@Cyan4973
Copy link
Member

Cyan4973 commented Mar 7, 2015

The dev branch has been updated with requested modifications.
It should compile and run correctly on NetBSD (although I have no NetBSD configuration available around to test).

Regarding the test, it's a bit more complex than that :
gettimeofday is already tested correctly, using Ubuntu & Mint systems.
What I meant is, I need to test if the fallback to ftime works correctly (including the automated switch itself).
This is system-oriented test, and seems more complex to setup within a C.I. environment.

@0-wiz-0
Copy link
Author

0-wiz-0 commented Mar 9, 2015

Thanks, I tried the dev branch on NetBSD and it built fine.

@0-wiz-0 0-wiz-0 closed this as completed Mar 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants