我尝试使用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)))
| ^~
接着是一页又一页的后续错误。
网上搜索没有任何结果。前两行显然是警告。
1条答案
按热度按时间xkftehaa1#
工具链是错误的,
arm-none-eabi-
既不是用来构建linux的,也不是用来构建64位的。apt-get install gcc-10-aarch64-linux-gnu
,CROSS_COMPILE=aarch64-linux-gnu-
和sudo ln -s /usr/bin/aarch64-linux-gnu-gcc-10 /usr/bin/aarch64-linux-gnu-gcc
已经足够了。