The "xous" operating system is enturely Rust-based, meaning it has no
libc. Therefore, it relies on `compiler-builtins` for all intrinsics.
Unfortunately, there are not yet Rust equivalents for all C functions.
For example, triganometric functions are still missing. In the meantime,
enable C replacements for these functions so that Rust programs compiled
for Xous can call these functions.
Signed-off-by: Sean Cross <sean@xobs.io>
x86_64 can load unaligned words in a single cache line as fast as
aligned words. Even when crossing cache or page boundaries it is just as
fast to do an unaligned word read instead of multiple byte reads.
Also add a couple more tests & benchmarks.
According to the README this file isn't used by rust, but it's currently
included which leads to these linker warnings in some cases:
```
ld: warning: linker symbol '$ld$hide$os10.5$___udivti3' hides a non-existent symbol '___udivti3'
ld: warning: linker symbol '$ld$hide$os10.4$___umoddi3' hides a non-existent symbol '___umoddi3'
ld: warning: linker symbol '$ld$hide$os10.5$___umoddi3' hides a non-existent symbol '___umoddi3'
ld: warning: linker symbol '$ld$hide$os10.4$___umodti3' hides a non-existent symbol '___umodti3'
ld: warning: linker symbol '$ld$hide$os10.5$___umodti3' hides a non-existent symbol '___umodti3'
```
This file exclusively contains macros which hides old symbols on Apple
OS versions where they don't exist.
fc10370ef7/compiler-rt/lib/builtins/apple_versioning.c
As of https://reviews.llvm.org/D110413, these no longer use the
unadjusted ABI (and use normal C ABI instead, passing i128
indirectly and returning it as <2 x i64>).
To support both LLVM 14 and older versions, rustc will expose a
"llvm14-builtins-abi" target feature, based on which
compiler-builtins can chose the appropriate ABI.
This is needed for rust-lang/rust#93577.
This ensures that each intrinsic ends up in a separate module, which in
turn (because rustc treats compiler_builtins specially) will result in
each intrinsic ending up in its own object file. This allows the linker
to only pick up object files for intrinsics that are missing and avoids
duplicate symbol definition errors.
The change in 186517b3266a7bb2b2310927f7342ea7f41790c3 was intended to
affect only `arm-linux-androideabi` but also affected
`armv7-linux-androideabi` which is not a pre-ARMv6 architecture.
Fixes#449