ro added a comment.

In D86621#2247791 <https://reviews.llvm.org/D86621#2247791>, @jrtc27 wrote:

> GCC on Linux defines `__sparc_v9__` even with `-m32`. I don't know what 
> Solaris does but please don't break other operating systems just because 
> Solaris has broken headers that conflate the CPU and the ABI.

I'd have sworn that I checked gcc on Linux/sparc64: must have been dreaming.

I quoted the relevant snippet of the Studio `cc(1)` man page which shows that 
Solaris compilers predefine `__sparcv8` for `-m32` and `__sparcv9` for `-m64`.  
I'd argue that the creators of the CPU, the OS, and the initial compiler can 
decide to do so as they please (after all, AFAICT that's not part of any ABI 
and I couldn't find an API document that mentioned those), nothing broken or 
conflated here.

I've now looked at the GCC sources and found:

- FreeBSD/sparc64 is 64-bit-only, no 32-bit support in sight
- while the NetBSD/sparc64 port still includes bi-arch support, it is disabled 
because the don't ship a 32-bit environment and even if they did, they only 
define `__sparc_v9__` etc. for `-m64`.
- OpenBSD/sparc64 again is 64-bit only

I'll see how best to reconcile those.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86621

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to