# Suricata 6.0.4: /usr/bin/ld: error adding symbols: file in wrong format

**URL:** <https://forum.suricata.io/t/suricata-6-0-4-usr-bin-ld-error-adding-symbols-file-in-wrong-format/2179>\
**Category:** Developers\
**Created:** [February 3, 2022, 7:10am UTC](https://forum.suricata.io/t/suricata-6-0-4-usr-bin-ld-error-adding-symbols-file-in-wrong-format/2179 "2022-02-03T07:10:25Z")\
**Posts on this page:** 3\
**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:** [February 3, 2022, 7:10am UTC](https://forum.suricata.io/t/suricata-6-0-4-usr-bin-ld-error-adding-symbols-file-in-wrong-format/2179/1 "2022-02-03T07:10:25Z")

</div>

I am building `suricata` to be included as a package in `OpenWrt`. Currently, I have incorporated `rust-lang` into the `OpenWrt` build system. When building `suricata 6.0.4` in a cross-compile (`x86_64-unknown-linux-gnu` to `mips64-openwrt-linux-musl` with the appropriate `rust-lang` tuple toolchain)

```auto
***snip***
          /usr/bin/ld: /home/grommish/openwrt/build_dir/target-mips64_octeonplus_64_musl/suricata-6.0.4/rust/target/mips64-openwrt-linux-musl/release/deps/suricata.suricata.a4d2e0c5-cgu.0.rcgu.o: error adding symbols: file in wrong format
          collect2: error: ld returned 1 exit status

```

Full Log:

> <https://gist.github.com/Grommish/24367dba9ac13b94a195552267e0d519>

Short description:  
When running `./autogen.sh` and `./configure`, the scripts correctly identify the linker as

```auto
checking for ld used by mips64-openwrt-linux-musl-gcc... mips64-openwrt-linux-musl-ld.gold
checking if the linker (mips64-openwrt-linux-musl-ld.gold) is GNU ld... yes

```

but when actually linking, it attempts to use `/usr/bin/ld`.

I’m passing `--with-sysroot` on the `configure`, and it’s correctly being ID’d. Am I missing a `configure` flag, or is this an unintentional error?

---

<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:** [February 4, 2022, 5:33am UTC](https://forum.suricata.io/t/suricata-6-0-4-usr-bin-ld-error-adding-symbols-file-in-wrong-format/2179/2 "2022-02-04T05:33:26Z")

</div>

Added Issue as [Bug #5039: suricata 6.0.4: hard-coded linker results in errors - Suricata - Open Information Security Foundation](https://redmine.openinfosecfoundation.org/issues/5039)

---

<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:** [February 6, 2022, 9:37am UTC](https://forum.suricata.io/t/suricata-6-0-4-usr-bin-ld-error-adding-symbols-file-in-wrong-format/2179/3 "2022-02-06T09:37:35Z")

</div>

bump for visibility.

I’m even grateful for a suggestion where to start looking. 😃

Thanks!
