Troubleshooting
This topic provides guidance on resolving common troubleshooting issues for Rust.
Out of memory error
LLVM ERROR: out of memoryIn the event of this error, configure the following limit settings.
ulimit -d unlimited
ulimit -m unlimited
ulimit -s unlimitedTOC overflow
By default, the Rust compiler generates code using the large code model. To avoid TOC overflow, C/C++ code linked into the Rust application must be compiled with -mcmodel=large so that it also uses the large code model.
Failed to build openssl-sys
Ensure /usr/lib/libssl.a and /usr/lib/libcrypto.a are
installed and set.
export OPENSSL_DIR=/usT
export OPENSSL_STATIC=0
export OPENSSL_NO_VENDOR=1Missing CC and CXX
Error {kind: ToolNotFound, message "Failed to find tool. Is 'co' installed?"}Ensure Open XL C/C++ for AIX is installed and CC and CXX are exported.
export CC=/path/to/ibm-clang
export CXX=/path/to/ibm-clang++_rbyteorder fails to compile on AIX due to alignment assertion
A known assertion in byteorder can fail on AIX when using newer versions of
rustc. As a temporary workaround, add the following patch to
Cargo.toml to use the fork shown below.
$ printf '\n[patch.crates-io]\nbyteorder = { git = "https://github.com/amy-kwan/byteorder", branch = "amyk/update-byteorder-aix" }\n' >> /path/to/Cargo.toml
$ cargo update -p byteorder --manifest-path /path/to/Cargo.toml
# Build as normal afterwards.
$ cargo build
This provides a temporary solution for building byteorder and any crates that
still depend on it.