# Passing CFLAGS=-fPIE to rust build system

**URL:** <https://forum.suricata.io/t/passing-cflags-fpie-to-rust-build-system/2328>\
**Category:** Developers\
**Tags:** suricata\
**Created:** [March 17, 2022, 8:48am UTC](https://forum.suricata.io/t/passing-cflags-fpie-to-rust-build-system/2328 "2022-03-17T08:48:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grommish](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.suricata.io/grommish/32/255_2.png) [@Grommish](https://forum.suricata.io/u/Grommish)\
**Post date:** [March 17, 2022, 8:48am UTC](https://forum.suricata.io/t/passing-cflags-fpie-to-rust-build-system/2328/1 "2022-03-17T08:48:22Z")

</div>

I am building `suricata6` for inclusion into OpenWrt. I am working to target arm, armv5, armv6, armv7, aarch64, mips, mipsel, mips64, mips64el, powerpc, powerpc64, and x86\_64 (there might be others, but those are the ones on the top of my head). All of the targets do/will have their own Tier 3 rust-lang tuple as `xxxx-openwrt-linux-musl`, and rust-lang in the build system itself is already embedded.

In order build suricata6, I need to pass `-fPIE` to the rustc/cargo calls used by the suricata `Makefile` when building x86\_64 targets, or it fails when I include `--enable-pie`. This, so far, has only manifested itself with the x86\_64 targets. Mips64 compiles fine (and fails for other reasons related to Suricata which are currently being explored)

OpenWrt has user-land ASLR\_PIE, but for whatever reason, this isn’t being passed to Suricata, so I’m looking to force it (or, disable --enable-pie for `x86_64` targets).

I need to be able to invoke it from the `make` command, and would like to avoid adding patches to change files locally prior to running. Any suggestions on how to do this?
