-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Cross-compiling libomp fails with missing symbol "___divdc3" #54596
Comments
@llvm/issue-subscribers-openmp |
No idea what the problem might be. Googling shows people had similar problem about a year ago (tpoechtrager/osxcross#267), and the suggestion was: either build natively or use pre-built binaries. For native builds people have same linking problem when outdated xcode used, but I am not sure if it is related to cross build somehow. |
I'm seeing the same issue natively, though: trying to build LLVM 16.0.0 rc1/rc2 on
I've not yet investigated more closely, though. |
What I've now found is that those missing symbols live in I tried with a
|
I've encountered this with 18.1.0-rc1 in conda-forge, with a build recipe that has successfully cross-compiled previous versions (17, 16, 15, ...) for |
We generally don't need any other project to build OpenMP but Apple Silicon platform is an exception because certain functions are not provided by the system. Compiler-rt happens to have them. I think we need to "copy" the implementation of those functions to OpenMP. |
this happens when not linking libclang_rt, a manual way to solve this is add target clang_rt library to linker flags to where having this problem |
Any plans to resolve this in the upcoming 18.1 release? |
It's not in the plan yet but I'll at least fix it in trunk soon. If that is merged before 18.1 release, we can cherry pick it. |
#83767 can fix the issue. I think we can make it into 18.1 release. |
Apple Silicon macOS doesn't have the two functions coming with their `libgcc`. This causes a link error when compiling OpenMP. `compiler-rt` has the implementation of the two functions but users may not always have that enabled, either when using the system compiler or building LLVM manually. This patch simply adds the imlementation of the two functions and only includes them on Apple Silicon macOS. Fix llvm#54596.
I did a detailed check. Now I think |
it is possible when self bootstrapping scene, at least I met this problem when bootstrapping on iOS, where host compiler have clang_rt but stage1 clang may not automatically passing it to linker, even there is a stage1 compiler-rt. But I only triggers this error when linking flang |
Does putting Update: probably not since compiler-rt might not be installed into clang's directory. |
Haven't tried that yet, but libunwind configure failed due to no target clang_rt path passed to its CMake args, while this sub project flags was not handled by user but the top Makefile/build.ninja |
You don't have to explicitly pass argument to use compiler-rt IIUC. As long as it is installed properly into |
Then this might be the problem that clang_rt not installed to stage1 clang search path after build, thus affecting all stage2 subprojects that using it |
It will have the same issue as building libomptarget (with c++ default rtl set to libc++) on a system where you don't have libc++ installed yet. compiler-rt and libc++ are also built as LLVM_ENABLE_RUNTIMES and not available at the time you build libomptarget. |
Yeah, the installation will only happen after the runtime build. |
I filed a new issue for this since it is still a problem #105997 |
Cross-compiling libomp for MacOSX on a Linux machine gives the following error. Any ideas?
Source code was downloaded from here: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/openmp-14.0.0.src.tar.xz
The text was updated successfully, but these errors were encountered: