【问题标题】:error while cross-compiling for arm architecture交叉编译arm架构时出错
【发布时间】:2018-09-13 13:32:54
【问题描述】:

我在我的系统上运行 linux 操作系统。我已经成功交叉编译了arm arch的linux内核4.9.11,现在我正在尝试在x86平台上交叉编译arm架构的wifi驱动程序。 我已经设置了ARCH=armCROSS_COMPILE=<path to toolchain> env 并通过了KERNEL DIRECTORY = cross compiled kernel directory。即使在指定 ARCH 之后,也会引用 x86 文件。我收到以下错误。如果我遗漏了什么,谁能指出我。由于字符限制,我只更新了一半日志。

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)

【问题讨论】:

  • 您是否尝试过将特定 WiFi 驱动程序从可加载模块更改为内核配置中的内置模块?
  • @arshan 我只需要将它编译为可加载模块。要求它是可加载的
  • 如日志中所示,“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 驱动程序正在使用 "ARCH=i386" 编译。 wifi驱动代码中的Makefile是硬编码吗?你如何确保你传递的参数实际上是由驱动程序生成的?
  • 检查日志,上面写着 make ARCH=i386。只需设置环境变量export ARCH=armexport CROSS_COMPILE=&lt;toolchain/path/&gt; 并重试。
  • 我觉得 Makefile 有问题,你可以添加这里使用的 sn -p 或完整的 Makefile 吗?

标签: compiler-errors linux-kernel arm driver cross-compiling


【解决方案1】:

以下是我的输出和制作文件 那么您能否发布 Makefile 或同样进行更改。

$ make FOO=test
echo test
test
$ cat Makefile 

all:
    echo $(FOO)

或者,如果您不想共享,因为它是一种保护,那么您也可以尝试在 makefile 中添加新条目,例如测试 喜欢

test:
    echo $(ARCH) $(CROSS_COMPILE)

然后使用

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-01-18
    • 1970-01-01
    • 1970-01-01
    • 2010-10-04
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    相关资源
    最近更新 更多