Assembler output?

The_YongGrand
Posts: 19
Joined: Fri Nov 04, 2016 1:14 am

Assembler output?

Postby The_YongGrand » Sat Mar 02, 2019 3:40 am

I'm trying to optimize a piece of code here, and trying all methods to add the "-S" into the project makefile, but the *.S files aren't being produced.

Is there an option where I can enable this?

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: Assembler output?

Postby ESP_Dazz » Mon Mar 04, 2019 1:50 pm

If you're using Make, as Makefile will compile all *.c *.cpp *.cc *.S files in a component. Call make list-components to check if the component your assembly source file is located in is actually being built.

If you're using CMake, you'll need to add the assembly source file to your component's COMPONENT_SRCS.

ESP_cermak
Posts: 69
Joined: Thu Nov 01, 2018 8:32 am

Re: Assembler output?

Postby ESP_cermak » Mon Mar 04, 2019 9:15 pm

Let me just add a quick note about "-S" flag if one wanted the compiler to produce also assembly during compilation:

One of the method is to print out compiler commands using `make -n` and grepping out the exact module you want the assembly for.
Copy and paste this line to the command line and add argument '-S' (also optionally remove output specifier '-o module.o' at the end of the line otherwise your assembly file would be called module.o)
Also it's possible to do

Code: Select all

export EXTRA_CFLAGS="-S"
which would add the -S option to all comilations, but the build system would generate assembly instead of objects
and would finally break trying to link the assembly code (but you can find assembly files when looking into *.o files)

Who is online

Users browsing this forum: No registered users and 222 guests