Hi Niklas,
Never try it in yocto but, I guess you can add the -S (capital S) to the GCC flags in the do_compile section of the recipe of your source file. it will emit the assembly code to a .s file.
also you can add it to the CC flasgs on bitbake.conf
Hope this helps