kamailio-5.x: fix build for new MIPS 4kec target 592/head
authorSebastian Kemper <sebastian_ml@gmx.net>
Sat, 5 Dec 2020 11:42:20 +0000 (12:42 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Sat, 5 Dec 2020 11:50:24 +0000 (12:50 +0100)
commit060e779993b853a584d91af26c3ce24c7ef84854
tree97a169617e7a6a52652e98b3ee3e36246ba6a8fa
parenteea98c65338d8ebe8c3f50556aa437c07134673b
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 <sebastian_ml@gmx.net>
net/kamailio-5.x/Makefile