-
Notifications
You must be signed in to change notification settings - Fork 415
Add Open XL toolchain and config changes for z/OS #7319
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
Conversation
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.
Thank you for supporting the project, and congratulations on your first contribution! A project committer will shortly review your contribution. In the mean time, if you haven't had a chance please skim over the contribution guidelines which all pull requests must adhere to. If the ECA pull request check fails, have a look at the instructions for signing the ECA in the legal considerations section.
If you run into any problems our community will be happy to assist you in any way we can. There are a number of recommended ways to interact with the community. We encourage you to ask questions, or drop by to say hello.
3f0b73e to
c39496d
Compare
3ccf780 to
e34c258
Compare
|
jenkins build all |
b9fb8d3 to
f7c2ff6
Compare
ff73ec3 to
c1479dd
Compare
|
jenkins build all |
babsingh
left a comment
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.
High level feedback:
- Squash the two commits into a single commit.
- Revise and improve comments.
- Remove dead code.
| -m64 | ||
| ) | ||
| else() | ||
| # -qarch should be there for 32 and 64 C/CXX flags but the C compiler is used for the assembler and it has trouble with some assembly files if it is specified |
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.
- Spread comments longer than 100 chars across multiple lines.
- End comments with a full stop / period.
| # -qarch should be there for 32 and 64 C/CXX flags but the C compiler is used for the assembler and it has trouble with some assembly files if it is specified | |
| # -qarch should be there for 32 and 64 C/CXX flags but the C compiler is used for | |
| # the assembler and it has trouble with some assembly files if it is specified. |
| #"\"-Wc,xplink\"" # link with xplink calling convention | ||
| #"\"-Wc,rostring\"" # place string literals in read only storage | ||
| #"\"-Wc,FLOAT(IEEE,FOLD,AFP)\"" # Use IEEE (instead of IBM Hex Format) style floats | ||
| #"\"-Wc,enum(4)\"" # Specifies how many bytes of storage enums occupy | ||
| #"\"-Wa,goff\"" # Assemble into GOFF object files | ||
| #"\"-Wc,NOANSIALIAS\"" # Do not generate ALIAS binder control statements |
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.
Remove dead code instead of commenting it.
| string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mgoff\"") | ||
| string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mSYSPARM(BIT64)\"") | ||
|
|
||
| # commenting out options progressively as they are not needed with Open XL, can remove in cleanup later. |
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.
Indentation is off, but this comment should go away since dead code will be removed.
| endfunction() | ||
| else() | ||
| function(_omr_toolchain_process_exports TARGET_NAME) | ||
| # we only need to do something if we are dealing with a shared library |
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.
First person should be avoided since it is informal and takes attention away from the key point.
|
@keithc-ca Can you please review this PR? |
| set(CMAKE_C_COMPILER_IS_OPENXL ON CACHE BOOL "ibm-clang is the C compiler") | ||
| set(_OMR_TOOLCONFIG "openxl") | ||
| else() | ||
| message(STATUS "NO MATCH") |
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.
Perhaps this should be fatal (like line 219)?
Actually, I think line 219 should use CMAKE_C_COMPILER_ID instead of CMAKE_CXX_COMPILER_ID.
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.
Hi Keith, I was verifying all my cleanup changes with different builds. After making the above-mentioned changes, while Open XL passes with no problems, XLC build gives a fatal error, because I guess it is entering this z/OS section, but not matching with the other xlclang compilers and in place of the "NO MATCH" its just throwing the error.
Perhaps it makes more sense to update this to
message(STATUS "NO XLClang match. Using xlc toolchain.")
with the above, both XLC / OpenXL are now compiling successfully.
Does this sound good?
|
|
||
| # Copyright (c) 2017, 2024 IBM Corp. and others | ||
| # | ||
| # This program and the accompanying materials are made available under | ||
| # the terms of the Eclipse Public License 2.0 which accompanies this | ||
| # distribution and is available at http://eclipse.org/legal/epl-2.0 | ||
| # or the Apache License, Version 2.0 which accompanies this distribution | ||
| # and is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
| # | ||
| # This Source Code may also be made available under the following Secondary | ||
| # Licenses when the conditions for such availability set forth in the | ||
| # Eclipse Public License, v. 2.0 are satisfied: GNU General Public License, | ||
| # version 2 with the GNU Classpath Exception [1] and GNU General Public | ||
| # License, version 2 with the OpenJDK Assembly Exception [2]. | ||
| # | ||
| # [1] https://www.gnu.org/software/classpath/license.html | ||
| # [2] http://openjdk.java.net/legal/assembly-exception.html | ||
| # | ||
| # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception | ||
| ############################################################################### |
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 is not the right copyright notice. The year should be 2024 (since this file is new); we don't need blank line 2; and the URLs and SPDX are wrong. This should be copied from an existing file.
| # Testarossa build variables. Longer term the distinction between TR and the rest | ||
| # of the OMR code should be heavily reduced. In the mean time, we keep | ||
| # the distinction |
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.
Punctuation.
|
|
||
|
|
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.
Just one blank line, please.
| set(OMR_C_WARNINGS_AS_ERROR_FLAG -qhalt=w) | ||
| set(OMR_CXX_WARNINGS_AS_ERROR_FLAG -qhalt=w) | ||
|
|
||
| # There is no enhanced warning for XLC right now |
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 file should not be used for xlc: why is that compiler even mentioned here?
ddr/Makefile
Outdated
| OMR_TOOLCHAIN ?= gcc | ||
|
|
||
| ifneq (,$(filter gcc xlc,$(OMR_TOOLCHAIN))) | ||
| ifneq (,$(filter gcc xlc openxl,$(OMR_TOOLCHAIN))) |
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.
Do we care about non-cmake builds with OpenXL? If not, the remaining changes should be removed.
5ce9dec to
a47dfb7
Compare
|
The commit message and the discussion here should refer to "z/OS", not "zos". |
57cc58e to
69a94df
Compare
|
Thanks for the feedback/cleanup suggestions. I've addressed the above comments and verified builds are passing. |
| omr_remove_flags(CMAKE_ASM_FLAGS -qhalt=e) | ||
| omr_remove_flags(CMAKE_CXX_FLAGS -qhalt=s) | ||
| omr_remove_flags(CMAKE_C_FLAGS -qhalt=e) |
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.
Suggest languages should be addressed in a consistent order; see lines 34-35 and elsewhere, where C is handled before C++.
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.
reordered to put C_FLAGS first as seen in other places.
| # -march should be there for 32 and 64 C/CXX flags but the C compiler is used for | ||
| # the assembler and it has trouble with some assembly files if it is specified. |
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.
Why does this comment reference 64-bit compiles here in the 32-bit branch?
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.
removed along with the rest of "ppc" section, as POWER support will be contributed by another developer as mentioned below.
| endmacro(omr_toolconfig_global_setup) | ||
| endif() | ||
|
|
||
| if(OMR_HOST_ARCH STREQUAL "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.
Has any of this been tested on POWER? I see several -q options which appear to be in the xlc style.
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.
Another dev (Jackie) is working on support for POWER, as such I will be removing this untested section from here. Believe she has commits that are adding support separately so this section should be not here.
| set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>") | ||
| set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X64 <TARGET>") | ||
| 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 omit this blank line.
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.
Removed extra line.
|
|
||
| set(CMAKE_ASM_FLAGS "-fno-integrated-as") | ||
| string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mgoff\"") | ||
| string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mSYSPARM(BIT64)\"") |
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.
Shouldn't BIT64 be conditional on OMR_ENV_DATA64?
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.
Added the missing conditional
configure
Outdated
| OMR_TOOLCHAIN | ||
| The toolchain used to build the package. One of: gcc,xlc,msvc | ||
| The toolchain used to build the package. One of: | ||
| gcc,xlc,msvc,openxl |
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 file should not be modified: it's not used in cmake builds.
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.
removed
configure.ac
Outdated
| AC_ARG_VAR([OMR_HOST_ARCH], [The architecture of the CPU where the package will run. One of: aarch64,arm,ppc,riscv,s390,x86]) | ||
| AC_ARG_VAR([OMR_TARGET_DATASIZE], [Specifies whether the package will run in 32- or 64-bit mode. One of: 31,32,64]) | ||
| AC_ARG_VAR([OMR_TOOLCHAIN], [The toolchain used to build the package. One of: gcc,xlc,msvc]) | ||
| AC_ARG_VAR([OMR_TOOLCHAIN], [The toolchain used to build the package. One of: gcc,xlc,msvc,openxl]) |
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 file should not be modified: it's not used in cmake builds.
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.
removed
5e5e1ab to
fd03c70
Compare
5b5b433 to
add5876
Compare
add5876 to
4cab253
Compare
| list(APPEND OMR_PLATFORM_C_COMPILE_OPTIONS -qlanglvl=extended) | ||
| list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS -qlanglvl=extended0x) |
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.
These look like xlc options, not openxl options.
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.
@midronij Which files are currently being used by AIX for Open XL? Looks like I have this section specific to AIX where the flags aren't updated. I am assuming if the changes for AIX are already merged, they may be coming from somewhere else already. Is it safe to assume this section can be removed, just wanted to confirm.
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.
Currently on AIX, OpenXL actually uses the GNU cmake file (cmake/modules/platform/toolcfg/gnu.cmake). Generally speaking, clang-based compilers (like OpenXL or xlclang) are considered to be GNU compilers by the config and makefiles.
That being the case, I opted to modify the existing GNU cmake files to account for the use of OpenXL on AIX, rather than create new ones for OpenXL. So you should be able to safely remove that section and any others that are specific to AIX. The only thing to be careful of is that the addition of this new file doesn't break the AIX build, since my changes don't take its existence into account.
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.
yes, it should be mutually exclusive then, Thanks. I will remove the above section.
| if("@OMR_OS_ZOS@" AND "@OMR_ENV_DATA64@" AND NOT "@CMAKE_C_COMPILER_IS_OPENXL@") | ||
| # We need to set 64 bit code generation to ensure that limits.h macros are set correctly. | ||
| list(APPEND pp_command "-Wc,lp64") |
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.
Does openxl only support 64-bit targets?
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.
Don't think so, but this exclusion was simply added so that the build knows not append this flag. For Open-XL, this is applied by default without specifying. Adding it to the full command with the "-Wc" format causes compilation error as it is not recognized.
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 CMAKE_C_COMPILER_IS_OPENXL should not be used, in favour of using OMR_TOOLCONFIG STREQUAL "openxl".
4f919e5 to
6b3489e
Compare
|
Made the requested changes based on Keith's feedback and also rebased with latest |
| if("@OMR_OS_ZOS@" AND "@OMR_ENV_DATA64@" AND NOT "@CMAKE_C_COMPILER_IS_OPENXL@") | ||
| # We need to set 64 bit code generation to ensure that limits.h macros are set correctly. | ||
| list(APPEND pp_command "-Wc,lp64") |
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 CMAKE_C_COMPILER_IS_OPENXL should not be used, in favour of using OMR_TOOLCONFIG STREQUAL "openxl".
|
|
||
|
|
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.
One blank at a time, please.
|
|
||
| list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS | ||
| -march=${OMR_ZOS_COMPILE_ARCHITECTURE} | ||
| "-std=gnu++14" |
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.
Why gnu and not c as in -std=c++14?
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.
Sean from the cpp team recommended to use gnu++14 over c++14 to avoid using _EXT in most places ...
More specifics regarding feedback there:
_EXT required for alloca() not being exposed in javadump.cpp
Use -std=gnu++14. The closest XL option to -std=c++14 is -qlanglvl=ansi. With that XL option you would need to add
_EXT too. The -std=gnu* options are the closest to -qlanglvl=etended. stdlib.h will declare alloca() with -std=gnu*.
---
If you say you want a standard language level (like std=c++14), then you do need to specify the _EXT to say you want
extensions. If you use extension based language levels (like the gnu versions) then you get most extensions enabled 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.
Ok. Please add a comment that summarizes that.
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 don't see that comment.
| -mnocsect | ||
| ) | ||
|
|
||
| # Configure the platform dependent library for multithreading. |
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 hyphenate "platform-dependent".
| if(CMAKE_C_COMPILER_IS_XLCLANG) | ||
| # The -P option doesn't sit well with XLClang, so it's not included. It causes: | ||
| # "ld: 0711-317 ERROR: Undefined symbol: <SYMBOL>" when libj9jit29.so is getting linked. | ||
| set(SPP_FLAGS -E) | ||
| else() | ||
| set(SPP_FLAGS -E -P) | ||
| 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.
Isn't CMAKE_C_COMPILER_IS_XLCLANG only true when OMR_TOOLCONFIG is xlc (in which case this file would not be used)?
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.
yes, will remove the conditional and keep the path thats always taken for open-xl.
|
Addressed comments above, please review @keithc-ca |
| list(APPEND pp_command "-xc++") | ||
| endif() | ||
| if("@OMR_OS_ZOS@" AND "@OMR_ENV_DATA64@") | ||
| if("@OMR_OS_ZOS@" AND "@OMR_ENV_DATA64@" AND NOT OMR_TOOLCONFIG STREQUAL "openxl") |
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.
OMR_TOOLCONFIG must be referenced like other variables used in this file:
if("@OMR_OS_ZOS@" AND "@OMR_ENV_DATA64@" AND NOT "@OMR_TOOLCONFIG@" STREQUAL "openxl")
|
|
||
| list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS | ||
| -march=${OMR_ZOS_COMPILE_ARCHITECTURE} | ||
| "-std=gnu++14" |
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 don't see that comment.
| elseif(CMAKE_C_COMPILER_ID MATCHES "^XL(Clang)?$" OR CMAKE_C_COMPILER_ID STREQUAL "zOS") | ||
| # In CMake 3.14 and prior, XLClang uses CMAKE_C_COMPILER_ID "XL" | ||
| # In CMake 3.15 and beyond, XLClang uses CMAKE_C_COMPILER_ID "XLClang" | ||
| set(_OMR_TOOLCONFIG "xlc") |
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.
CMAKE_C_COMPILER_IS_OPENXL should not be define, but there are references elsewhere so it will need to stay temporarily.
I was suggesting that line 205 should be
elseif((CMAKE_C_COMPILER_ID MATCHES "IBMClang$") OR (CMAKE_C_COMPILER MATCHES ".*ibm-clang.*"))
and lines 219-221 should be removed.
941d38a to
445c7a6
Compare
|
@keithc-ca Have made the above suggested changes. Apologies for the missing comment, I had accidentally added it somewhere else and it did not make it into earlier commit. Should be there now. |
| # -std=gnu++14 is used over -std=cpp++14, as the gnu* options are closest to | ||
| # -qlanglvl=extended (Enabling most extensions by default). This is preferred | ||
| # in order to avoid defining _EXT repeatedly in most places. |
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 remove the trailing space on line 46; "enabling" should not be capitalized.
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.
Done
Adds the initial set of changes to support compilation with Open XL on z/OS. This will define the alternative flags and configuration that needs to be used by the wyvern compiler while running on z/OS. Signed-off-by: Gaurav Chaudhari <gaurav.chaudhari@ibm.com>
445c7a6 to
0126fe0
Compare
|
jenkins build all |
|
Infra failure on riscv. But, this PR's changes don't impact riscv. So, we can merge it without a riscv PR build. |
Adds the initial set of changes to support compilation with Open XL on z/OS. This will define the alternative flags and configuration that needs to be used by the wyvern compiler while running on z/OS.
(This is one part of the multiple changes added for supporting Open XL compilation on OMR)