概述
编译I.MX6的Linux驱动时出现如下错误:
make -C /home/richard/linux_imx6/linux_kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga M=/home/richard/linux_imx6/linux_drivers/led_driver modules
make[1]: Entering directory '/home/richard/linux_imx6/linux_kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga'
CC [M] /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.o
In file included from ./arch/x86/include/asm/bitops.h:16,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:2:
./arch/x86/include/asm/arch_hweight.h: In function ‘__arch_hweight64’:
./arch/x86/include/asm/arch_hweight.h:53:42: error: expected ‘:’ or ‘)’ before ‘POPCNT64’
53 | asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT)
| ^~~~~~~~
./arch/x86/include/asm/alternative.h:125:28: note: in definition of macro ‘ALTINSTR_REPLACEMENT’
125 | b_replacement(num)":nt" newinstr "n" e_replacement(num) ":nt"
| ^~~~~~~~
./arch/x86/include/asm/arch_hweight.h:53:7: note: in expansion of macro ‘ALTERNATIVE’
53 | asm (ALTERNATIVE("call __sw_hweight64", POPCNT64, X86_FEATURE_POPCNT)
| ^~~~~~~~~~~
In file included from include/linux/kernel.h:11,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:2:
include/linux/log2.h: At top level:
include/linux/log2.h:22:1: warning: ignoring attribute ‘noreturn’ because it conflicts with attribute ‘const’ [-Wattributes]
22 | int ____ilog2_NaN(void);
| ^~~
In file included from ./arch/x86/include/asm/pgtable_types.h:250,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopud.h:15: warning: "PUD_SHIFT" redefined
15 | #define PUD_SHIFT PGDIR_SHIFT
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:33: note: this is the location of the previous definition
33 | #define PUD_SHIFT 30
|
In file included from ./arch/x86/include/asm/pgtable_types.h:250,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopud.h:16: warning: "PTRS_PER_PUD" redefined
16 | #define PTRS_PER_PUD 1
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:34: note: this is the location of the previous definition
34 | #define PTRS_PER_PUD 512
|
In file included from ./arch/x86/include/asm/pgtable_types.h:250,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopud.h:17: warning: "PUD_SIZE" redefined
17 | #define PUD_SIZE (1UL << PUD_SHIFT)
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:50: note: this is the location of the previous definition
50 | #define PUD_SIZE (_AC(1, UL) << PUD_SHIFT)
|
In file included from ./arch/x86/include/asm/pgtable_types.h:250,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopud.h:18: warning: "PUD_MASK" redefined
18 | #define PUD_MASK (~(PUD_SIZE-1))
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:51: note: this is the location of the previous definition
51 | #define PUD_MASK (~(PUD_SIZE - 1))
|
In file included from ./arch/x86/include/asm/pgtable_types.h:271,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopmd.h:19: warning: "PMD_SHIFT" redefined
19 | #define PMD_SHIFT PUD_SHIFT
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:40: note: this is the location of the previous definition
40 | #define PMD_SHIFT 21
|
In file included from ./arch/x86/include/asm/pgtable_types.h:271,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopmd.h:20: warning: "PTRS_PER_PMD" redefined
20 | #define PTRS_PER_PMD 1
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:41: note: this is the location of the previous definition
41 | #define PTRS_PER_PMD 512
|
In file included from ./arch/x86/include/asm/pgtable_types.h:271,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopmd.h:21: warning: "PMD_SIZE" redefined
21 | #define PMD_SIZE (1UL << PMD_SHIFT)
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:48: note: this is the location of the previous definition
48 | #define PMD_SIZE (_AC(1, UL) << PMD_SHIFT)
|
In file included from ./arch/x86/include/asm/pgtable_types.h:271,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/asm-generic/pgtable-nopmd.h:22: warning: "PMD_MASK" redefined
22 | #define PMD_MASK (~(PMD_SIZE-1))
|
In file included from ./arch/x86/include/asm/pgtable_types.h:205,
from ./arch/x86/include/asm/processor.h:18,
from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/pgtable_64_types.h:49: note: this is the location of the previous definition
49 | #define PMD_MASK (~(PMD_SIZE - 1))
|
In file included from ./arch/x86/include/asm/thread_info.h:49,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/processor.h:166: warning: "cache_line_size" redefined
166 | #define cache_line_size() (boot_cpu_data.x86_cache_alignment)
|
In file included from include/linux/printk.h:8,
from include/linux/kernel.h:13,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:2:
include/linux/cache.h:64: note: this is the location of the previous definition
64 | #define cache_line_size() L1_CACHE_BYTES
|
In file included from ./arch/x86/include/asm/segment.h:155,
from ./arch/x86/include/asm/ptrace.h:4,
from ./arch/x86/include/asm/alternative.h:8,
from ./arch/x86/include/asm/bitops.h:16,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:2:
./arch/x86/include/asm/cache.h:7:25: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function); did you mean ‘CONFIG_ARM_L1_CACHE_SHIFT’?
7 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/cache.h:8:30: note: in expansion of macro ‘L1_CACHE_SHIFT’
8 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~
include/linux/cache.h:12:25: note: in expansion of macro ‘L1_CACHE_BYTES’
12 | #define SMP_CACHE_BYTES L1_CACHE_BYTES
| ^~~~~~~~~~~~~~
include/linux/cache.h:20:58: note: in expansion of macro ‘SMP_CACHE_BYTES’
20 | #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
| ^~~~~~~~~~~~~~~
./arch/x86/include/asm/processor.h:270:27: note: in expansion of macro ‘____cacheline_aligned’
270 | } __attribute__((packed)) ____cacheline_aligned;
| ^~~~~~~~~~~~~~~~~~~~~
In file included from ./arch/x86/include/asm/preempt.h:5,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/processor.h: In function ‘current_top_of_stack’:
./arch/x86/include/asm/processor.h:594:30: error: ‘cpu_current_top_of_stack’ undeclared (first use in this function); did you mean ‘current_top_of_stack’?
594 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/percpu.h:213:9: note: in definition of macro ‘percpu_stable_op’
213 | typeof(var) pfo_ret__;
| ^~~
./arch/x86/include/asm/processor.h:594:9: note: in expansion of macro ‘this_cpu_read_stable’
594 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/processor.h:594:30: note: each undeclared identifier is reported only once for each function it appears in
594 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/percpu.h:213:9: note: in definition of macro ‘percpu_stable_op’
213 | typeof(var) pfo_ret__;
| ^~~
./arch/x86/include/asm/processor.h:594:9: note: in expansion of macro ‘this_cpu_read_stable’
594 | return this_cpu_read_stable(cpu_current_top_of_stack);
| ^~~~~~~~~~~~~~~~~~~~
In file included from ./arch/x86/include/asm/atomic.h:235,
from include/linux/atomic.h:4,
from ./arch/x86/include/asm/thread_info.h:50,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./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’
19 | static inline long atomic64_read(const atomic64_t *v)
| ^~~~~~~~~~
In file included from include/uapi/linux/stddef.h:1,
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 /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:1:
./arch/x86/include/asm/atomic64_64.h: In function ‘atomic64_read’:
./arch/x86/include/asm/atomic64_64.h:21:24: error: request for member ‘counter’ in something not a structure or union
21 | return ACCESS_ONCE((v)->counter);
| ^~
include/linux/compiler.h:456:25: note: in definition of macro ‘__ACCESS_ONCE’
456 | __maybe_unused typeof(x) __var = (__force typeof(x)) 0;
| ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘ACCESS_ONCE’
21 | return ACCESS_ONCE((v)->counter);
| ^~~~~~~~~~~
./arch/x86/include/asm/atomic64_64.h:21:24: error: request for member ‘counter’ in something not a structure or union
21 | return ACCESS_ONCE((v)->counter);
| ^~
include/linux/compiler.h:456:52: note: in definition of macro ‘__ACCESS_ONCE’
456 | __maybe_unused typeof(x) __var = (__force typeof(x)) 0;
| ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘ACCESS_ONCE’
21 | return ACCESS_ONCE((v)->counter);
| ^~~~~~~~~~~
./arch/x86/include/asm/atomic64_64.h:21:24: error: request for member ‘counter’ in something not a structure or union
21 | return ACCESS_ONCE((v)->counter);
| ^~
include/linux/compiler.h:457:19: note: in definition of macro ‘__ACCESS_ONCE’
457 | (volatile typeof(x) *)&(x); })
| ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘ACCESS_ONCE’
21 | return ACCESS_ONCE((v)->counter);
| ^~~~~~~~~~~
./arch/x86/include/asm/atomic64_64.h:21:24: error: request for member ‘counter’ in something not a structure or union
21 | return ACCESS_ONCE((v)->counter);
| ^~
include/linux/compiler.h:457:26: note: in definition of macro ‘__ACCESS_ONCE’
457 | (volatile typeof(x) *)&(x); })
| ^
./arch/x86/include/asm/atomic64_64.h:21:9: note: in expansion of macro ‘ACCESS_ONCE’
21 | return ACCESS_ONCE((v)->counter);
| ^~~~~~~~~~~
In file included from ./arch/x86/include/asm/atomic.h:235,
from include/linux/atomic.h:4,
from ./arch/x86/include/asm/thread_info.h:50,
from include/linux/thread_info.h:54,
from ./arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:18,
from include/linux/spinlock.h:50,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:19,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
./arch/x86/include/asm/atomic64_64.h: At top level:
./arch/x86/include/asm/atomic64_64.h:31:33: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
31 | static inline void atomic64_set(atomic64_t *v, long i)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:43:41: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
43 | static inline void atomic64_add(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:57:41: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
57 | static inline void atomic64_sub(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:73:49: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
73 | static inline int atomic64_sub_and_test(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:84:33: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
84 | static inline void atomic64_inc(atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:97:33: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
97 | static inline void atomic64_dec(atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:112:41: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
112 | static inline int atomic64_dec_and_test(atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:125:41: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
125 | static inline int atomic64_inc_and_test(atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:139:49: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
139 | static inline int atomic64_add_negative(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:151:48: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
151 | static inline long atomic64_add_return(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:156:48: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
156 | static inline long atomic64_sub_return(long i, atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:164:37: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
164 | static inline long atomic64_cmpxchg(atomic64_t *v, long old, long new)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:169:34: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
169 | static inline long atomic64_xchg(atomic64_t *v, long new)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:183:39: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
183 | static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
| ^~~~~~~~~~
| atomic_t
./arch/x86/include/asm/atomic64_64.h:207:45: error: unknown type name ‘atomic64_t’; did you mean ‘atomic_t’?
207 | static inline long atomic64_dec_if_positive(atomic64_t *v)
| ^~~~~~~~~~
| atomic_t
In file included from include/linux/sched.h:32,
from include/linux/blkdev.h:4,
from include/linux/ide.h:12,
from /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.c:4:
include/linux/cputime.h:4:10: fatal error: asm/cputime.h: No such file or directory
4 | #include <asm/cputime.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:265: /home/richard/linux_imx6/linux_drivers/led_driver/led_driver.o] Error 1
make[1]: *** [Makefile:1384: _module_/home/richard/linux_imx6/linux_drivers/led_driver] Error 2
make[1]: Leaving directory '/home/richard/linux_imx6/linux_kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga'
make: *** [Makefile:8: kernel_modules] Error 2
解决方法:
进入kernel目录修改当前目录下Makefile文件
ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
改为
ARCH = arm
CROSS_COMPILE = arm-linux-gnueabihf-
最后
以上就是超帅乌冬面为你收集整理的编译I.MX6的Linux驱动时出现乱七八糟的错误的全部内容,希望文章能够帮你解决编译I.MX6的Linux驱动时出现乱七八糟的错误所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复