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 with -lrt (for glibc versions before 2.17) #98

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Feb 11, 2021

Fix link error on system with old glibc and old clang (7 - 8):

[  1%] Linking CXX executable std_filesystem_test
cd /home/.../ghc-filesystem/test && /opt/cmake/cmake-3.17.2-Linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/std_filesystem_test.dir/link.txt --verbose=1
/opt/llvm/clang+llvm-8.0.1-x86_64-linux-sles11.3/bin/clang++  -m64 -stdlib=libc++ -msse -msse2 -msse3 -mssse3 -Wall -Wextra -O3 -DNDEBUG -flto=thin  -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--disable-new-dtags CMakeFiles/std_filesystem_test.dir/filesystem_test.cpp.o  -o std_filesystem_test  -stdlib=libc++ -lc++fs
ld.lld: error: undefined symbol: clock_gettime
>>> referenced by operations.cpp
>>>               operations.cpp.o:(std::__1::__fs::filesystem::_FilesystemClock::now()) in archive /opt/llvm/clang+llvm-8.0.1-x86_64-linux-sles11.3/bin/../lib/libc++fs.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

@phprus phprus changed the title Link with -lrt (only for glibc versions before 2.17) Link with -lrt (for glibc versions before 2.17) Feb 11, 2021
@gulrak
Copy link
Owner

gulrak commented Feb 12, 2021

Thank you for the PR!

@gulrak gulrak added Linux Linux platform is affected test Issue with test code labels Feb 12, 2021
@gulrak gulrak added this to the v1.5.2 milestone Feb 12, 2021
@gulrak gulrak merged commit 0d109a7 into gulrak:master Feb 12, 2021
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Feb 12, 2021
@phprus phprus deleted the glibc-less-2.17 branch April 16, 2022 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release Linux Linux platform is affected test Issue with test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants