Updated gas-preprocessor to handle clang’s issue related to -g option

clang included in Xcode 4.3.x (LLVM 3.1) has an odd issue when it is used with gas-preprocessor.

As you may know, gas-preprocessor adds “-S” to compiler’s command line to generate assembler source, does some preprocessing on it, then invokes compiler again. The compiler then invokes assembler to create final objective code. Here, compiler is clang and assembler is apple as.

If  a “-g” is specified in clang’s command line, clang will generate dwarf-2 debug information directives into assembler source. When clang gets invoked again, it will also take “-g” into apple as’s command line options. Unfortunately, as declines those debug information directives, including .file and .loc, if it is iovoked with “-g”.

So, I have to add a hack into gas-preprocessor. If -g is in command line, eliminate it in 2nd compiler invocation.

See latest commit in https://github.com/hollylee/gas-preprocessor


Leave a Reply

Your email address will not be published. Required fields are marked *