On 2014-08-09 22:48:48 +0300, Martin Storsjö wrote:
> Since plain 'cpp' is used for preprocessing, it inherits whatever
> platform specific predefined defines.
> 
> Previously this was set on the libav configure line, such as
> --as='gas-preprocessor.pl -as-type armasm -- armasm -nologo -U__ELF__ -ignore 
> 4509',
> but if gas-preprocessor is to be enabled automatically, one shouldn't
> need to pass -U__ELF__ via the --as flag. Also, if the option
> is passed there, armasm detection fails, since "armasm -U__ELF__"
> fails, since -U isn't a valid armasm option (gas-preprocessor
> filters it out and only passes it to cpp).
> 
> This does break the currently unsupported setup of using the
> original ARM armasm (contrary to the MS version) for building
> assembly for linux though, where the __ELF__ define should be
> kept. For that, we'd might need to add a ms-armasm alternative
> to the -as-type option.

I don't think we should care about supporting armasm. GNU as is easily 
available on Linux and should be used when using armcc on linux. Also 
there is at least some hope that it wouldn't be necessary for the llvm 
based ARM compiler 6.

So while this is not exactly pretty I think it's acceptable for 
gas-preprocessor.pl.

> ---
>  gas-preprocessor.pl | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index e60de8c..34e4983 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -97,6 +97,8 @@ if (grep /\.c$/, @gcc_cmd) {
>  if ($as_type eq "armasm") {
>  
>      $preprocess_c_cmd[0] = "cpp";
> +    push(@preprocess_c_cmd, "-U__ELF__");
> +    push(@preprocess_c_cmd, "-U__MACH__");
>  
>      @preprocess_c_cmd = grep ! /^-nologo$/, @preprocess_c_cmd;
>      # Remove -ignore XX parameter pairs from preprocess_c_cmd

ok

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to