lib.rs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #![cfg_attr(not(stage0), deny(warnings))]
  2. #![cfg_attr(not(test), no_std)]
  3. #![cfg_attr(feature = "compiler-builtins", compiler_builtins)]
  4. #![crate_name = "compiler_builtins"]
  5. #![crate_type = "rlib"]
  6. #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
  7. html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
  8. html_root_url = "https://doc.rust-lang.org/nightly/",
  9. html_playground_url = "https://play.rust-lang.org/",
  10. test(attr(deny(warnings))))]
  11. #![feature(asm)]
  12. #![feature(compiler_builtins)]
  13. #![feature(core_intrinsics)]
  14. #![feature(naked_functions)]
  15. #![feature(i128_type)]
  16. #![feature(repr_simd)]
  17. #![feature(abi_unadjusted)]
  18. #![feature(linkage)]
  19. #![feature(lang_items)]
  20. #![allow(unused_features)]
  21. #![no_builtins]
  22. #![cfg_attr(feature = "compiler-builtins", feature(staged_api))]
  23. #![cfg_attr(feature = "compiler-builtins",
  24. unstable(feature = "compiler_builtins_lib",
  25. reason = "Compiler builtins. Will never become stable.",
  26. issue = "0"))]
  27. // We disable #[no_mangle] for tests so that we can verify the test results
  28. // against the native compiler-rt implementations of the builtins.
  29. // NOTE cfg(all(feature = "c", ..)) indicate that compiler-rt provides an arch optimized
  30. // implementation of that intrinsic and we'll prefer to use that
  31. // NOTE(aapcs, aeabi, arm) ARM targets use intrinsics named __aeabi_* instead of the intrinsics
  32. // that follow "x86 naming convention" (e.g. addsf3). Those aeabi intrinsics must adhere to the
  33. // AAPCS calling convention (`extern "aapcs"`) because that's how LLVM will call them.
  34. #[cfg(test)]
  35. extern crate core;
  36. fn abort() -> ! {
  37. unsafe { core::intrinsics::abort() }
  38. }
  39. #[macro_use]
  40. mod macros;
  41. pub mod int;
  42. pub mod float;
  43. pub mod mem;
  44. #[cfg(target_arch = "arm")]
  45. pub mod arm;
  46. #[cfg(all(kernel_user_helpers, target_os = "linux", target_arch = "arm"))]
  47. pub mod arm_linux;
  48. #[cfg(target_arch = "x86")]
  49. pub mod x86;
  50. #[cfg(target_arch = "x86_64")]
  51. pub mod x86_64;
  52. pub mod probestack;