0
votes

I am running linux OS on my system. I have cross compiled linux kernel 4.9.11 for arm arch successfully, now I am trying to cross compile a wifi driver for arm architecture on x86 platform. I have set both ARCH=arm & CROSS_COMPILE=<path to toolchain> env & passing the KERNEL DIRECTORY = cross compiled kernel directory. Even after specifying the ARCH, x86 files are being referred. I am getting following error. Can anyone point me if I am missing something. Because of character restrictions I am updating only half log.

make ARCH=arm CROSS_COMPILE=~/imx/boot/gcc-linaro-6.4.1-2017.11-i686_arm-linux-gnueabi/bin/arm-linux-gnueabi- KERNELDIR=~/linux-stable/

Build drivers
cd /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers && make ARCH=i386 CROSS_COMPILE=
make[1]: Entering directory '/home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers'
/bin/sh: 1: [: -gt: argument expected
make ARCH=i386 CROSS_COMPILE= -C /lib/modules/4.9.11+/build SUBDIRS=/home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new clean
make[2]: Entering directory '/home/wlan-3/linux-stable'
  CLEAN   /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/.tmp_versions
make[2]: Leaving directory '/home/wlan-3/linux-stable'
make ARCH=i386 CROSS_COMPILE= -C /lib/modules/4.9.11+/build SUBDIRS=/home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new KBUILD_EXTRA_SYMBOLS=/Module.symvers modules  WLAN_ROOT=/home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/"qcacld-new" MODNAME=wlan CONFIG_QCA_WIFI_ISOC=0 CONFIG_QCA_WIFI_2_0=1 CONFIG_QCA_CLD_WLAN=m WLAN_OPEN_SOURCE=1 CONFIG_CLD_HL_SDIO_CORE=y CONFIG_LINUX_QCMBR=y  
make[2]: Entering directory '/home/wlan-3/linux-stable'
  LD      /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/built-in.o
  CC [M]  /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.o
In file included from ./arch/x86/include/asm/bitops.h:16:0,
                 from ./include/linux/bitops.h:36,
                 from ./include/linux/kernel.h:10,
                 from ./include/linux/list.h:8,
                 from ./include/linux/module.h:9,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/arch_hweight.h: In function ‘__arch_hweight64’:
./arch/x86/include/asm/arch_hweight.h:54:42: error: expected ‘:’ or ‘)’ before ‘POPCNT64’
  asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT)
                                          ^
./arch/x86/include/asm/alternative.h:132:28: note: in definition of macro ‘ALTINSTR_REPLACEMENT’
  b_replacement(num)":\n\t" newinstr "\n" e_replacement(num) ":\n\t"
                            ^
./arch/x86/include/asm/arch_hweight.h:54:7: note: in expansion of macro ‘ALTERNATIVE’
  asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT)
       ^
In file included from ./arch/x86/include/asm/atomic.h:268:0,
                 from ./include/linux/atomic.h:4,
                 from ./include/linux/jump_label.h:169,
                 from ./arch/x86/include/asm/string_64.h:5,
                 from ./arch/x86/include/asm/string.h:4,
                 from ./include/linux/string.h:18,
                 from ./arch/x86/include/asm/page_32.h:34,
                 from ./arch/x86/include/asm/page.h:13,
                 from ./arch/x86/include/asm/thread_info.h:11,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/atomic64_64.h: At top level:
./arch/x86/include/asm/atomic64_64.h:19:40: error: unknown type name ‘atomic64_t’
 static inline long atomic64_read(const atomic64_t *v)
                                        ^
In file included from ./include/uapi/linux/stddef.h:1:0,
                 from ./include/linux/stddef.h:4,
                 from ./include/uapi/linux/posix_types.h:4,
                 from ./include/uapi/linux/types.h:13,
                 from ./include/linux/types.h:5,
                 from ./include/linux/list.h:4,
                 from ./include/linux/module.h:9,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/atomic64_64.h: In function ‘atomic64_read’:
./arch/x86/include/asm/atomic64_64.h:21:22: error: request for member ‘counter’ in something not a structure or union
  return READ_ONCE((v)->counter);
                      ^
./include/linux/compiler.h:305:17: note: in definition of macro ‘__READ_ONCE’
  union { typeof(x) __val; char __c[1]; } __u;   \
                 ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘READ_ONCE’
  return READ_ONCE((v)->counter);
         ^
./arch/x86/include/asm/atomic64_64.h:21:22: error: request for member ‘counter’ in something not a structure or union
  return READ_ONCE((v)->counter);
                      ^
./include/linux/compiler.h:307:22: note: in definition of macro ‘__READ_ONCE’
   __read_once_size(&(x), __u.__c, sizeof(x));  \
                      ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘READ_ONCE’
  return READ_ONCE((v)->counter);
         ^
./arch/x86/include/asm/atomic64_64.h:21:22: error: request for member ‘counter’ in something not a structure or union
  return READ_ONCE((v)->counter);
                      ^
./include/linux/compiler.h:307:42: note: in definition of macro ‘__READ_ONCE’
   __read_once_size(&(x), __u.__c, sizeof(x));  \
                                          ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘READ_ONCE’
  return READ_ONCE((v)->counter);
         ^
./arch/x86/include/asm/atomic64_64.h:21:22: error: request for member ‘counter’ in something not a structure or union
  return READ_ONCE((v)->counter);
                      ^
./include/linux/compiler.h:309:30: note: in definition of macro ‘__READ_ONCE’
   __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
                              ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘READ_ONCE’
  return READ_ONCE((v)->counter);
         ^
./arch/x86/include/asm/atomic64_64.h:21:22: error: request for member ‘counter’ in something not a structure or union
  return READ_ONCE((v)->counter);
                      ^
./include/linux/compiler.h:309:50: note: in definition of macro ‘__READ_ONCE’
   __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
                                                  ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘READ_ONCE’
  return READ_ONCE((v)->counter);
In file included from ./include/linux/jump_label.h:169:0,
                 from ./arch/x86/include/asm/string_64.h:5,
                 from ./arch/x86/include/asm/string.h:4,
                 from ./include/linux/string.h:18,
                 from ./arch/x86/include/asm/page_32.h:34,
                 from ./arch/x86/include/asm/page.h:13,
                 from ./arch/x86/include/asm/thread_info.h:11,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/linux/atomic.h:1000:49: error: unknown type name ‘atomic64_t’
 static inline void atomic64_andnot(long long i, atomic64_t *v)
                                                 ^
./include/linux/atomic.h:1005:60: error: unknown type name ‘atomic64_t’
 static inline long long atomic64_fetch_andnot(long long i, atomic64_t *v)
                                                            ^
./include/linux/atomic.h:1010:68: error: unknown type name ‘atomic64_t’
 static inline long long atomic64_fetch_andnot_relaxed(long long i, atomic64_t *v)
                                                                    ^
./include/linux/atomic.h:1015:68: error: unknown type name ‘atomic64_t’
 static inline long long atomic64_fetch_andnot_acquire(long long i, atomic64_t *v)
                                                                    ^
./include/linux/atomic.h:1020:68: error: unknown type name ‘atomic64_t’
 static inline long long atomic64_fetch_andnot_release(long long i, atomic64_t *v)
                                                                    ^
In file included from ./arch/x86/include/asm/pgtable_types.h:288:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopud.h:15:0: error: "PUD_SHIFT" redefined [-Werror]
 #define PUD_SHIFT PGDIR_SHIFT
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:34:0: note: this is the location of the previous definition
 #define PUD_SHIFT 30
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:288:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopud.h:16:0: error: "PTRS_PER_PUD" redefined [-Werror]
 #define PTRS_PER_PUD 1
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:35:0: note: this is the location of the previous definition
 #define PTRS_PER_PUD 512
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:288:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopud.h:17:0: error: "PUD_SIZE" redefined [-Werror]
 #define PUD_SIZE   (1UL << PUD_SHIFT)
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:51:0: note: this is the location of the previous definition
 #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:288:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopud.h:18:0: error: "PUD_MASK" redefined [-Werror]
 #define PUD_MASK   (~(PUD_SIZE-1))
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:52:0: note: this is the location of the previous definition
 #define PUD_MASK (~(PUD_SIZE - 1))
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:309:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopmd.h:19:0: error: "PMD_SHIFT" redefined [-Werror]
 #define PMD_SHIFT PUD_SHIFT
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:41:0: note: this is the location of the previous definition
 #define PMD_SHIFT 21
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:309:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopmd.h:20:0: error: "PTRS_PER_PMD" redefined [-Werror]
 #define PTRS_PER_PMD 1
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:42:0: note: this is the location of the previous definition
 #define PTRS_PER_PMD 512
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:309:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./include/asm-generic/pgtable-nopmd.h:21:0: error: "PMD_SIZE" redefined [-Werror]
 #define PMD_SIZE   (1UL << PMD_SHIFT)
 ^
In file included from ./arch/x86/include/asm/pgtable_types.h:240:0,
                 from ./arch/x86/include/asm/processor.h:18,
                 from ./arch/x86/include/asm/cpufeature.h:4,
                 from ./arch/x86/include/asm/thread_info.h:52,
                 from ./include/linux/thread_info.h:58,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from ./include/linux/preempt.h:59,
                 from ./include/linux/spinlock.h:50,
                 from ./include/linux/seqlock.h:35,
                 from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:18,
                 from ./include/linux/module.h:10,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/drivers/qcacld-new/CORE/HDD/inc/wlan_hdd_includes.h:48,
                 from /home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new/CORE/HDD/src/wlan_hdd_assoc.c:50:
./arch/x86/include/asm/pgtable_64_types.h:49:0: note: this is the location of the previous definition
 #define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
1
Have you tried changing that particular WiFi driver from loadable module to built-in module in kernel config?Arshan
@arshan I need to compile it as loadable module only. requirement demands it to be loadableRafal
As in log, "make ARCH=i386 CROSS_COMPILE= -C /lib/modules/4.9.11+/build SUBDIRS=/home/wlan-3/qca/qca9377-le-2-3-3_qca_oem.git/wlan_host/cnss_proc/fixce/AIO/build/../drivers/qcacld-new clean" wifi driver is being compiled with "ARCH=i386". Does Makefile in wifi driver code hard code it? How are you making sure make arguments you are passing is actually going down to drivers make ?rk1825
Check the log, it says make ARCH=i386. Just set environment variables export ARCH=arm and export CROSS_COMPILE=<toolchain/path/> and re-try.LinuxStuff
I feel There is some issue in Makefile can you add snippet or full Makefile which is used here?Devidas

1 Answers

1
votes

following is my output and make file which worked so can you please post Makefile or make changes likewise.

$ make FOO=test
echo test
test
$ cat Makefile 

all:
    echo $(FOO)

OR in case you do't want to share as it is propitiatory then alternatively can try this add new entry in makefile say test like

test:
    echo $(ARCH) $(CROSS_COMPILE)

and then use

$ make test ARCH=arm CROSS_COMPILE=/home/test