-
Notifications
You must be signed in to change notification settings - Fork 720
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
base: master
Are you sure you want to change the base?
Adding libs for OpenXL #20045
Conversation
Two high-level comments:
|
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. |
did I miss your changes to makefiles, to set CC and CXX? at least, i haven't seen them yet. |
I tried a build with the OMR (eclipse/omr#7447) and these OpenJ9 changes. It got this far:
|
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. |
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"> |
There was a problem hiding this comment.
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.
e426cf2
to
121bd27
Compare
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") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
if(OMR_OS_AIX AND CMAKE_C_COMPILER_IS_OPENXL) | ||
list(APPEND J9_SHAREDFLAGS -m64) | ||
else() | ||
list(APPEND J9_SHAREDFLAGS -q64) | ||
endif() |
There was a problem hiding this comment.
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).
#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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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*/ |
There was a problem hiding this comment.
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. */
Tried a new build https://hyc-runtimes-jenkins.swg-devops.com/job/Build_JDK23_ppc64_aix_Personal/52
|
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>
No description provided.