From 1579eba11dbb8ad7a5a924862cdb20402e3a401f Mon Sep 17 00:00:00 2001 From: Theia Innovation Date: Tue, 26 Nov 2024 21:49:56 +0100 Subject: [PATCH] added configuration to compile the agent for openwrt armv7 (like Teltonika rutx11) (#249) --- makefile | 17 +++++++++++++++++ openssl/libstatic/linux/openssl-armvirt32 | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100755 openssl/libstatic/linux/openssl-armvirt32 diff --git a/makefile b/makefile index 446ac5ac..70430426 100644 --- a/makefile +++ b/makefile @@ -182,6 +182,7 @@ EXENAME = meshagent # Cross-compiler paths PATH_MIPS = ../ToolChains/ddwrt/3.4.6-uclibc-0.9.28/bin/ PATH_MIPS24KC = ../ToolChains/toolchain-mips_24kc_gcc-7.3.0_musl/ +PATH_OPENWRT_ARMVIRT32 = ../ToolChains/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/ PATH_MIPSEL24KC = ../ToolChains/toolchain-mipsel_24kc_gcc-7.3.0_musl/ PATH_ARM5 = ../ToolChains/LinuxArm/bin/ PATH_POGO = ../ToolChains/pogoplug-gcc/bin/ @@ -371,6 +372,20 @@ KVM = 0 LMS = 0 endif +# Official Linux ARMVIRT32 (OpenWRT) +ifeq ($(ARCHID),42) +ARCHNAME = armvirt32 +export PATH := $(PATH_OPENWRT_ARMVIRT32)bin:$(PATH_OPENWRT_ARMVIRT32)libexec/gcc/arm-openwrt-linux-muslgnueabi/8.4.0:$(PATH_OPENWRT_ARMVIRT32)arm-openwrt-linux-muslgnueabi/bin:$(PATH) +export STAGING_DIR := $(PATH_OPENWRT_ARMVIRT32) +CC = $(PATH_OPENWRT_ARMVIRT32)bin/arm-openwrt-linux-gcc --sysroot=$(PATH_OPENWRT_ARMVIRT32) +STRIP = $(PATH_OPENWRT_ARMVIRT32)bin/arm-openwrt-linux-muslgnueabi-strip +CEXTRA = -D_FORTIFY_SOURCE=2 -D_NOILIBSTACKDEBUG -D_NOFSWATCHER -Wformat -Wformat-security -fno-strict-aliasing +CFLAGS += -DBADMATH +INCDIRS += -I$(PATH_OPENWRT_ARMVIRT32)include + +KVM = 0 +LMS = 0 +endif # Official Linux ARM ifeq ($(ARCHID),9) @@ -680,6 +695,7 @@ cleanbin: rm -f $(EXENAME)_mips rm -f $(EXENAME)_mips24kc rm -f $(EXENAME)_mipsel24kc + rm -f $(EXENAME)_armvirt32 rm -f $(EXENAME)_osx-arm-64 rm -f $(EXENAME)_osx-x86-64 rm -f $(EXENAME)_osx-universal-64 @@ -705,6 +721,7 @@ cleanbin: rm -f DEBUG_$(EXENAME)_mips rm -f DEBUG_$(EXENAME)_mips24kc rm -f DEBUG_$(EXENAME)_mipsel24kc + rm -f DEBUG_$(EXENAME)_armvirt32 rm -f DEBUG_$(EXENAME)_osx-arm-64 rm -f DEBUG_$(EXENAME)_osx-x86-64 rm -f DEBUG_$(EXENAME)_osx-universal-64 diff --git a/openssl/libstatic/linux/openssl-armvirt32 b/openssl/libstatic/linux/openssl-armvirt32 new file mode 100755 index 00000000..a4dba7f1 --- /dev/null +++ b/openssl/libstatic/linux/openssl-armvirt32 @@ -0,0 +1,16 @@ +# +# Copy and run this in the OpenSSL directory for ARM compatible OpenSSL stack +# +export PATH=/tmp/ToolChains/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/bin/:$PATH +export CC=/tmp/ToolChains/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc + +cd ../openssl +make clean +./Configure linux-generic32 no-weak-ssl-ciphers no-srp no-psk no-comp no-zlib no-zlib-dynamic no-threads no-hw no-err no-dso no-shared -no-asm no-rc5 no-idea no-md4 no-rmd160 no-ssl no-ssl3 no-seed no-camellia no-dso no-bf no-cast no-md2 no-mdc2 +make depend +sed 's/ -O3 / -Os /g' Makefile > t +rm Makefile +mv t Makefile +make -j 8 +cp *.a ../linux/armvirt32 +cd ..