[cfe-commits] [PATCH] Properly factor Native Client defines to support NaCl as an OS with x86/ARM architecture

Derek Schuff dschuff at google.com
Thu Sep 27 11:24:12 PDT 2012


Hi,
This patch refactors the NaCl/PNaCl support in clang such that the
defines which belong to the NaCl OS (e.g. __native_client__) come from
an OSTargetInfo and only those which are for Portable NaCl ( __pnacl__
and __le32__) come from the PNaClTargetInfo.
It thus allows the compiler to support e.g. x86_64-nacl and arm-nacl
targets (as well as le32-nacl). It would be a very small change except
that the x86_64 nacl ABI is X32-like with 32-bit pointers, and does
not use 80-bit float types. So, some small changes to e.g.
X86_64ABIInfo.

This patch is split into 2 parts. The first is a change to
X86_64ABIInfo to support x86-64 targets with 32 bit pointers. The
approach is similar to the change proposed by the X32 team[1]
(although it is slightly more general in its naming scheme and does
not have X32-specific bits).

The second change actually makes the NaCl specific changes. There is
one small intrusion into X86_64ABIInfo::classify to disable the 80-bit
FP types (suggestions on that are welcome)

Patches are attached or may be viewed at
http://codereview.chromium.org/10982073 and
http://codereview.chromium.org/10986071

Please take a look, thanks.
-Derek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 32bit-ptr.diff
Type: application/octet-stream
Size: 5096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120927/76be3ea8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nacl-abi.diff
Type: application/octet-stream
Size: 18351 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120927/76be3ea8/attachment-0001.obj>


More information about the cfe-commits mailing list