Open samasri opened 6 years ago
In order to run OMRChecker, I will need to reproduce the configurations used to run OMRChecker. In linter.mk, we can see that OMRChecker depends on the following variables to run:
CXX_CMD
: This is probably clang++-5.0
in OMRStatisticsLINTER_FLAGS
: Defined in the same fileLINTER_EXTRA
: Defined in the same fileCXX_INCLUDES
: Depends on the following variable:
PRODUCT_INCLUDES
: Defined in build/toolcfg/gnu/common.mk. Here we are assuming that the tool used (defined in TOOLCHAIN
variable) is GNU, which stands aligned with our assumption that the OS used is linuxCXX_DEFINES
: Depends on the following variables:
CX_DEFINES
: It is defined inside nested common.mk files. The right common.mk depends on the tool we are using (TOOLCHAIN
). When using GNU, it would depend on the following:
PRODUCT_DEFINES
: Depends on the following variables:
ASSUMES
: Based on this makefile, I am assuming this should be 1.PUBLIC_BUILD
: I could not find any place where this variable is defined, so I am assuming this should be 0.HOST_DEFINES
and TARGET_DEFINES
: Defined in makefiles inside the build/toocfg/host and build/toocfg/target directories respectively. These are automatically included from the main build/tooclfg/common.mk based on the following variables:
HOST_ARCH
and TARGET_ARCH
: Can be x
, p
, z
, or arm
HOST_BITS
and TARGET_BITS
: Can be 32
or 64
OS
: It represents the operating system used, for our purpose I think linux
makes sense (can also be win
, aix
, zos
, ztpf
)HOST_BITS
and HOST_ARCH
: already explainedBUILD_CONFIG
: Can be either debug
or prod
CX_DEFINES_EXTRA
: Never defined in the projectCXX_DEFINES_EXTRA
: Never defined in the projectHence, in order to get the right variables for the configuration we need to do the following:
CXX_CMD=clang++-3.8
LINTER_FLAGS=-std=c++0x -w -fsyntax-only -ferror-limit=0
LINTER_EXTRA=-Xclang -load -Xclang $(JIT_SRCBASE)/omr/tools/compiler/OMRStatistics/OMRStatistics.so -Xclang -add-plugin -Xclang omr-statistics
TOOLCHAIN=gnu
ASSUMES=1
PUBLIC_BUILD=0
OS=linux
BUILD_CONFIG=prod
HOST_ARCH
TARGET_ARCH
HOST_BITS=64
(I am gonna assume this for now)TARGET_BITS=64
(I am gonna assume this for now)After running OMRStatistics (almost) successfully on all architectures, I got 22 errors in total, documented here
When setting TARGET_BITS=32
on i386, the number of errors decreased to 19. Also, now the CodeGenerator hierarchy is processed successfully by OMRStatistics on all architectures. So I can now virtualize the CodeGenerator chain and submit my PR.
However, I still need to fix the rest of the errors to have OMRStatistics fully working on OpenJ9
git checkout f66506e7a528340d176260c3af47c63cf66979ec
inside openj9-openjdk-jdk9/openj9 and try again