gas-preprocessor

The gas-preprocessor is available on git. It doesn't have proper release yet, please always use the master.

Purpose

The gas-preprocessor converts on the fly the assembly syntax supported by GNU binutils to the syntax supported by other assemblers.

The initial target had been arm and the ancient syntax supported by binutils-apple, now additional targets such as clang internal assembly are supported.

Invocation

For use in Libav is enough to have the gas-preprocessor.pl available in the PATH and the configure will take care of all the details.

For stand alone usage you normally pass the assembler path

# print the assembler version
gas-preprocessor.pl clang -v
# directly feed a supported filetype
gas-preprocessor.pl clang ${in} -o ${out}
# full use of the advanced options
gas-preprocessor.pl -arch aarch64 -as-type clang -- clang -arch arm64 

Please refer to the -help command for advanced usage.

Options for this program needs to be separated with ' -- ' from the assembler
command. Following options are currently supported:

    -help         - this usage text
    -arch         - target architecture
    -as-type      - one value out of {{,apple-}{gas,clang},armasm}
    -fix-unreq
    -no-fix-unreq
    -force-thumb  - assemble as thumb regardless of the input source
                    (note, this is incomplete and only works for sources
                    it explicitly was tested with)