[PATCH] D98574: [Sparc] Define the same macros for -mcpu=v9 as GCC on Linux and the BSDs

John Paul Adrian Glaubitz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 22 09:22:26 PDT 2021


glaubitz added a comment.

For reference, here is what GCC defines on Linux with regards to SPARC:

  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m32 - |grep arch
  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m32 - |grep LP
  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m32 - |grep v9
  #define __sparc_v9__ 1
  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m64 - |grep arch
  #define __arch64__ 1
  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m64 - |grep LP
  #define __LP64__ 1
  #define _LP64 1
  glaubitz at gcc202:~$ echo | gcc -E -dM -mcpu=v9 -m64 - |grep v9
  #define __sparc_v9__ 1
  glaubitz at gcc202:~$

And here is what it defines on OpenBSD:

  openbsd# echo | gcc -E -dM -mcpu=v9 -m64 - |grep arch 
  #define __arch64__ 1
  openbsd# echo | gcc -E -dM -mcpu=v9 -m64 - |grep LP   
  #define __LP64__ 1
  #define _LP64 1
  openbsd# echo | gcc -E -dM -mcpu=v9 -m64 - |grep sparc
  #define sparc 1
  #define __sparc__ 1
  #define __sparc 1
  #define __sparc64__ 1
  #define __sparcv9__ 1
  #define __sparc_v9__ 1
  openbsd#



  -m32``` is not supported on OpenBSD at all:

openbsd# echo | gcc -E -dM -m32 -            
:0: error: -m32 is not supported by this configuration
openbsd#

  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98574/new/

https://reviews.llvm.org/D98574



More information about the cfe-commits mailing list