Comments (13)
(hi from from the embedded side. i'm mostly familiar with the thumb*eabi(hf)?
targets, i'm not sure about others)
One use of the flag is to allow using the FPU while still using the soft-float ABI for compatibility with other code. However, this can already be done by using the -eabi
targets and then telling the compiler to use the FPU anyway with some -Ctarget-feature
, which seems a much less dangerous way of doing it.
I can't think of any other uses, so I wouldn't oppose deprecating/removing it.
from rust.
Hey ARM Group! This bug has been identified as a good "ARM candidate".
In case it's useful, here are some instructions for tackling these sorts of
bugs. Maybe take a look?
Thanks! <3
cc @adamgemmell @hug-dev @jacobbramley @JamieCunliffe @joaopaulocarreiro @raw-bin @Stammark
from rust.
Rustc just always forwards this flag to LLVM, so it seems possible that the *eabihf targets only
part of the docs is not correct. We're certainly seeing a bunch of people out there setting this on non-ARM targets (e.g. here are some uses on x86 and riscv).
Cc @parched who added this part to the docs in #36261. Does LLVM document anywhere what this flag does, and which targets it affects?
from rust.
Seems like this flag is called -mfloat-abi
in GCC/clang and indeed only exists for ARM. So most uses out there are bogus. A first step might be for us to show a warning when the flag is used on a target where it has no effect.
One use of the flag is to allow using the FPU while still using the soft-float ABI for compatibility with other code. However, this can already be done by using the -eabi targets and then telling the compiler to use the FPU anyway with some -Ctarget-feature, which seems a much less dangerous way of doing it.
Yes indeed, if there's a way to tell LLVM "use soft-float ABI but also use FPU", in a way that doesn't affect the ABI at all as is entirely link-compatible with fully soft-float code, then that's what should be done.
from rust.
Hm, either I am misunderstanding the assembly or this feature does not work as advertised? https://godbolt.org/z/53W75s3fc seems to show that -Csoft-float
does not actually change the ABI?
EDIT: Ah no I just can't read assembly. This still uses hard-float operations but first moves the data from rN
to sN
, i.e. it expects a soft-float ABI. Never mind.
from rust.
Here are the eabihf
targets that do not have a corresponding eabi
target, and thus might rely on -Csoft-float
to get a soft-float ABI:
- thumbv7neon-unknown-linux-gnueabihf (tier 2)
- armv6-unknown-netbsd-eabihf (tier 3)
- armv7-sony-vita-newlibeabihf (tier 3)
- armv7-unknown-netbsd-eabihf (tier 3)
- armv7-wrs-vxworks-eabihf (tier 3)
- armv8r-none-eabihf (tier 3)
- thumbv7neon-unknown-linux-musleabihf (tier 3)
So, only one tier 2 target is affected. And it's a tier 2 target without listed maintainers.
from rust.
armv7-sony-vita-newlibeabihf is meant to be used with a single cpu only which supports floats, so there is probably no need for soft-float support for that target.
from rust.
Turning off the hard float ABI on a hard float target sounds like a "why do we even have that lever" kind of deal. I can't imagine why anyone would want to and I expect it would end badly if they tried.
As others have said, adding FPU instructions into a soft-float build is a entirely different matter, as is enabling Helium (MVE) or anything else that affects the juicy centre of a function but not its hard outer shell.
from rust.
On the Cortex-R52, the FPU is mandatory and if anyone wants compatibility with older soft-float code they can either use armv7r-none-eabi, or they can come and make a compelling case for the v8-R version (kernel developers? idk). I'm not minded to add it on a whim because it seems pretty niche.
from rust.
This flag has a very "from the days when there was an OABI" vibe to it.
from rust.
I think we should start by warning when this flag is used, maybe that will get someone to explain their hypothetical use-case that cannot possibly be replaced by the -Ctarget-feature
route.
from rust.
I think we should start by warning when this flag is used, maybe that will get someone to explain their hypothetical use-case that cannot possibly be replaced by the
-Ctarget-feature
route.
All right, I made #129897 do exactly that now.
from rust.
WG-prioritization assigning priority on Zulip.
Also, (related discussion).
@rustbot label -I-prioritize +P-medium
from rust.
Related Issues (20)
- Build failure when using LTO with static linking on MacOS
- Confusing suggestion to use `cargo:rustc-link-lib` in a cargo project with a lib and bins HOT 4
- [QNX7.1] `std::fs::tests::symlink_hard_link` broken on main HOT 3
- `TcpStream::set_nonblocking` docs mention non-existent methods HOT 3
- add unstable --no-minify flag to rustdoc HOT 5
- [rustdoc search] kind filters should not be allowed in type-based search
- driftsort implementation uses an out-of-range literal on 16-bit targets HOT 7
- ICE: `deadlock detected as we're unable to find a query cycle to break` HOT 2
- deadlock detected as we're unable to find a query cycle to break HOT 1
- Cargo fix error HOT 1
- s390x-unknown-linux-gnu: cfg!(target_feature = "backchain") is always true HOT 10
- ICE HOT 1
- c_char signedness doesn't match with Clang's default on various no-std and tier 3 targets HOT 1
- Trait bound requiring the same trait with different lifetimes results in a compile error
- rustc panicked when reference a moved variable in a closure
- taint on type error in `UniversalRegionsBuilder::compute_inputs_and_output`
- SIMD intrinsics are never inlined in debug
- generic type bound is somehow not effective when using type_alias_impl_trait
- lint-docs fails its tests in a cross-compiling environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.