Project

General

Profile

Actions

Bug #3362

closed

cross compiling not affecting rust component of surrcata

Added by Ciprian Popa almost 2 years ago. Updated almost 2 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 #1

Updated by Andreas Herz almost 2 years ago

Could you commit the patch via a PR on our github? see https://redmine.openinfosecfoundation.org/projects/suricata/wiki/Contributing

Actions #2

Updated by Ciprian Popa almost 2 years ago

Sure. Created pull request with id 4411: https://github.com/OISF/suricata/pull/4411

Actions #3

Updated by Andreas Herz almost 2 years ago

  • Assignee set to Ciprian Popa
  • Target version set to TBD
Actions #4

Updated by Jason Ish almost 2 years ago

  • Status changed from New to Closed
  • Target version changed from TBD to 5.0.1

Merged into master with https://github.com/OISF/suricata/pull/4431.
Commit c9cd7559fd5d7cf4f2d501b70839321c7c4a5eb9.

Actions

Also available in: Atom PDF