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-none-eabi-gcc 11 version compiler asmbler failed

I just download the arm-none-eabi-gcc 11 version from:

https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads

But I can not compile my project that succeed before with arm-none-eabi-gcc 10.

it fail with the assembler file, that I embeded a binary file with 'incbin' instruction,

seem it can not find the include path, if the binary is not same path with asmbler file.

Here is a simple demo code incbin_test.S:

    .section .rodata

    .global thing
    .balign 4
thing:
    .incbin "demo.bin"
thing_end:

    .global thing_size
    .balign 4
thing_size:
    .int    thing_end - thing

there is a demo.bin in the path inc/

Then compile with gcc

arm-none-eabi-gcc -Iinc -c incbin_test.S -o incbin_test.o

It issue the error:

incbin_test.S: Assembler messages:
incbin_test.S:6: Error: file not found: demo.bin

But that work with the arm-none-eabi-gcc(gcc version 10.2.1 20201103 (release) (GNU Arm Embedded Toolchain 10-2020-q4-major))

Br,

Yingchun

Parents
  • The 10.3-2021.10 arm-none-eabi-gcc was configured with --with-gnu-as switch, as can be seen by running arm-none-eabi-gcc -v.

    The 11.2-2022.02 arm-none-eabi-gcc was not configured with --with-gnu-as. Because of this difference, asm_options in the default spec (gcc -dumpspecs) is missing the switches (specifically, %{I*}) that make the compiler pass its include directory arguments to the assembler.

    static const char *asm_options =
    "%{-target-help:%:print-asm-header()} "
    #if HAVE_GNU_AS
    /* If GNU AS is used, then convert -w (no warnings), -I, and -v
       to the assembler equivalents.  */
    "%{v} %{w:-W} %{I*} "
    #endif

    I think that gcc passes the include directory argument to the assembler only if gcc was configured with the knowledge of a default assembler.

    There might be a way to workaround this by using specs files, but -Wa,-Iinc seems to be the easiest, safest solution.

Reply
  • The 10.3-2021.10 arm-none-eabi-gcc was configured with --with-gnu-as switch, as can be seen by running arm-none-eabi-gcc -v.

    The 11.2-2022.02 arm-none-eabi-gcc was not configured with --with-gnu-as. Because of this difference, asm_options in the default spec (gcc -dumpspecs) is missing the switches (specifically, %{I*}) that make the compiler pass its include directory arguments to the assembler.

    static const char *asm_options =
    "%{-target-help:%:print-asm-header()} "
    #if HAVE_GNU_AS
    /* If GNU AS is used, then convert -w (no warnings), -I, and -v
       to the assembler equivalents.  */
    "%{v} %{w:-W} %{I*} "
    #endif

    I think that gcc passes the include directory argument to the assembler only if gcc was configured with the knowledge of a default assembler.

    There might be a way to workaround this by using specs files, but -Wa,-Iinc seems to be the easiest, safest solution.

Children