Error building suricata package for OpenWRT 24.10 x86_64

Hello everyone! When trying to build the suricata package through the OpenWRT 24.10 SDK, I get the following error. What could be the problem? Where does the wrong platform come from?

touch /home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/.built
touch /home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/.built_check
make -C /home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/rust CARGO_HOME="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/.cargo" CARGO_TARGET_DIR="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/rust/target" CARGO_BUILD_TARGET="x86_64-unknown-linux-musl" RUSTC="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/bin/rustc" CARGO="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/bin/cargo" all-local
make[3]: Entering directory '/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/rust'
\
	CARGO_HOME="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/.cargo" \
	CARGO_TARGET_DIR="/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/rust/target" \
	/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/bin/cargo build --release  \
		--features "lua  ja3 ja4  " --target x86_64-openwrt-linux-gnu
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/host/bin/rustc - --crate-name ___ --print=file-names --target x86_64-openwrt-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: Error loading target specification: Could not find specification for target "x86_64-openwrt-linux-gnu". Run `rustc --print target-list` for a list of built-in targets

make[3]: *** [Makefile:551: all-local] Error 101
make[3]: Leaving directory '/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/rust'
make[2]: *** [Makefile:68: /home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/suricata-7.0.10/.built] Error 2
make[2]: Leaving directory '/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/package/suricata'
time: package/suricata/compile#10.58#6.67#15.59
    ERROR: package/suricata failed to build.
make[1]: *** [package/Makefile:179: package/suricata/compile] Error 1
make[1]: Leaving directory '/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64'
make: *** [/home/ikrell/Downloads/openwrt-sdk-24.10.0-x86-64_gcc-13.3.0_musl.Linux-x86_64/include/toplevel.mk:226: package/suricata/compile] Error 2

my Makefile:
(I'm not entirely sure that's correct)

# SPDX-License-Identifier: GPL-2.0-or-later
include $(TOPDIR)/rules.mk
 
PKG_NAME:=suricata
PKG_VERSION:=7.0.10
PKG_RELEASE:=1
 
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.openinfosecfoundation.org/download/
PKG_HASH:=197f925ea701bdcb4a15aca024b06546b002674cd958b58958f29a5bb214d759
 
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=you@example.com
 
PKG_BUILD_DEPENDS:=libpcap libpcre libpcre2 jansson libyaml libnet-1.2.x libnss libnspr4 lua libnetfilter-queue libmagic libnfnetlink zlib libiconv rust/host
 
include $(INCLUDE_DIR)/package.mk
 
define Package/suricata
  SECTION:=net
  CATEGORY:=Network
  TITLE:=Suricata IDS/IPS
  DEPENDS:=+libpcap +libpcre2 +jansson +libyaml +libnet-1.2.x +libnss +libnspr4 +lua +libnetfilter-queue +libmagic +libnfnetlink +libpthread +zlib +libiconv
  URL:=https://suricata.io/
endef
 
define Package/suricata/description
  Suricata is a high-performance IDS/IPS.
endef
 
CONFIGURE_ARGS += \
	--enable-nfqueue \
	--enable-lua \
	--with-libnspr-includes=$(STAGING_DIR)/usr/include/nspr \
	--with-libnss-includes=$(STAGING_DIR)/usr/include/nss \
	--with-rust-target=$(TARGET_CROSS) \
	--with-rust-path=$(STAGING_DIR_HOST)/bin
 
TARGET_CROSS:=x86_64-unknown-linux-musl
 
define Build/Configure
	$(call Build/Configure/Default)
endef
 
define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR)/rust \
		CARGO_HOME="$(HOME)/.cargo" \
		CARGO_TARGET_DIR="$(PKG_BUILD_DIR)/rust/target" \
		CARGO_BUILD_TARGET="$(TARGET_CROSS)" \
		RUSTC="rustc" \
		CARGO="cargo" \
		TARGET="$(TARGET_CROSS)" \
		all-local
 
	$(MAKE) -C $(PKG_BUILD_DIR) \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		CARGO_HOME="$(HOME)/.cargo" \
		CARGO_BUILD_TARGET="$(TARGET_CROSS)" \
		RUSTC="rustc" \
		CARGO="cargo" \
		TARGET="$(TARGET_CROSS)" \
		all install
endef
 
define Package/suricata/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/suricata $(1)/usr/bin/
 
	$(INSTALL_DIR) $(1)/etc/suricata
	$(CP) $(PKG_BUILD_DIR)/suricata.yaml $(1)/etc/suricata/
endef
 
$(eval $(call BuildPackage,suricata))

How can I fix this? And is it even possible to fix it?
Thank you all in advance for the help :smiley:

would seem the issue's elsewhere ?

The problem is that this architecture simply doesn't exist:

╰─ rustc --print target-list | grep x86                                       ─╯
x86_64-apple-darwin
x86_64-apple-ios
x86_64-apple-ios-macabi
x86_64-apple-tvos
x86_64-apple-watchos-sim
x86_64-fortanix-unknown-sgx
x86_64-linux-android
x86_64-pc-cygwin
x86_64-pc-nto-qnx710
x86_64-pc-nto-qnx710_iosock
x86_64-pc-nto-qnx800
x86_64-pc-solaris
x86_64-pc-windows-gnu
x86_64-pc-windows-gnullvm
x86_64-pc-windows-msvc
x86_64-unikraft-linux-musl
x86_64-unknown-dragonfly
x86_64-unknown-freebsd
x86_64-unknown-fuchsia
x86_64-unknown-haiku
x86_64-unknown-hermit
x86_64-unknown-hurd-gnu
x86_64-unknown-illumos
x86_64-unknown-l4re-uclibc
x86_64-unknown-linux-gnu
x86_64-unknown-linux-gnux32
x86_64-unknown-linux-musl
x86_64-unknown-linux-none
x86_64-unknown-linux-ohos
x86_64-unknown-netbsd
x86_64-unknown-none
x86_64-unknown-openbsd
x86_64-unknown-redox
x86_64-unknown-trusty
x86_64-unknown-uefi
x86_64-uwp-windows-gnu
x86_64-uwp-windows-msvc
x86_64-win7-windows-gnu
x86_64-win7-windows-msvc
x86_64-wrs-vxworks
x86_64h-apple-darwin

It should be x86_64-unknown-linux-musl. But I'm not sure about that