Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this updates the Native Client definitions.
To understand it better, here is some generic knowledge about the Native Client ecosystem.
The various toolchains produced different kind of binaries:
nexe
: architecture-dependent executable.pexe
: architecture-independent executable, meant to be translated tonexe
before execution using a special tool.A PNaCl compiler produces
pexe
executable, while an NaCl compiler producesnexe
executable.While the
pexe
format can be seen as a kind of platform, in practice there is no runner for it: apexe
should be translated tonexe
to be executed by the NaCl loader.There has been at least 5 Native Client compilers:
nexe
;x86_64-nacl-gcc
.pexe
;pexe
;pnacl-clang
.nexe
;x86_64-nacl-clang
.nexe
.x86_64-nacl-clang
.The PNaCl Clang compiler and the NaCl Clang compiler share the same repository and are both part of the PNaCl Clang project, I listed them separately because the different binaries produce different defines.
Here is some knowledge I gathered:
Among all the compilers I tested (all but PNaCl GCC), only PNaCl Clang sets the
__pnacl__
definition.All the compilers I tested (all but PNaCl GCC) set the
__native_client__
definition, so this is a better one to detect Native Client than__pnacl__
.I have found some
__native_client__
and some__pnacl__
usage in some header files in the PNaCl GCC source directory. So maybe the__pnacl__
is usable to detect a pexe compiler.According to this comment, 10 years ago PNaCl Clang was built on Ubuntu 12.04 and developed on Ubuntu 14.04, so I guess the 13 years old PNaCl GCC requires an environment as old as that to be built, if not older. It's very unlikely the PNaCl GCC can be faced in the wild.
In real life, finding the
__pnacl__
definition means the PNaCl Clang compiler is used.The Saigo compilers sets the
__saigo__
definition.Among the users of Native Client today we can list:
Summary:
__native_client__
__native_client__
(unverified)__pnacl__
(unverified)__native_client__
__pnacl__
__native_client__
__native_client__
__saigo__
While it is true facing a
__pnacl__
definition means this a Native Client architecture being targeted, not all NaCl compilers set it, it is better to use__native_client__
instead.So…
nexe
are defining__native_client__
.