我有一个开源的微型鼠标机器人项目。为了更容易编译,我使用容器(Podman 和 Docker 都应该没问题):
make image
make libopencm3
make
这工作得很好,并生成一个main.elf
大小约为 874 kB 的文件。但这只要我修复Dockerfile 中的 to 即可arm-none-eabi-gcc-cs
。7.4.0
如果我删除特定版本或将其设置为9.2.0
,则会收到以下错误:
$ make
/usr/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: main.elf section `.text' will not fit in region `rom'
/usr/lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 5288 bytes
collect2: error: ld returned 1 exit status
make: *** [opencm3/libopencm3.rules.mk:204: main.elf] Error 1
这些版本之间可能会发生什么变化?
如果我将此行添加到我的 Makefile:
LDFLAGS += -specs=nano.specs
然后它用版本编译得很好,9.2.0
并生成一个main.elf
大小约为 885 kB 的文件。但我想知道性能是否与以前相同(或等效)。
更新
当然,我期待一些性能差异,就像我期待二进制大小的一些差异一样。但我想知道我是否可以期望性能差异超过 20%(特别是如果它现在可以慢 20%)。
新的二进制文件比以前大了不到 2%,我认为这与以前“相同”。:-D