-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Create mips64 soft float target #50902
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Just like I said on the issue, the |
I agree conceptually, for maximum consistency you would want to get rid of armv7-unknown-linux-gnueabihf and replace them with armv7-unknown-linux-gnueabi-sf That way the rule is 'all targets without -sf have hard float' instead of 'all targets, except some mips and arm ones expect hard float, but some arm ones also have a explicit hf version'. Less confusing for sure. |
so how should I progress on this pull request? |
IMO you should just add a new target with whatever new name. It doesn’t need to be very consistent with the ARM naming scheme, only something that could be used for all other mips targets. If there’s no prior art in other compilers, something like Ideally we’d just use something like |
cc @japaric, do you or others in the embedded working group have thoughts on this? |
resolves rust-lang#50890 This commit also introduces a naming scheme for soft float targets where 'sf' is appended to the end of the target to indicate a soft float target. Leaving the default target as hard float.
b99f56c
to
7ef6b7c
Compare
There we go, the musl target patch may belong in a different pull request though. |
how do I actually build these targets to test them out? I'm not seeing a function in x.py for it. |
If I'm not wrong |
@paoloteti if that's the case for mips32 as well as mips64 then I don't see any options for that in these files. Is there somewhere else I should be looking? |
@jkilpatr Yes look at: https://github.com/rust-lang-nursery/compiler-builtins/blob/master/build.rs |
@paoloteti so that would be a separate pull request on that repo? There is no reference to soft float in that file, so if setting the flag manually was required targets such as mips-unknown-linux-musl wouldn't work on devices without HF and I have half a dozen devices showing they do on hand. Do you mean specifically mips64? Where would I find the spec outlining which targets have which defaults? somewhere in LLVM I assume. |
@jkilpatr do you know if there are preexisting conventions for mips targets? In general we try to follow Debian's guidelines and naming schemes, and do you know if they specify whether soft-float or hard-float is enabled? |
Thanks, just needed to understand where the information was coming from. The answer is that mips64el-linux-gnuabi64 on Debian sid defaults to hard float. As do other mips targets.
What's confusing me is that if we need a soft float flag in compiler builtins for mips64 to work with soft floats how in the world do the existing mips soft float targets work? They don't have anything like that in that file. |
@jkilpatr The key point is that
For mips-musl ( |
@paoloteti in that case is it possible to make a -musl target rather than a gnuabi64 one? I don't see musl specific targets in the Debian package list so I assume they either A) come from somewhere else or B) are built using the -gnu cross compilers. Also what does gnuabi64 mean anyways? Is it just to indicate a 64 bit version of gnu libc? |
@jkilpatr you are targeting a Cavium Octeon, so may be you can use the vendor toolchain ( The root cause of your issue probably is that you have FPU emulation turned off. OpenWrt userland is soft-float and Debian binaries are hard-float, but due to the fact that OpenWrt use soft-float the FPU emulation is turned off inside the kernel, so if you rebuild the kernel with the FPU emulation enabled, may be the issue will disappear. |
I was successful using the mips FPU emulation option in the OpenWrt kernel config and building against glibc (musl tried to pass the soft float flag to the compiler with predictable results). I'll close this pull, but leave the issue open. At least until how to handle FP in cross targets becomes more standard. |
an enormous thanks for your help @paoloteti |
resolves #50890
probably missing some intermediate step here, I'm basing this off of #34922 but the first step seems deprecated?