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.
---
 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
-- 
1.8.1.2

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

Reply via email to