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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

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#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.

Comment on lines +27 to +31
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-G,-brtl,-bernotok,-bnoentry,-bnolibpath -latomic -lperfstat -liconv")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl -latomic -lperfstat -liconv")
else()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-G,-brtl,-bernotok,-bnoentry,-bnolibpath")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-brtl")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please indent with tabs like other cmake files.

@@ -35,7 +35,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")

# Raise an error if a shared library has any unresolved symbols.
# This flag isn't supported on OSX, but it has this behaviour by default
Copy link
Contributor

Choose a reason for hiding this comment

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

Please expand the comment to match the change (including proper punctuation).

Comment on lines +287 to +291
if(OMR_OS_AIX AND CMAKE_C_COMPILER_IS_OPENXL)
list(APPEND J9_SHAREDFLAGS -m64)
else()
list(APPEND J9_SHAREDFLAGS -q64)
endif()
Copy link
Contributor

Choose a reason for hiding this comment

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

The AIX part of this test is redundant (see line 278).

Comment on lines +477 to +481
#if defined(__open_xl__)
TR_VMFieldsInfo **fieldsInfoByIndex = (TR_VMFieldsInfo**)__builtin_alloca(endIndex * sizeof(TR_VMFieldsInfo*));
#else
TR_VMFieldsInfo **fieldsInfoByIndex = (TR_VMFieldsInfo**)alloca(endIndex * sizeof(TR_VMFieldsInfo*));
#endif
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 indent preprocessor directives, but do add comments on #else and #endif:

#if defined(__open_xl__)
            TR_VMFieldsInfo **fieldsInfoByIndex = (TR_VMFieldsInfo**)__builtin_alloca(endIndex * sizeof(TR_VMFieldsInfo*));
#else /* defined(__open_xl__) */
            TR_VMFieldsInfo **fieldsInfoByIndex = (TR_VMFieldsInfo**)alloca(endIndex * sizeof(TR_VMFieldsInfo*));
#endif /* defined(__open_xl__) */

This pattern appears often enough that we might instead want to put this in a common header file:

#if defined(__open_xl__)
#define alloca(size) __builtin_alloca(size)
#endif /* defined(__open_xl__) */

@@ -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.

Comment on lines +113 to +118
ifneq ($(OMR_ENV_OPENXL),1)
CFLAGS += -qlanglvl=extended -qarch=ppc -qalias=noansi -qxflag=LTOL:LTOL0 -qsuppress=1506-1108 -qstackprotect
else
#openxl options
CFLAGS += -std=c89 -qarch=ppc -fno-strict-aliasing -fstack-protector
endif
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 this to avoid the negation:

ifeq ($(OMR_ENV_OPENXL),1)
  # openxl options
  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

Same comment near lines 128 & 139.

@@ -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.

@@ -1579,9 +1579,10 @@ typedef struct J9ExceptionHandler {
U_32 exceptionClassIndex;
} J9ExceptionHandler;

#if defined(__xlC__) || defined(J9ZOS390) /* Covers: Z/OS, AIX, Linux PPC*/
//JACKIE: not sure where defined(__open_xl__) condition should go
Copy link
Contributor

Choose a reason for hiding this comment

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

C++ style comments cannot be used in a C header file (not that this one should stay anyway).

#pragma pack(1)
#elif defined(__ibmxl__) || defined(__GNUC__) || defined(_MSC_VER) /* Covers: Linux PPC LE, Windows, Linux x86 */
#elif defined(__ibmxl__) || defined(__open_xl__) || defined(__GNUC__) || defined(_MSC_VER) /* Covers: Linux PPC LE, Windows, Linux x86 */
Copy link
Contributor

Choose a reason for hiding this comment

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

I think defined(__open_xl__) belongs on line 1583 which make this one dead.

@@ -1579,9 +1579,10 @@ typedef struct J9ExceptionHandler {
U_32 exceptionClassIndex;
} J9ExceptionHandler;

#if defined(__xlC__) || defined(J9ZOS390) /* Covers: Z/OS, AIX, Linux PPC*/
//JACKIE: not sure where defined(__open_xl__) condition should go
#if defined(__xlC__) || defined(J9ZOS390) || defined(__open_xl__) /* Covers: Z/OS, AIX, Linux PPC*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Please finish each sentence with a period, spell z/OS correctly and sort platforms:

#if defined(__xlC__) || defined(J9ZOS390) || defined(__open_xl__) /* Covers: AIX, Linux PPC and z/OS. */

@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 and others added 6 commits October 3, 2024 14:57
This commit adds necessary libraries nedded by
linker commands for openxl compiler on AIX architechture.

Signed-off-by: Ishita Ray <ishita.ray@ibm.com>
Signed-off-by: midronij <jackie.midroni@ibm.com>
Signed-off-by: midronij <jackie.midroni@ibm.com>
Signed-off-by: midronij <jackie.midroni@ibm.com>
Signed-off-by: Ishita Ray <ishita.ray@ibm.com>
Add CMAKE_C_COMPILER_IS_OPENXL macro to add the compiler flags
needed by openXL17

Signed-off-by: Ishita Ray <ishita.ray@ibm.com>
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.

5 participants