From 060e779993b853a584d91af26c3ce24c7ef84854 Mon Sep 17 00:00:00 2001 From: Sebastian Kemper Date: Sat, 5 Dec 2020 12:42:20 +0100 Subject: [PATCH] kamailio-5.x: fix build for new MIPS 4kec target Recently support for target rtl838x was added to OpenWrt. It uses 4kec, which is MIPS32. The Kamailio build system doesn't detect this and treats it as MIPS I, adding -march=r3000 to the flags, which clashes with -mips32r2. mips-openwrt-linux-musl-gcc -mfp32 -march=r3000 -ftree-vectorize -fno-strict-overflow -pthread -DKSR_PTHREAD_MUTEX_SHARED -Wall -Os -pipe -mno-branch-likely -mips32r2 -mtune=4kec -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -I/builder/shared-workdir/build/sdk/staging_dir/target-mips_4kec_musl/usr/lib/libiconv-stub/include -I/builder/shared-workdir/build/sdk/staging_dir/target-mips_4kec_musl/usr/lib/libintl-stub/include -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-mips_4kec_musl/kamailio5-5.4.0=kamailio5-5.4.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DVERSION_NODATE=1 -I/builder/shared-workdir/build/sdk/staging_dir/target-mips_4kec_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_4kec_gcc-8.4.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_4kec_gcc-8.4.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-mips_4kec_gcc-8.4.0_musl/include -I/builder/shared-workdir/build/sdk/staging_dir/target-mips_4kec_musl/usr/lib/libiconv-stub/include -I/builder/shared-workdir/build/sdk/staging_dir/target-mips_4kec_musl/usr/lib/libintl-stub/include -DNAME='"kamailio"' -DVERSION='"5.4.0"' -DARCH='"mips"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"mips-openwrt-linux-musl-gcc 8.4.0"' -D__CPU_mips -D__OS_linux -DVERSIONVAL=5004000 -DCFG_DIR='"/etc/kamailio"' -DSHARE_DIR='"/usr/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DUSE_SCTP -DMIPS_HAS_LLSC -DNOSMP -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DUSE_PTHREAD_MUTEX -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -DMODS_DIR='"/usr/lib/kamailio/modules"' -c main.c -o main.o -MMD -MP cc1: error: '-mips32r2' conflicts with the other architecture options, which specify a mips1 processor Assembler messages: Error: -mips32r2 conflicts with the other architecture options, which imply -mips1 Makefile.rules:100: recipe for target 'main.o' failed make[5]: *** [main.o] Error 1 This commit fixes this by forcing ARCH to mips2 for 4kec CPUs as well (Kamailio only differentiates between mips, mips2 and mips64). Signed-off-by: Sebastian Kemper --- net/kamailio-5.x/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/kamailio-5.x/Makefile b/net/kamailio-5.x/Makefile index 90b0c92..fbc16c2 100644 --- a/net/kamailio-5.x/Makefile +++ b/net/kamailio-5.x/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kamailio5 PKG_VERSION:=5.4.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz @@ -407,7 +407,7 @@ EXTRA_MODULES:= \ # When CONFIG_CPU_TYPE matches one of the identifiers in the list below, set # ARCH to "mips2" to get FAST_LOCK support. ifeq ($(call qstrip,$(CONFIG_ARCH)),mips) -CPU_MIPS2:=mips32 24kc 34kc 74kc +CPU_MIPS2:=mips32 24kc 34kc 4kec 74kc endif MAKE_FLAGS += \ -- 2.30.2