linux 错误:请求的对齐“20”不是“__aligned(sizeof(struct __call_single_data))中的2的正幂;“

mwg9r5ms  于 2022-12-29  发布在  Linux
关注(0)|答案(1)|浏览(179)

我尝试使用CROSS_COMPILE=arm-none-eabi-ARCH=arm64编译https://github.com/varigit/linux-imx.git,但收到错误

linux-imx$ make
warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
warning: LSE atomics not supported by binutils
In file included from ././include/linux/compiler_types.h:65,
                 from <command-line>:
./include/linux/smp.h:34:26: error: requested alignment '20' is not a positive power of 2
   34 |  __aligned(sizeof(struct __call_single_data));
      |                          ^~~~~~~~~~~~~~~~~~
./include/linux/compiler_attributes.h:33:68: note: in definition of macro '__aligned'
   33 | #define __aligned(x)                    __attribute__((__aligned__(x)))
      |                                                                    ^
In file included from ./arch/arm64/include/asm/thread_info.h:17,
                 from ./include/linux/thread_info.h:60,
                 from ./arch/arm64/include/asm/preempt.h:5,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/smp.h:110,
                 from ./include/linux/lockdep.h:14,
                 from ./include/linux/mutex.h:17,
                 from ./include/linux/kernfs.h:12,
                 from ./include/linux/sysfs.h:16,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/of.h:17,
                 from ./include/linux/irqdomain.h:35,
                 from ./include/linux/acpi.h:13,
                 from ./include/acpi/apei.h:9,
                 from ./include/acpi/ghes.h:5,
                 from ./include/linux/arm_sdei.h:8,
                 from arch/arm64/kernel/asm-offsets.c:10:
./arch/arm64/include/asm/memory.h: In function 'kaslr_offset':
./arch/arm64/include/asm/memory.h:62:33: warning: left shift count >= width of type [-Wshift-count-overflow]
   62 | #define _PAGE_END(va)  (-(UL(1) << ((va) - 1)))
      |                                 ^~

接着是一页又一页的后续错误。
网上搜索没有任何结果。前两行显然是警告。

xkftehaa

xkftehaa1#

工具链是错误的,arm-none-eabi-既不是用来构建linux的,也不是用来构建64位的。apt-get install gcc-10-aarch64-linux-gnuCROSS_COMPILE=aarch64-linux-gnu-sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-10 /usr/bin/aarch64-linux-gnu-gcc已经足够了。

相关问题