-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
rustbuild: can't cross compile compiler-rt for ARM #32194
Comments
Yeah this kinda sucks :. I managed to hack around it for now, but I don't think that works for all platforms. It would be best to upstream support for this most likely.
Oh my god building compiler-rt is a nightmare
I was under the impression that the makefiles are basically dead. I know they are for the LLVM project itself, and I've heard that compiler-rt folks have been surprised in the past we're still using makefiles. Along those lines we probably want to continue using CMake where possible. I guess the best thing to do would be to figure out which patches need to make their way upstream, and try to do that. We've diverged from compiler-rt "quite a bit" I think which is pretty unfortunate, so upgrading may be hard for us. All around this isn't a great situation unfortunately :( |
FWIW, this didn't work when I tried to use mips musl-gcc wrapper to cross compile compiler-rt; it failed in these c++ tests. What did work was installing a crosstool-ng generated
The weirdest thing is that the
OK, I'll see what I can do, but I don't actually speak cmake. |
update compiler-rt submodule fixes #32194 also see rust-lang/compiler-rt#17 r? @alexcrichton
rustbuild is using cmake to build compiler-rt instead of Makefiles like the old build system does,
and there are some issues that make the build fail when the target is ARM.
Background info
For ARM, there 3 floats ABI (see
-mfloat-abi
in 1):soft
: processor has no Floating Point Unit (FPU), floating point operations are softwareroutines/library calls.
hard
: processor has FPU, floating point operations are hardware instructions.softfp
: processor has FPU, can use the hardware instructions but still usessoft
callingconvention.
As far as Rust is concerned:
arm(v7)-unknown-linux-gnueabihf
uses thehard
ABI.arm-unknown-linux-gnueabi
uses thesoft
ABI.Observations when using cmake
In general:
arm
target and anarmhf
target in its sanitychecks, but then goes off and generates the same set of symbols for both targets. Not a
problem, but why then bother making a distinction in the first place?
the builtins that form part of libcompiler-rt.a. This forces the user to install a g++ compiler
were gcc was sufficient before (in the Makefile case). This particularly annoying for
musl
targets where only a
musl-gcc
wrapper is available in the buildbots. Note: It seems the C++compiler is required to compile the sanitizers, but we don't build those right now.
using the Makefile system. Note the
*vfp
symbols which are in the cmake version but not in theMakefile version; they are relevant in the next section.
When targeting
arm-unknown-linux-gnueabi
:*vfp
symbols can't be compiled for this target; you get a compiler error: "Error:selected processor does not support ARM mode". At least that's the case with Ubuntu's
arm-linux-gnueabi-gcc
toolchain and a crosstool-ng generated toolchain.When targeting
arm(v7)-unknown-linux-gnueabihf
:soft
ABI and the
hard
ABI. The arm toolchains shipped in Ubuntu have no problems with this check(both tests pass), but when a crosstool-ng compiler is used this check fails in the
soft
case and the cmake build is aborted.
Other than that, I have had no problems (cross) compiling compiler-rt to i686, x86_64, mips or
mipsel apart from the annoying extra g++ requirement.
What to do?
The simplest way to get rid of all these issues is to build compiler-rt using Makefiles at least
when the target is ARM. The other alternative is to patch compiler-rt:
(yet).
soft float ARM. It's OK, I think, to exclude these symbols because our current releases don't include
them for any ARM target (AFAICT).
soft
float check when the target is hard float ARM.Thoughts @alexcrichton?
The text was updated successfully, but these errors were encountered: