This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GCC startup code assembly file extension should be .sx instead of .s

In the nRF51 SDK startup code, in the folder toolchain\gcc, there is a file called gcc_startup_nrf51.s. I think this file should be called gcc_startup_nrf51.sx instead, as it contains macro definitions and needs the preprocessor running over it. According to ARM gcc, only .sx files are processed by the preprocessor (we had some issues with the .s ending and GCC ARM v4.8, so we had to rename it).

Did anyone else have the same problem? Or did anyone get it running with the .s file extension?

Parents
  • Hi, I haven't had any problems with using the .s extension. Although it has been awhile since I've used version 4.8. Using 4.9 I'm able to use the __STACK_SIZE,etc defines by adding them to asmflags in the makefile.

  • The issue is still present in the GCC v4.9, I also confirmed it with SDK11 on nRF52. It is definitely related to the file name, as you can see in the GCC documentation: link GCC Options. Please search for '.sx' in this document. Also see the -x option some lines below.

    .s files contain assembler code (usually generated from .c files) that do not need the C preprocessor to run over it again. If assembler code contains C preprocessor directives, the file shold be named .sx or .S (upper case). Alternatively, the GCC option '-x assembler-with-cpp' may be used to explicitly instruct GCC to run the C preprocessor on the .s file, but that doesn't comply with standard GCC file naming schemes.

    I really think this is a naming issue, and that the current SDK doesn't comply with the common C / Assembly file naming standards.

Reply
  • The issue is still present in the GCC v4.9, I also confirmed it with SDK11 on nRF52. It is definitely related to the file name, as you can see in the GCC documentation: link GCC Options. Please search for '.sx' in this document. Also see the -x option some lines below.

    .s files contain assembler code (usually generated from .c files) that do not need the C preprocessor to run over it again. If assembler code contains C preprocessor directives, the file shold be named .sx or .S (upper case). Alternatively, the GCC option '-x assembler-with-cpp' may be used to explicitly instruct GCC to run the C preprocessor on the .s file, but that doesn't comply with standard GCC file naming schemes.

    I really think this is a naming issue, and that the current SDK doesn't comply with the common C / Assembly file naming standards.

Children
No Data
Related