This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-J784S4: How to do a RUST code build ( cargo build ) using the TI LINUX Toolchain

Part Number: PROCESSOR-SDK-J784S4
Other Parts Discussed in Thread: TDA4VH-Q1

Hello,

For our project needs we are trying to generate a C shared library ( *.so ) by compiling the rust code.
This rust implementation shall be cross compiled using the TI LINUX SDK Toolchain and used in the TDA4VH-Q1 board.

We are setting the toolchain by sourcing the toolchain file : source <your-path-to-the-ti-linux-sdk>/linux-devkit/environment-setup-aarch64-oe-linux

However, when we execute the cargo build, we are facing below error:

My Questions:
1. Does a RUST compilation supported by TI LINUX Toolchain?

2. We see that the compiler doesn't support option '-m64', How can we fix this issue?

3. Is there a documentation that we can follow to setup a RUST code compilation using the SDK compiler?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The following warnings were emitted during compilation:

warning: aarch64-oe-linux-g++: error: unrecognized command-line option '-m64'

error: failed to run custom build command for `e2e v0.14.17 (/home/arjun/work/tasks/ml_airt_repo/rust-to-cpp-lib/e2e-rs)`

Caused by:
process didn't exit successfully: `/home/arjun/work/tasks/ml_airt_repo/rust-to-cpp-lib/e2e-rs/e2e-cpp/target/debug/build/e2e-fac2887a57782927/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
cargo:rerun-if-env-changed=CXX_x86_64-unknown-linux-gnu
CXX_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CXX_x86_64_unknown_linux_gnu
CXX_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CXX
HOST_CXX = None
cargo:rerun-if-env-changed=CXX
CXX = Some("aarch64-oe-linux-g++ --sysroot=/home/arjun/TiLinux_ToolChain/linux-devkit/sysroots/aarch64-oe-linux")
cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
cargo:rerun-if-env-changed=CXXFLAGS_x86_64-unknown-linux-gnu
CXXFLAGS_x86_64-unknown-linux-gnu = None
cargo:rerun-if-env-changed=CXXFLAGS_x86_64_unknown_linux_gnu
CXXFLAGS_x86_64_unknown_linux_gnu = None
cargo:rerun-if-env-changed=HOST_CXXFLAGS
HOST_CXXFLAGS = None
cargo:rerun-if-env-changed=CXXFLAGS
CXXFLAGS = Some(" -O2 -pipe -g -feliminate-unused-debug-types ")
running: "aarch64-oe-linux-g++" "--sysroot=/home/arjun/TiLinux_ToolChain/linux-devkit/sysroots/aarch64-oe-linux" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "src/utils/cdc/include" "-o" "/home/arjun/work/tasks/ml_airt_repo/rust-to-cpp-lib/e2e-rs/e2e-cpp/target/debug/build/e2e-40435ff68083e1c0/out/src/utils/cdc/src/srr4_linear_interpolation.o" "-c" "src/utils/cdc/src/srr4_linear_interpolation.cpp"
cargo:warning=aarch64-oe-linux-g++: error: unrecognized command-line option '-m64'

exit status: 1

--- stderr


error occurred: Command "aarch64-oe-linux-g++" "--sysroot=/home/arjun/TiLinux_ToolChain/linux-devkit/sysroots/aarch64-oe-linux" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-O2" "-pipe" "-g" "-feliminate-unused-debug-types" "-I" "src/utils/cdc/include" "-o" "/home/arjun/work/tasks/ml_airt_repo/rust-to-cpp-lib/e2e-rs/e2e-cpp/target/debug/build/e2e-40435ff68083e1c0/out/src/utils/cdc/src/srr4_linear_interpolation.o" "-c" "src/utils/cdc/src/srr4_linear_interpolation.cpp" with args "aarch64-oe-linux-g++" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------