Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Tril and JitBuilder tests on AIX #4411

Merged
merged 12 commits into from
Nov 1, 2019

Conversation

aviansie-ben
Copy link
Contributor

Previously, the AIX CI builds were explicitly not compiling nor testing the JIT component, as it turns out that the JIT would not compile correctly under CMake on AIX. This PR fixes some issues with the JIT CMake builds and makes it possible to run both Tril and JitBuilder tests on AIX through use of some similar hacks to what are currently used on z/OS.

As part of this, I've enabled the Tril and JitBuilder tests on our CI AIX builds in this PR. I'm not 100% sure if this will work, as I don't know whether the AIX CI machines have lex and yacc set up, which are required to compile Tril. If they don't, this PR can wait until #4345 lands, which will remove the dependency on these tools altogether.

FYI @gita-omr @zl-wang

@fjeremic
Copy link
Contributor

fjeremic commented Oct 7, 2019

@genie-omr build all

@aviansie-ben
Copy link
Contributor Author

Looks like the build failure has something to do with the output from lex and/or yacc. That's a bit strange since this worked fine on the AIX machine I tested with, but maybe the CI machines have outdated versions of these tools?

Regardless, the best course of action is probably to just wait for the Tril parser rewrite to land so that we don't depend on lex or yacc any more. For now, I'll go ahead and mark this PR as WIP until that lands.

@aviansie-ben aviansie-ben changed the title Enable Tril and JitBuilder tests on AIX WIP: Enable Tril and JitBuilder tests on AIX Oct 8, 2019
For legacy reasons, the assembly files for Power are run through the C
preprocessor separately from when they are assembled. However, some
defines (namely platform ones such as TR_HOST_64BIT) were not being
correctly passed to the C preprocessor when running these assembly files
through it when building with CMake. This has now been corrected.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, OMRMonitor.hpp contained a workaround for an XLC issue with
private delete operators in it. However, this workaround was only used
when compiling on z/OS, meaning that attempting to build the OMR
compiler on AIX with XLC would fail with an error in OMRMonitor.cpp.
This workaround has now been enabled on AIX.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, there were a number of hacks to work around xlc issues in
Tril. However, these hacks were not being enabled on AIX since they were
explicitly guarded by checking J9ZOS390, as z/OS was previously the only
platform supported by Tril that used xlc. In order to allow Tril to
compile on AIX, these hacks have now been enabled on AIX.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
It turns out that AIX's implementation of the mmap function requires
that the file descriptor be set to -1 when using MAP_ANONYMOUS.
Previously, there were a couple places that were trying to use
MAP_ANONYMOUS without setting the file descriptor to -1, resulting in
them erroring out. This has been corrected and they should now work
correctly.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, a number of places in ShiftAndRotateTest were using PRId64
and PRIu64 directly in their format strings. However, this does not work
correctly on AIX. These have been corrected to use OMR_PRId64 and
OMR_PRIu64 instead.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
On most platforms, function pointers are simply pointers to the first
instruction in the function. However, on AIX and z/OS this is not true:
they are instead pointers to data structures that themselves contain
such a pointer. Support for calling Tril-compiled functions has now been
added on AIX by adding the ability for Tril::SimpleCompiler to create
such a function descriptor on AIX.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
A number of Tril tests are currently affected by eclipse-omr#3525, in which the
code generators spill sub-integer arguments to stack slots incorrectly.
While this works correctly on little endian machines, it does not work
on big endian machines. Previously, such tests were already being
skipped on Z, but this issue also affects the Power codegen when run on
a big-endian machine. In order to allow Tril tests to be run on AIX,
such tests are now skipped when run on Power BE.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Due to failing to link against libpthread, neither the tril_compiler nor
tril_dumper executables would link correctly on AIX. This has been
corrected by forcing the tril library itself to link against libpthread,
which in turn forces tril_compiler and tril_dumper to link against it as
well.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, JitBuilder did not work properly on AIX due to similar
problems to what Tril was previously facing. Since enabling Tril tests
also enables JitBuilder tests, it is necessary to ensure that JitBuilder
works at least minimally on AIX before Tril tests can be run in pull
request builds for AIX.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
The IlGenTest from Tril's internal tests is currently broken on AIX,
since it is not valid on AIX to use the return value of
compileMethodFromDetails as a function pointer. Until such a time as
this test is fixed, it has been temporarily disabled on AIX.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
The test compiler tests make the assumption that function pointers can
simply be called using the regular call opcodes in the IL. This is not
true on AIX, since function pointers do not actually point to the
address of the first instruction of the function on AIX. As a result,
the test compiler tests will always segfault when run on AIX. However,
since the test compiler tests are effectively deprecated and were never
previously run on AIX in the first place, this is not considered to be
something worth fixing. Thus, the test compiler tests will no longer be
run on AIX when using ctest.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
Previously, the AIX pull request and build CI jobs explicitly disabled
the JIT and all related components. However, recent work has now made it
possible to compile the OMR JIT and run JitBuilder and Tril tests on
AIX. Since this now works correctly, the JIT is no longer disabled in
the AIX CI jobs.

Signed-off-by: Ben Thomas <ben@benthomas.ca>
@aviansie-ben
Copy link
Contributor Author

Now that the new Tril parser has been merged, I've rebased this PR on top of that and this should hopefully work correctly now.

@aviansie-ben aviansie-ben changed the title WIP: Enable Tril and JitBuilder tests on AIX Enable Tril and JitBuilder tests on AIX Oct 28, 2019
@Leonardo2718
Copy link
Contributor

@genie-omr build all

AppVeyor build failed due to infrastructural issues so I restarted it.

Copy link
Contributor

@Leonardo2718 Leonardo2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Leonardo2718 Leonardo2718 self-assigned this Nov 1, 2019
@Leonardo2718 Leonardo2718 merged commit 3986037 into eclipse-omr:master Nov 1, 2019
@aviansie-ben aviansie-ben deleted the aix-build branch April 2, 2020 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants