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?
Assembler output?
Re: Assembler output?
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.
If you're using CMake, you'll need to add the assembly source file to your component's COMPONENT_SRCS.
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: Assembler output?
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
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)
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"
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