-
Notifications
You must be signed in to change notification settings - Fork 394
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
Add Open XL toolchain and config changes for z/OS #7319
Open
Deigue
wants to merge
1
commit into
eclipse:master
Choose a base branch
from
Deigue:openxl-toolchain
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
############################################################################### | ||
# Copyright IBM Corp. and others 2024 | ||
# | ||
# 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 https://www.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] https://openjdk.org/legal/assembly-exception.html | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0 | ||
############################################################################### | ||
|
||
if(CMAKE_C_COMPILER_IS_XLCLANG) | ||
macro(omr_toolconfig_global_setup) | ||
# For XLClang, remove any usages of -qhalt=e or -qhalt=s provided by default | ||
# in the CMAKE CXX/C/ASM FLAGS, since xlclang/xlclang++ are not compatible | ||
# with the e or s options. | ||
omr_remove_flags(CMAKE_ASM_FLAGS -qhalt=e) | ||
omr_remove_flags(CMAKE_C_FLAGS -qhalt=e) | ||
omr_remove_flags(CMAKE_CXX_FLAGS -qhalt=s) | ||
endmacro(omr_toolconfig_global_setup) | ||
endif() | ||
Comment on lines
+22
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not be used when Even after such changes this would still use |
||
|
||
if(OMR_OS_AIX) | ||
list(APPEND OMR_PLATFORM_C_COMPILE_OPTIONS -qlanglvl=extended) | ||
list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS -qlanglvl=extended0x) | ||
|
||
if(CMAKE_C_COMPILER_IS_XLCLANG) | ||
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -qxlcompatmacros) | ||
else() | ||
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS -qinfo=pro) | ||
endif() | ||
|
||
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lm -liconv -ldl -lperfstat") | ||
|
||
if(OMR_ENV_DATA64) | ||
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -q64") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -q64") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -q64") | ||
|
||
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>") | ||
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>") | ||
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -X64 <TARGET>") | ||
endif() | ||
elseif(OMR_OS_LINUX) | ||
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS | ||
-qxflag=selinux | ||
) | ||
elseif(OMR_OS_ZOS) | ||
set(OMR_ZOS_COMPILE_ARCHITECTURE "arch10" CACHE STRING "z/OS compile machine architecture" FORCE) | ||
set(OMR_ZOS_COMPILE_TARGET "ZOSV2R4" CACHE STRING "z/OS compile target operating system" FORCE) | ||
set(OMR_ZOS_COMPILE_TUNE "12" CACHE STRING "z/OS compile machine architecture tuning" FORCE) | ||
set(OMR_ZOS_LINK_COMPAT "ZOSV2R4" CACHE STRING "z/OS link compatible operating system" FORCE) | ||
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "--shared") | ||
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "--shared") | ||
|
||
set(CMAKE_ASM_FLAGS "-fno-integrated-as") | ||
string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mgoff\"") | ||
if(OMR_ENV_DATA64) | ||
string(APPEND CMAKE_ASM_FLAGS " \"-Wa,-mSYSPARM(BIT64)\"") | ||
endif() | ||
|
||
list(APPEND OMR_PLATFORM_COMPILE_OPTIONS | ||
"-fstrict-aliasing" | ||
"-mzos-target=${OMR_ZOS_COMPILE_TARGET}" | ||
"-m64" | ||
) | ||
|
||
list(APPEND OMR_PLATFORM_C_COMPILE_OPTIONS | ||
-march=${OMR_ZOS_COMPILE_ARCHITECTURE} | ||
) | ||
|
||
list(APPEND OMR_PLATFORM_CXX_COMPILE_OPTIONS | ||
-march=${OMR_ZOS_COMPILE_ARCHITECTURE} | ||
"-std=gnu++14" | ||
-fasm | ||
) | ||
|
||
list(APPEND OMR_PLATFORM_SHARED_COMPILE_OPTIONS | ||
-fvisibility=default | ||
) | ||
|
||
if(OMR_ENV_DATA64) | ||
list(APPEND OMR_PLATFORM_DEFINITIONS | ||
-DJ9ZOS39064 | ||
) | ||
else() | ||
list(APPEND OMR_PLATFORM_DEFINITIONS | ||
-D_LARGE_FILES | ||
) | ||
endif() | ||
|
||
# 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. | ||
|
||
# TR_COMPILE_OPTIONS are variables appended to CMAKE_{C,CXX}_FLAGS, and so | ||
# apply to both C and C++ compilations. | ||
list(APPEND TR_COMPILE_OPTIONS | ||
-DYYLMAX=1000 | ||
) | ||
|
||
list(APPEND TR_CXX_COMPILE_OPTIONS | ||
-Wuninitialized | ||
-mnocsect | ||
) | ||
|
||
# Configure the platform dependent library for multithreading. | ||
set(OMR_PLATFORM_THREAD_LIBRARY "") | ||
endif() | ||
|
||
set(SPP_CMD ${CMAKE_C_COMPILER}) | ||
|
||
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() | ||
|
||
if(OMR_OS_ZOS) | ||
function(_omr_toolchain_process_exports TARGET_NAME) | ||
# Any type of target which says it has exports should get the DLL, and EXPORTALL | ||
# compile flags. | ||
# Open XL equivalent has been added below. | ||
target_compile_options(${TARGET_NAME} | ||
PRIVATE | ||
-fvisibility=default | ||
) | ||
|
||
get_target_property(target_type ${TARGET_NAME} TYPE) | ||
if(NOT target_type STREQUAL "SHARED_LIBRARY") | ||
return() | ||
endif() | ||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD | ||
COMMAND "${CMAKE_COMMAND}" | ||
"-DLIBRARY_FILE_NAME=$<TARGET_FILE_NAME:${TARGET_NAME}>" | ||
"-DRUNTIME_DIR=$<TARGET_FILE_DIR:${TARGET_NAME}>" | ||
"-DARCHIVE_DIR=$<TARGET_PROPERTY:${TARGET_NAME},ARCHIVE_OUTPUT_DIRECTORY>" | ||
-P "${omr_SOURCE_DIR}/cmake/modules/platform/toolcfg/zos_rename_exports.cmake" | ||
) | ||
endfunction() | ||
else() | ||
function(_omr_toolchain_process_exports TARGET_NAME) | ||
get_target_property(target_type ${TARGET_NAME} TYPE) | ||
if(NOT target_type STREQUAL "SHARED_LIBRARY") | ||
return() | ||
endif() | ||
|
||
set(exp_file "$<TARGET_PROPERTY:${TARGET_NAME},BINARY_DIR>/${TARGET_NAME}.exp") | ||
omr_process_template( | ||
"${omr_SOURCE_DIR}/cmake/modules/platform/toolcfg/xlc_exports.exp.in" | ||
"${exp_file}" | ||
) | ||
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-bE:${TARGET_NAME}.exp") | ||
endfunction() | ||
|
||
function(_omr_toolchain_separate_debug_symbols tgt) | ||
set(exe_file "$<TARGET_FILE:${tgt}>") | ||
omr_get_target_output_genex(${tgt} output_name) | ||
set(dbg_file "${output_name}${OMR_DEBUG_INFO_OUTPUT_EXTENSION}") | ||
add_custom_command( | ||
TARGET "${tgt}" | ||
POST_BUILD | ||
COMMAND "${CMAKE_COMMAND}" -E copy ${exe_file} ${dbg_file} | ||
COMMAND "${CMAKE_STRIP}" -X32_64 -t ${exe_file} | ||
) | ||
set_target_properties(${tgt} PROPERTIES OMR_DEBUG_FILE "${dbg_file}") | ||
endfunction() | ||
endif() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
This belongs within the
if
block for xlc.