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

Cilksan missing functions: __csan_fstat64 and __csan_cabs #290

Closed
ProExpertProg opened this issue Nov 24, 2024 · 3 comments
Closed

Cilksan missing functions: __csan_fstat64 and __csan_cabs #290

ProExpertProg opened this issue Nov 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ProExpertProg
Copy link

ProExpertProg commented Nov 24, 2024

Describe the bug

When linking a Cilksan program that uses functions std::abs and fstat64, the following errors appear:

/usr/bin/ld: CMakeFiles/src-lib.dir/lib/Naive.cpp.o: in function `operator()':
/home/luka/clion/adaptive-hermite-refinement/cpp/lib/Naive.cpp:279: undefined reference to `__csan_cabs'
/usr/bin/ld: _deps/spdlog-build/libspdlog.a(spdlog.cpp.o): in function `spdlog::details::os::filesize(_IO_FILE*)':
/home/luka/clion/adaptive-hermite-refinement/cpp/cmake-build-release-cilksan/_deps/spdlog-src/include/spdlog/details/os-inl.h:229: undefined reference to `__csan_fstat64'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)

Expected behavior

I expected linking to succeed.

OpenCilk version

  • Release version: 2.0
  • Distribution method: .sh archive

System information

  • OS: WSL 2.0: Ubuntu 22.04
  • CPU: 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz

Steps to reproduce (include relevant output)

  1. Put this into cilksan-bug.cpp
#include <iostream>
#include <sys/stat.h>
#include <complex>

int main() {
  std::cout << std::abs(std::complex<double>(1.0, 2.0)) << std::endl;
  struct stat64 buf;
  ::fstat64(0, &buf);
  std::cout << buf.st_dev << std::endl;
}
  1. Build with -fopencilk -fsanitize=cilk
clang++ -fopencilk -fsanitize=cilk cilksan-bug.cpp

Other notes

I'll try this on 2.1 tomorrow

@ProExpertProg ProExpertProg added the bug Something isn't working label Nov 24, 2024
@ProExpertProg
Copy link
Author

Update: The beta workaround (passing -mllvm -cilksan-bc-path) seemed to work. I'll leave the issue open, as I assume it should still be fixed.

@ProExpertProg
Copy link
Author

Still an issue with 2.1. The beta workaround does not work there, as the compiler crashes (#291)

@neboat
Copy link
Collaborator

neboat commented Dec 2, 2024

Closing this issue, which should be fixed by PR OpenCilk/productivity-tools#49.

@neboat neboat closed this as completed Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants