I just tried to compile Samba 4.8.x for my TP-Link Archer C7 v2 (mips, ath79), and I got the following:
Checking for program gcc or cc : mips-openwrt-linux-musl-gcc
Checking for program ar : mips-openwrt-linux-musl-gcc-ar
Checking for program ranlib : mips-openwrt-linux-musl-gcc-ranlib
Checking for gcc : ok
Checking for program git : /home/anton/openwrt/archerc7/source/staging_dir/host/bin/git
Check for -MD : yes
Checking for program gdb : /usr/bin/gdb
Checking for header sys/utsname.h : yes
Checking uname sysname type : not found
Checking uname machine type : not found
Checking uname release type : not found
Checking uname version type : not found
Checking for header stdio.h : yes
Checking simple C program : /home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/lib/replace/../../buildtools/wafsamba/wscript:324: error: the configuration failed (see '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/config.log')
Makefile:385: recipe for target '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/.configured_45ef96603b894f8dac7c7c73ed2652b0' failed
make[3]: *** [/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/.configured_45ef96603b894f8dac7c7c73ed2652b0] Error 1
make[3]: Leaving directory '/home/anton/openwrt/archerc7/source/feeds/extra/samba4'
Command exited with non-zero status 2
time: package/feeds/extra/samba4/compile#1.12#0.29#2.32
package/Makefile:107: recipe for target 'package/feeds/extra/samba4/compile' failed
make[2]: *** [package/feeds/extra/samba4/compile] Error 2
When checking "source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/config.log" I found this:
Checking simple C program
==>
#define CONFIG_H_IS_FROM_SAMBA 1
#define _SAMBA_BUILD_ 4
#define HAVE_CONFIG_H 1
#define SRCDIR "/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3"
#define HAVE_SYS_UTSNAME_H 1
/* #undef SYSTEM_UNAME_SYSNAME */
/* #undef SYSTEM_UNAME_MACHINE */
/* #undef SYSTEM_UNAME_RELEASE */
/* #undef SYSTEM_UNAME_VERSION */
#define HAVE_STDIO_H 1
#include <stdio.h>
int main(void) { printf("hello world"); return 0; }
<==
[1/2] Compiling test.c
['mips-openwrt-linux-musl-gcc', '-Os', '-pipe', '-mno-branch-likely', '-march=74kc', '-mtune=74kc', '-fno-caller-saves', '-fno-plt', '-fhonour-copts', '-Wno-error=unused-but-set-variable', '-Wno-error=unused-result', '-msoft-float', '-mips16', '-minterlink-mips16', '-iremap/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3:samba-4.8.3', '-Wformat', '-Werror=format-security', '-fstack-protector', '-D_FORTIFY_SOURCE=1', '-Wl,-z,now', '-Wl,-z,relro', '-ffunction-sections', '-fdata-sections', '-I/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/lib/replace/../../buildtools/wafsamba', '-MD', '-I/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/usr/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/include', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include/fortify', '-I/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/include', '-Idefault', '-I..', '-Idefault', '-I..', '-D_SAMBA_BUILD_=4', '-DHAVE_CONFIG_H=1', '../test.c', '-c', '-o', 'default/test_1.o']
[2/2] Linking default/testprog
['mips-openwrt-linux-musl-gcc', 'default/test_1.o', '-o', '/home/anton/openwrt/archerc7/source/build_dir/target-mips_24kc_musl/samba-4.8.3/bin/.conf_check_0/testbuild/default/testprog', '-L/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/usr/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/target-mips_24kc_musl/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/lib', '-L/home/anton/openwrt/archerc7/source/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib', '-znow', '-zrelro', '-Wl,--gc-sections']
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
returncode -4
My build system is a 32-bit Ubuntu 18.04 (running as a Virtualbox VM under Windows 10) and I compile OpenWRT using gcc 7.3. And yes, this was a clean build (make dirclean) Any suggestions?