今天在调试汇编的时候,使用.s作为文件后缀,发现预处理没有生效。修改成.S就可以了。
gcc可以使用
-x language
指定输入的语言
c c-header cpp-output c++ c++-header c++-cpp-output objective-c objective-c-header objective-c-cpp-output objective-c++ objective-c++-header objective-c++-cpp-output assembler assembler-with-cpp ada d f77 f77-cpp-input f95 f95-cpp-input go brig
参考
https://stackoverflow.com/questions/27993384/how-do-i-enable-the-preprocessor-in-gcc-assembly
https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html