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
build: undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' on CentOS 6 #4639
Comments
Caused commit is:
|
Error:
|
Fix is to add the compiling option '-lrt', like:
Need to add lrt to all built failed tests at 'test/unit/CMakeLists.txt' file (25 entries from 60) |
avtikhon
added a commit
that referenced
this issue
Nov 22, 2019
After the commit 77fa45b the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 To fix it the rt library needed to be added like for unit tests builds. Added -lrt to 25 builds from overall 60 at cmake file. Close #4639
avtikhon
added a commit
that referenced
this issue
Nov 22, 2019
After the commit 77fa45b the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 To fix it the rt library needed to be added like for unit tests builds. Added -lrt to 25 builds from overall 60 at cmake file. Close #4639
avtikhon
added a commit
that referenced
this issue
Nov 22, 2019
After the commit 77fa45b the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 To fix the issue the 'rt' library was added to test unit cmake file only for linux and freebsd targets. Close #4639
avtikhon
added a commit
that referenced
this issue
Nov 26, 2019
After the commit 77fa45b the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 To fix the issue the 'rt' library was added to test unit cmake file only for linux and freebsd targets. Close #4639
avtikhon
added a commit
that referenced
this issue
Nov 29, 2019
After the commit 77fa45b ('lua: add fiber.top() listing fiber cpu consumption') the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 To fix the issue the 'rt' library was added to test unit cmake file only for linux and freebsd targets. Close #4639
avtikhon
added a commit
that referenced
this issue
Nov 29, 2019
After the commit 77fa45b ('lua: add fiber.top() listing fiber cpu consumption') the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 Found that fiber.cc is using now clock_gettime(), which requires -lrt with glibc. To fix it added librt dependency for core library for glibc. Due to glibc requires for -lrt for clock_gettime() only for some versions, check 'man clock_gettime.2': 'Link with -lrt (only for glibc versions before 2.17).' the check whether is able to use clock_gettime() w/o librt library is added. Close #4639
avtikhon
added a commit
that referenced
this issue
Dec 6, 2019
After the commit 77fa45b ('lua: add fiber.top() listing fiber cpu consumption') the unit tests builds failed like: /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld: ../../src/lib/core/libcore.a(fiber.c.o): undefined reference to symbol 'clock_gettime@@GLIBC_2.2.5' //lib64/librt.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status test/unit/CMakeFiles/cbus.test.dir/build.make:108: recipe for target 'test/unit/cbus.test' failed make[2]: *** [test/unit/cbus.test] Error 1 Found that fiber.cc is using now clock_gettime(), which requires -lrt with glibc. To fix it added librt dependency for core library for glibc. Due to glibc requires for -lrt for clock_gettime() only for some versions, check 'man clock_gettime.2': 'Link with -lrt (only for glibc versions before 2.17).' the check whether is able to use clock_gettime() w/o librt library is added. Close #4639
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tarantool version: 2.3.0-231-g22bbb34fb.
OS version: CentOS 6.
Tarantool fails to build on CentOS 6 in our CI.
https://travis-ci.org/tarantool/tarantool/jobs/615173058
https://gitlab.com/tarantool/tarantool/-/jobs/357787965
Relevant part of a build log:
The text was updated successfully, but these errors were encountered: