掌機 - Pyra - 解決selected processor does not support cpsid i in ARM mode問題



參考資訊:
https://groups.google.com/g/linux.debian.bugs.dist/c/2AWbk5Dxy54
https://lore.kernel.org/linux-arm-kernel/20211018140735.3714254-1-arnd@kernel.org

問題如下:

  CC      init/main.o
/tmp/cc9kQCqm.s: Assembler messages:
/tmp/cc9kQCqm.s:2282: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/cc9kQCqm.s:2632: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/cc9kQCqm.s:2713: Error: selected processor does not support `cpsie i' in ARM mode
/tmp/cc9kQCqm.s:2784: Error: selected processor does not support `dsb ' in ARM mode
/tmp/cc9kQCqm.s:3069: Error: selected processor does not support `cpsie i' in ARM mode
/tmp/cc9kQCqm.s:3211: Error: selected processor does not support `cpsid i' in ARM mode
/tmp/cc9kQCqm.s:3221: Error: selected processor does not support `dmb ishst' in ARM mode
/tmp/cc9kQCqm.s:3230: Error: selected processor does not support `dmb ishst' in ARM mode
make[1]: *** [scripts/Makefile.build:268: init/main.o] Error 1
make: *** [Makefile:1695: init] Error 2

解法如下:

$ vim arch/arm/Makefile
    arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m
    arch-$(CONFIG_CPU_32v7)  =-D__LINUX_ARM_ARCH__=7 -march=armv7-a
    arch-$(CONFIG_CPU_32v6)  =-D__LINUX_ARM_ARCH__=6 -march=armv6