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

Adding libs for OpenXL #20045

Closed
wants to merge 6 commits into from
Closed

Conversation

ishitaR88
Copy link
Contributor

No description provided.

@zl-wang
Copy link
Contributor

zl-wang commented Aug 26, 2024

Two high-level comments:

  1. provide a proper description of what you are trying to do in this PR;
  2. you cannot modify the code as you did, since it breaks the builds using xlC compiler. keep in mind that the codebase feeds into java8/11/17/21/newer builds. we only intended to switch to OpenXL for 'newer' builds like java23. if you change the code as you did in this PR, java8-21 cannot be built anymore (with xlC). you have to change the code (and makefile etc) conditionally to be compatible with both compilers.

@zl-wang
Copy link
Contributor

zl-wang commented Sep 11, 2024

please indicate if it cleared the criteria that, with these changes in place, we can build with both xlC/xlclang and OpenXL (also staying or better the performance). that is when it is ready to be reviewed.

@zl-wang
Copy link
Contributor

zl-wang commented Sep 19, 2024

did I miss your changes to makefiles, to set CC and CXX? at least, i haven't seen them yet.

@pshipton
Copy link
Member

pshipton commented Sep 20, 2024

I tried a build with the OMR (eclipse-omr/omr#7447) and these OpenJ9 changes.
https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK23_ppc64_aix_Personal/37
I added the compiler path (only works on paix822) and defined CC and CXX https://github.ibm.com/Peter-Shipton/tooling/tree/openxl
I had to fix (hack) openssl.gmk as well as revert the change to use xlc https://github.com/pshipton/openj9-openjdk-jdk23/tree/openxl

It got this far:

16:49:15  [ 41%] Running preprocessing p/runtime/ebb.spp to create /home/jenkins/workspace/Build_JDK23_ppc64_aix_Personal/build/aix-ppc64-server-release/vm/runtime/compiler/p/runtime/ebb.ipp
16:49:15  error: invalid value 'extc99' in '-std=extc99'

@pshipton
Copy link
Member

did I miss your changes to makefiles, to set CC and CXX?

defaults.yml should be updated similarly to https://github.ibm.com/Peter-Shipton/tooling/commit/eebd2986b8a3b

It won't work on any OpenJ9 open machine until we update them to have the 17.1.2 compiler.

@ishitaR88
Copy link
Contributor Author

I tried a build with the OMR (eclipse/omr#7447) and these OpenJ9 changes. https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK23_ppc64_aix_Personal/37 I added the compiler path (only works on paix822) and defined CC and CXX https://github.ibm.com/Peter-Shipton/tooling/tree/openxl I had to fix (hack) openssl.gmk as well as revert the change to use xlc https://github.com/pshipton/openj9-openjdk-jdk23/tree/openxl

It got this far:

16:49:15  [ 41%] Running preprocessing p/runtime/ebb.spp to create /home/jenkins/workspace/Build_JDK23_ppc64_aix_Personal/build/aix-ppc64-server-release/vm/runtime/compiler/p/runtime/ebb.ipp
16:49:15  error: invalid value 'extc99' in '-std=extc99'

Yes there was an issue. I have fixed that.will push the modification shortly.

@@ -34,7 +34,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<makefilestub data="CFLAGS += -Wc,DLL,EXPORTALL">
<include-if condition="spec.zos_390.*"/>
</makefilestub>
<makefilestub data="UMA_CC_MODE += -qpic -brtl -bexpall">
<makefilestub data="UMA_CC_MODE += -fpic -brtl -bexpall">
Copy link
Member

Choose a reason for hiding this comment

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

This can't be changed unconditionally.
FYI module.xml (UMA) is mostly used for IBM Java 8 builds, but it's still (was) possible use UMA to build OpenJ9 versions, It's something we should check, if UMA is still working for Java 23 with OpenXL. By default we use cmake, but UMA can be used if adding options for debugging purposes.

@ishitaR88 ishitaR88 force-pushed the openxl branch 3 times, most recently from e426cf2 to 121bd27 Compare September 26, 2024 20:17
runtime/cmake/platform/os/aix.cmake Show resolved Hide resolved
runtime/cmake/platform/toolcfg/gnu.cmake Outdated Show resolved Hide resolved
runtime/compiler/CMakeLists.txt Outdated Show resolved Hide resolved
runtime/compiler/env/J9KnownObjectTable.cpp Outdated Show resolved Hide resolved
@@ -64,7 +64,7 @@
#endif /* defined(J9VM_OPT_JITSERVER) */

// TODO: move this someplace common for RuntimeAssumptions.cpp and here
#if defined(__IBMCPP__) && !defined(AIXPPC) && !defined(LINUXPPC)
#if (defined(__IBMCPP__) || defined(__open_xl__) && defined(__cplusplus)) && !defined(AIXPPC) && !defined(LINUXPPC)
Copy link
Contributor

Choose a reason for hiding this comment

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

The subexpression defined(__cplusplus) seems redundant in this C++ source file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it in new commit

runtime/makelib/targets.mk.aix.inc.ftl Outdated Show resolved Hide resolved
@@ -178,7 +203,9 @@ $(patsubst %.s,%.o,$(filter %.s,$(UMA_FILES_TO_PREPROCESS))) : %$(UMA_DOT_O) : %

ifdef UMA_TREAT_WARNINGS_AS_ERRORS
ifndef UMA_SUPPRESS_WARNINGS_AS_ERRORS
CFLAGS += -qhalt=w
CXXFLAGS += -qhalt=w
ifneq ($(OMR_ENV_OPENXL),1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please invert and add equivalent options for OpenXL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inverted

runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
runtime/oti/j9nonbuilder.h Outdated Show resolved Hide resolved
@ishitaR88 ishitaR88 changed the title Adding libs for OpenXL WIP:Adding libs for OpenXL Oct 3, 2024
@pshipton
Copy link
Member

pshipton commented Oct 3, 2024

Tried a new build https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK23_ppc64_aix_Personal/52
There are a number of errors like

14:27:22  /home/jenkins/workspace/Build_JDK23_ppc64_aix_Personal/openj9/runtime/compiler/optimizer/InterpreterEmulator.cpp:1594:105: error: too many arguments to function call, expected 0, have 1
14:27:22   1594 |                                                       (int32_t) _currentCallMethod->virtualCallSelector(cpIndex), cpIndex, _currentCallMethod,
14:27:22        |                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~

@keithc-ca keithc-ca marked this pull request as draft October 3, 2024 18:34
@keithc-ca keithc-ca changed the title WIP:Adding libs for OpenXL Adding libs for OpenXL Oct 3, 2024
@ishitaR88 ishitaR88 force-pushed the openxl branch 3 times, most recently from 0a882d4 to 60ce5cd Compare October 17, 2024 18:44
@@ -0,0 +1,3 @@
#if defined(__open_xl__)
Copy link
Contributor

Choose a reason for hiding this comment

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

This file needs a copyright notice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

Copy link
Contributor

Choose a reason for hiding this comment

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

The current year should be used in the copyright notice for new files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed year to 2024

@ishitaR88 ishitaR88 force-pushed the openxl branch 2 times, most recently from 9ddb7f3 to 795bb55 Compare October 17, 2024 19:16
@ishitaR88 ishitaR88 marked this pull request as ready for review October 18, 2024 14:23
@@ -28,7 +28,7 @@ extern "C" {
#endif


#if (defined(__IBMCPP__) || defined(__IBMC__) && !defined(MVS)) && !defined(J9ZOS390) && !defined(LINUXPPC64)
#if (defined(__IBMCPP__) || defined(__IBMC__) && !defined(MVS)) && !defined(J9ZOS390) && !defined(LINUXPPC64) || defined(__open_xl__)
Copy link
Contributor

@zl-wang zl-wang Oct 21, 2024

Choose a reason for hiding this comment

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

this looks weird, given the fact that && has higher precedence over ||. it seems dangerous or unreadable to mix up compiler macro (__open_xl__) with platform macro (J9ZOS390 and LINUXPPC64).

Copy link
Contributor

Choose a reason for hiding this comment

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

@r30shah this looks an existing problem as well re MVS. i think MVS is also a platform macro (i.e. not defined by the compiler. but defined to indicate the particular platform). and, I think it should be __MVS__ to begin with. if @r30shah agrees, we should fix this as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, it should be __MVS__ and with the fix Julian suggests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As the MVS issue is not introduced by the changes of this PR I will address this in future creating a new PR.

@@ -4399,7 +4399,7 @@ JVM_Available(jint descriptor, jlong* bytes)
return JNI_FALSE;
}

#if defined(WIN32) && !defined(__IBMC__)
#if defined(WIN32) && !defined(__IBMC__) && !(defined(__open_xl__) && !defined(__cplusplus))
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering why we need to do this to begin with. WIN32 definition already excludes the code from being picked up on AIX or zOS, what is the purpose of && with more other conditions?

@@ -96,7 +96,7 @@ extern "C" {
# endif
# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
# ifndef __PPC64__
# if defined (__IBMC__) || defined (__IBMCPP__)
# if defined (__IBMC__) || defined (__IBMCPP__) || defined(__open_xl__)
Copy link
Contributor

Choose a reason for hiding this comment

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

for the above dozen ffi.h files on non-AIX platforms, do we really need to change this line of code, especially since it is under# ifdef _AIX to begin with. in other words, how changing or not-changing this code affect the builds on non-AIX platforms?

CFLAGS += -std=c89 -qarch=ppc -fno-strict-aliasing -fstack-protector
else
CFLAGS += -qlanglvl=extended -qarch=ppc -qalias=noansi -qxflag=LTOL:LTOL0 -qsuppress=1506-1108 -qstackprotect
endif
CFLAGS += -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE -DRS6000 -DAIXPPC -D_LARGE_FILES
Copy link
Contributor

Choose a reason for hiding this comment

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

take notice maybe: we need to revisit this flag setting in the future ... -qarch=ppc is pretty out of date and conservative.

midronij and others added 5 commits October 24, 2024 12:10
Add CMAKE_C_COMPILER_IS_OPENXL macro to add the compiler flags
needed by openXL17

Signed-off-by: Ishita Ray <[email protected]>
@@ -4542,7 +4542,7 @@ JVM_Lseek(jint descriptor, jlong bytesToSeek, jint origin)
}

#if defined(WIN32)
#ifdef __IBMC__
#if defined(__IBMC__) || defined(__open_xl__) && !defined(__cplusplus)
Copy link
Contributor

Choose a reason for hiding this comment

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

This would require parentheses if __cplusplus needed to be tested, but it doesn't:

#if defined(__IBMC__) || defined(__open_xl__)

The condition should be repeated (in a comment) on #else and #endif lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

@@ -4642,7 +4642,7 @@ JVM_Open(const char* filename, jint flags, jint mode)
#define JVM_EEXIST -100

#ifdef WIN32
#ifdef __IBMC__
#if defined(__IBMC__) || defined(__open_xl__) && !defined(__cplusplus)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove redundant uses of defined(__cplusplus) throughout.

@@ -96,7 +96,7 @@ extern "C" {
# endif
# ifdef _AIX /* AIX 5.1 and earlier have LONGLONG_MAX */
# ifndef __PPC64__
# if defined (__IBMC__) || defined (__IBMCPP__)
# if defined (__IBMC__) || defined (__IBMCPP__) || defined(__open_xl__)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert changes such as this (where Open XL can't apply).

Comment on lines +132 to +135
else
# xlc++ options
CXXFLAGS += -q mbcs -qinfo=pro
else
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not legal (only one else is allowed).

Comment on lines +65 to +67
if(DEFINED OMR_OS_AIX AND DEFINED CMAKE_C_COMPILER_IS_OPENXL)
target_link_libraries(j9vrb
PRIVATE
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't do this. If libraries are need by any compiler, they should be used for all.

@keithc-ca
Copy link
Contributor

The description is incomplete. This isn't just about libraries - many command-line options are adjusted and source is changed.

Please follow the commit guidelines at https://github.com/eclipse-omr/omr/blob/master/CONTRIBUTING.md#commit-guidelines (the commit summary and the headline here should be "written in the imperative mood").

@midronij
Copy link
Contributor

midronij commented Nov 27, 2024

Ishita will be away for the foreseeable future, so I will be taking over this contribution here: #20690
@zl-wang could you please close this PR when you have a moment?

@zl-wang zl-wang closed this Nov 27, 2024
midronij added a commit to midronij/openj9 that referenced this pull request Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants