cross compiling not affecting rust component of surrcata
When configuring suricata v5.0.0 for cross compilation, the --target flag for the cargo command in omitted, thus the rust component of suricata (which builds libsuricata.a) is compiled for the build machine and not for the host
repro steps assuming suricata's compile tools and dependencies are met and a cross compiler is installed with $CC = arm-unknown-linux-gnueabihf-gcc:
# cd suricata-suricata-5.0.0 # ~/autogen.sh # ~/configure --host=arm-unknown-linux-gnueabihf # make ... notice the build command for libsuricata.a is missing the --target arm-unknown-linux-gnueabihf argumnent cd ../rust && RUSTUP_HOME=~/.rustup \ CARGO_HOME="~/.cargo" \ CARGO_TARGET_DIR="~/suricata-suricata-5.0.0/rust/target" \ ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin//cargo build --release \ --features " "
proposed fix inside attachment: suricata-x-compile.patch
NOTE: changes in configure.ac, lines 2437-2448 are taken from another BUG: https://redmine.openinfosecfoundation.org/issues/3073