My build fails with "arm-none-eabi-size: invalid option -- O"

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

My build fails with "arm-none-eabi-size: invalid option -- O"

1,264 次查看
Frank_Z
Contributor I

Funny it worked last week. I run my Debug_Segger configuration and it gets to the last command and dies.

In file included from C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/rtos/mqx/mqx_stdlib/source/include/stdio.h:32:0,
from C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/filesystem/mfs/include/mfs_prv.h:38,
from ..\SDK\filesystem\mfs\generic\mfs_find.c:27:
C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/rtos/mqx/mqx_stdlib/source/include/std_prv.h:33:0: warning: "STD_FP_IO" redefined [enabled by default]
#define STD_FP_IO 0
^
In file included from C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/rtos/mqx/config/common/mqx_cnfg.h:132:0,
from C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/rtos/mqx/mqx/source/include/mqx.h:75,
from C:/Semco/MCU/R6070-MCU-Demod_9-14-22/SDK/filesystem/mfs/include/mfs.h:33,
from ..\SDK\filesystem\mfs\generic\mfs_find.c:26:
C:/Semco/MCU/R6070-MCU-Demod_9-14-22/Generated_Code/SDK/rtos/mqx/config/mcu/mqx_sdk_config.h:126:0: note: this is the location of the previous definition
#define STD_FP_IO 1
^
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -T C:/Semco/MCU/R6070-MCU-Demod_9-14-22/Project_Settings/Linker_Files/ProcessorExpert.ld -Xlinker --gc-sections -LC:/Semco/MCU/R6070-MCU-Demod_9-14-22/Project_Settings/Linker_Files -Wl,-Map,tripleDemod.map -u _printf_float -lgcc -lc -lsupc++ -lm -specs=nosys.specs -nostartfiles -Xlinker -z -Xlinker muldefs -Xlinker -static -o tripleDemod.elf @ObjectList
arm-none-eabi-objcopy -O ihex tripleDemod.elf tripleDemod.hex
arm-none-eabi-size --format=berkeley tripleDemod.elf & arm-none-eabi-objcopy -O binary tripleDemod.elf R6070-MCU-Demod_9-14-22.bin
arm-none-eabi-size: invalid option -- O
Usage: arm-none-eabi-size [option(s)] [file(s)]
Displays the sizes of sections inside binary files
If no input file(s) are specified, a.out is assumed
The options are:
-A|-B --format={sysv|berkeley} Select output style (default is berkeley)
-o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex
-t --totals Display the total sizes (Berkeley only)
--common Display total size for *COM* syms
--target=<bfdname> Set the binary file format
@<file> Read options from <file>
-h --help Display this information
-v --version Display the program's version

arm-none-eabi-size: supported targets: elf32-littlearm elf32-bigarm elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex

15:14:37 Build Finished (took 2m:21s.631ms)

I can run the failing command from a Command Prompt window and it works fine.

arm-none-eabi-size --format=berkeley tripleDemod.elf & arm-none-eabi-objcopy -O binary tripleDemod.elf R6070-MCU-Demod_9-14-22.bin

I recently tried to load GCC for another project to no avail and have "uninstalled" it since. I also cleaned up the path. Lots of repetitions.

System information attached

 

 

 

 

标签 (1)
0 项奖励
回复
2 回复数

1,223 次查看
bobpaddock
Senior Contributor III
"I can run the failing command from a Command Prompt window and it works fine."

This would indicate that the shell called by Make is different.

In 'cleaning up' did the paths change to a different shell? Make expects some version of 'sh' or bash to be available.
I'd drop the '&' and do size and objcopy sequentially.
'&' depends on the OS and the shell as to what it really does.

Also the parameters to objcopy have changed over they years. I still keep a version of it around from 2018, as some of the options were removed in more modern ones. I don't recall if it was -O or not.

0 项奖励
回复

1,233 次查看
ErichStyger
Specialist I

It seems to me that the -O option from the second command (after &) is somehow causing this.

Did you set this up as a post-build action? I know that combining commands with & is depending on the underlying OS and how the plugin is handling this. So if your OS has been updated (somehow?) or you have newer plugins, this might cause this (just guessing).

There are options to create a flash image and printing the size in the 'Toolchains' setting (see https://mcuoneclipse.com/2014/04/11/gnu-additional-tools-create-flash-image-print-size-and-extended-...), can you use this to give it a try?

0 项奖励
回复