-
Notifications
You must be signed in to change notification settings - Fork 126
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
Could not link Rust static lib to enclave code #45
Comments
Are you perhaps using libc++ instead of libstdc++? Our libc (newlib) doesn't implement long double functions for architectures where double != long double. libstdc++ seems to fill in the blanks, but libc++ doesn't. We're experimenting with splicing long double functions from musl into newlib in order to fill in the blanks for libc++, which leads to some weird header #define contortions, but that's not ready to release. |
Thanks @deeglaze for the quick and relevant reply! That may well be the case, unfortunately there is no easy way (that I know of) to force the Rust compiler to use one or the other lib. Do you have a prototype version of Asylo implementing the spliced functions you mentioned? I'd be happy to patch things locally and give it a try to see if it solves the issue. |
If it helps, the functions seem to be defined in https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/int_math.h . |
Blocks project-oak/oak#313 |
int_math.h is referencing libc there, not defining the missing symbols. I don't have anything in a shareable state, sad to say. I spent a few hours trying to make newlib + musl build in the github environment but have hit some snags. I can share that with you to figure out a bit more, but I just don't have the capacity to put more time into it right now. |
This problem also appears when trying to build a driver for Linux Kernel -- 2021. 😢 |
UPDATE: it works for Ubuntu 20+, but for Debian 10, no 😭 |
Same issue here |
I have been experimenting compiling Rust to a static library and linking it against our existing enclave code (will provide detailed steps if anyone is interested), but while I can link the resulting artifacts against standard C++ code, asylo seems picky about it, and I get the following errors in bazel:
For reference, I also came across this https://dev.to/luzero/building-crates-so-they-look-like-c-abi-libraries-1ibn#static-libraries , but it did not help.
The text was updated successfully, but these errors were encountered: