I got the same error while compiling the mac80211 package (master branch commit 1bdd3b5f). It probably occurs with an older version of make. The linux distribution I'm currently using to build is quite old, namely Kubuntu LTS 14.04
The make version is GNU Make 3.81
The proposed fix by borgchen solved the issue for me. I think it is a good idea to apply it for the developers using older tools to build the OpenWRT image.
Actually I copied mac80211 folder from master branch to openwrt-18.06 and then found this issue when I compiled openwrt-18.06.
There is no error occurred if I compile master branch directly.
qsdk 10/11 ,kernel 4.4.60 ,try usr high copyring mac80211,usr you idea to fix ,but error log:
#define INTERNODE_CACHE_SHIFT CONFIG_X86_INTERNODE_CACHE_SHIFT
^
include/linux/cache.h:57:35: note: in expansion of macro 'INTERNODE_CACHE_SHIFT'
__attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT))))
^~~~~~~~~~~~~~~~~~~~~
include/linux/mmzone.h:108:3: note: in expansion of macro '____cacheline_internodealigned_in_smp'
} ____cacheline_internodealigned_in_smp;
^
In file included from include/linux/elf.h:4:0,
from include/linux/module.h:15,
from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/backport-include/linux/module.h:3,
from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat/main.c:1:
./arch/x86/include/asm/elf.h: In function 'elf_common_init':
./arch/x86/include/asm/elf.h:179:5: error: 'struct thread_struct' has no member named 'fs'; did you mean 'es'?
t->fs = t->gs = 0;
^~
es
In file included from include/linux/module.h:24:0,
from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/backport-include/linux/module.h:3,
from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat/main.c:1:
./arch/x86/include/asm/module.h: At top level:
./arch/x86/include/asm/module.h:57:2: error: #error unknown processor family
#error unknown processor family
^~~~~
In file included from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/backport-include/linux/module.h:3:0,
from /openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat/main.c:1:
include/linux/module.h:411:27: error: field 'arch' has incomplete type
struct mod_arch_specific arch;
^~~~
make[9]: *** [/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat/main.o] Error 1
scripts/Makefile.build:337: recipe for target '/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat/main.o' failed
make[8]: *** [/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat] Error 2
scripts/Makefile.build:573: recipe for target '/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1/compat' failed
make[7]: *** [_module_/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1] Error 2
Makefile:1412: recipe for target '_module_/openwrt/vdb1/qsdk-repo-ub18-11.5.0.6-1/qsdk-2/build_dir/target-arm_cortex-a7_musl-1.1.16_eabi/linux-ipq_ipq40xx/backports-5.8.18-1' failed
make[6]: *** [modules] Error 2
Makefile.build:13: recipe for target 'modules' failed
make[5]: *** [modules] Error 2
Makefile.real:93: recipe for target 'modules' failed
make[4]: *** [modules] Error 2
Makefile:120: recipe for target 'modules' failed