Project

General

Profile

Actions

Bug #3362

closed

cross compiling not affecting rust component of surrcata

Added by Ciprian Popa almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

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


Files

suricata-x-compile.patch (3.3 KB) suricata-x-compile.patch Ciprian Popa, 11/25/2019 02:47 PM
Actions

Also available in: Atom PDF