This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM Compiler 6.12 L6087U/L6088U errors

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

Hmm, strange. Okay, try to explicitly define target architecture by applying --cpu option for linker:

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.

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.

Parents
  • Hi omikron,

    The linker will only scan through input library files to resolve references made from input object files. Therefore, it is expected that you will need to provide at least one input object file explicitly as part of your link command.

    However, this doesn't need to be an object file from outside a library file. You can specify an object file from within a library file using the syntax documented here:
    https://developer.arm.com/docs/100070/0612/linker-command-line-options/input-file-list 

    For example, a command like this does not work:

    armlink package1.a package2.a -o image.axf

    but a command like this should:

    armlink package1.a\(main.o\) package1.a package2.a -o image.axf

Reply
  • Hi omikron,

    The linker will only scan through input library files to resolve references made from input object files. Therefore, it is expected that you will need to provide at least one input object file explicitly as part of your link command.

    However, this doesn't need to be an object file from outside a library file. You can specify an object file from within a library file using the syntax documented here:
    https://developer.arm.com/docs/100070/0612/linker-command-line-options/input-file-list 

    For example, a command like this does not work:

    armlink package1.a package2.a -o image.axf

    but a command like this should:

    armlink package1.a\(main.o\) package1.a package2.a -o image.axf

Children
No data