[1/8] Pass -undef to cpp instead of undefining __ELF__ and __MACH__

Message ID 1508013322-19428-1-git-send-email-martin@martin.st
State Committed
Headers show

Commit Message

Martin Storsjö Oct. 14, 2017, 8:35 p.m.
---
 gas-preprocessor.pl | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Janne Grunau Oct. 18, 2017, 6:10 a.m. | #1
On 2017-10-14 23:35:15 +0300, Martin Storsjö wrote:
> ---
>  gas-preprocessor.pl | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index afdfc9e..6aae65d 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -97,8 +97,7 @@ 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__");
> +    push(@preprocess_c_cmd, "-undef");
>  
>      @preprocess_c_cmd = grep ! /^-nologo$/, @preprocess_c_cmd;
>      # Remove -ignore XX parameter pairs from preprocess_c_cmd

ok

Janne

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index afdfc9e..6aae65d 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -97,8 +97,7 @@  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__");
+    push(@preprocess_c_cmd, "-undef");
 
     @preprocess_c_cmd = grep ! /^-nologo$/, @preprocess_c_cmd;
     # Remove -ignore XX parameter pairs from preprocess_c_cmd