This fork of Rust contains changes that enable rustc to build BPF modules. It depends on a customized fork of Rust's LLVM fork.
Solana SDK does not depend directly on this repo. Instead platform-tools builds and releases binary packages that the Solana SDK pulls in.
BPF modules are built using target triple bpfel-unknown-unknown
which represents the little endian version of BPF. There is no
support for big endian at this time.
The source tree has two external dependencies
If any of the depencies is changed or this repository is updated to make a new release of the bpf-tools, tag the dependencies, and this repository with a new bpf-tools-v1.x tag, so that all components of the released bpf-tools have the same tag, e.g. bpf-tools-v1.6. Thus, release of every version of the bpf-tools is fully specified by the release version.
The llvm-project is a submodule of this repository, therefore its
version is explicitly committed in this repository. However,
compiler-builtins is pulled in as a cargo package. Therefore, it is
necessary to update the [patch.crates-io]
subsection of the
top-level Cargo.toml
file, and specify which tag must be used to
pull the correct version of compiler-builtins.
After this repository is tagged for a new release, update the
bpf-tools/build.sh
in [bpf-tools] repository to pull the correct
version of the rust repository and make a new release tag in
[bpf-tools] repository.
This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.
-
Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrate with other languages.
-
Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.
-
Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).
Read "Installation" from The Book.
If you really want to install from source (though this is not recommended), see INSTALL.md.
See https://www.rust-lang.org/community for a list of chat platforms and forums.
See CONTRIBUTING.md.
Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.
The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").
If you want to use these names or brands, please read the media guide.
Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.