Open tiziano88 opened 4 years ago
cc @daviddrysdale @anghelcovici @michael-kernel-sanders
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 .
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. https://github.com/deeglaze/repro/raw/master/newlib_musl.tgz
This problem also appears when trying to build a driver for Linux Kernel -- 2021. 😢 Is there any fix for it?
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.