We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all.
I'm trying to build Apache Mynewt-based (https://mynewt.apache.org/) application using ARM Compiler 6.12.
Mynewt build system (newt) uses package approach. Package consists of at least one source file. For every source file (*.c) in package an object file is built (*.o). Then all object files in package are archived together to one library (*.a) file. After that all library files linked together to final image (*.elf). And this is works fine with GNU ARM embedded toolchain.
I was able to build object files. Here is template command line for compiler:
armclang --target=arm-arm-none-eabi -D...<few -D definitions> -O0 -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -I...<few include paths> -c -o source.o source.c
I was able to create library files. Here is template command line for librarian:
armar -rcs package.a source1.o source2.o ...
But I can't link *.a files together:
armclang-o image.elf --target=arm-arm-none-eabi -D...<few -D definitions> -O0 -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 package1.a package2.a
I receive following error: L6087U: Could not determine the target architecture for linking from the explicitly specified object files
L6087U: Could not determine the target architecture for linking from the explicitly specified object files
Hmm, strange. Okay, try to explicitly define target architecture by applying --cpu option for linker:
--cpu
armclang-o image.elf --target=arm-arm-none-eabi -D...<few -D definitions> -O0 -g -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--cpu=cortex-m4.fp package1.a package2.a
Now another error: L6088U: Could not determine the endianness for linking from the explicitly specified object files.
L6088U: Could not determine the endianness for linking from the explicitly specified object files.
This time I can't move further, there is no option to explicitly define the endianness for armlink. There is no any info on errors L6087U / L6088U.
Looks like armlink can't get required information from library files.
Any suggestions?
Thank you.
Update: linker feels good if there is at least one *.o file among input files.
Is this a bug or feature of armlink? It unable to detect target when only *.a files in input list.