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

Link fails on CentOS6 #3

Closed
fadushin opened this issue Nov 8, 2018 · 0 comments
Closed

Link fails on CentOS6 #3

fadushin opened this issue Nov 8, 2018 · 0 comments

Comments

@fadushin
Copy link
Collaborator

fadushin commented Nov 8, 2018

The linker is unable to resolve clock-gettime with the default linker flags on CentOS 6.

12:12:02 marx:/work/src/github/fadushin/AtomVM/build> echo ${CC}
clang
12:15:37 marx:/work/src/github/fadushin/AtomVM/build> clang --version
clang version 3.4.2 (tags/RELEASE_34/dot2-final)
Target: x86_64-redhat-linux-gnu
Thread model: posix
12:15:47 marx:/work/src/github/fadushin/AtomVM/build> make
[ 1%] Built target generated-nifs-hash
[ 1%] Built target generated
[ 11%] Built target libAtomVM
Linking C executable AtomVM
CMakeFiles/AtomVM.dir/platforms/Linux/sys.c.o: In function sys_waitevents': /work/src/github/fadushin/AtomVM/src/platforms/Linux/sys.c:(.text+0x1b): undefined reference to clock_gettime'
/work/src/github/fadushin/AtomVM/src/platforms/Linux/sys.c:(.text+0x320): undefined reference to clock_gettime' CMakeFiles/AtomVM.dir/platforms/Linux/sys.c.o: In function sys_set_timestamp_from_relative_to_abs':
/work/src/github/fadushin/AtomVM/src/platforms/Linux/sys.c:(.text+0x43b): undefined reference to clock_gettime' CMakeFiles/AtomVM.dir/platforms/Linux/sys.c.o: In function sys_time':
/work/src/github/fadushin/AtomVM/src/platforms/Linux/sys.c:(.text+0x4e8): undefined reference to `clock_gettime'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/AtomVM] Error 1
make[1]: *** [src/CMakeFiles/AtomVM.dir/all] Error 2
make: *** [all] Error 2

Adding rt to the end of the linker flags seems to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants