Scripts: verify compiler definitions of native and managed (#4675)
authorMyungJoo Ham <myungjoo.ham@gmail.com>
Thu, 23 Jun 2016 11:13:46 +0000 (20:13 +0900)
committerJan Vorlicek <janvorli@microsoft.com>
Thu, 23 Jun 2016 11:13:46 +0000 (13:13 +0200)
commit9ae38ddd84ac77e52f76a04c1c87a17742ba06da
treef198e82e2e50d3e664a3f82b97edcf35535bd87e
parent70ac3533bfd4d4ebce6d834c3656b2d6c5bae941
Scripts: verify compiler definitions of native and managed (#4675)

* Scripts: find out compiler definitions of CMake

In order to find mismatch between native and managed,
we need to know the list of definitions of native.

The copmiler definitions are stored at cmake.definitions

This addresses the complaints of #4674

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
* Scripts: add check-definitions.py

scripts/check-definitions.py checks the consistency between
the native-build (CMake) compiler definitions and
the managed-build (MSBuild/mscorlib) compiler definitions
at build-time and prints out potentially dangerous
inconsistencies.

In order to get the proper results, managed build should
be executed after the native build (build.sh will do so
if no options such as skipnative or skipmanaged are given.)

Fix #4674

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
* Scripts: allow check-definitions py to ignore the harmless

The third argument of check-definitions.py specifies harmless keywords
to be suppressed from emitting warning messages.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
* Scripts: add ignored cdefine keywords for warning

As an example of how to declare compiler definition keywords
that are harmless to be inconsistent between the native and the
managed, we have added FEATURE_IMPLICIT_TLS and FEATURE_HIJACK.

Developers may add more keywords in System.Private.CoreLib.csproj
if the keywords are verified to be harmless; i.e., although
the keywords exist in both cmake and clr.coreclr.props,
the keywords are NEVER used in either side of the sources
or the keywords only happen to have the same name while they
denote the completely different semantics and may be disjoint.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
CMakeLists.txt
definitionsconsistencycheck.cmake [new file with mode: 0644]
src/mscorlib/System.Private.CoreLib.csproj
src/scripts/check-definitions.py [new file with mode: 0644]