Module: gas-preprocessor Branch: master Commit: 6bbbfbed4b392a6ecf5cb3835d80d268855afdf2
Author: Martin Storsjo <[email protected]> Committer: Martin Storsjo <[email protected]> Date: Sat Aug 9 22:20:00 2014 +0300 Undefine platform specific predefined defines when preprocessing C source for armasm 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. But there's not much need to support that use case, since GNU as can be used just fine along with armcc. --- gas-preprocessor.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index c3eb09a..3020401 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 _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
