Skip to content

Commit 50ed0ba

Browse files
authored
[SystemZ/ZOS] Additions to the build system. (#74730)
This change extend the CMake files with the necessary additions to build LLVM for z/OS.
1 parent 097d2f1 commit 50ed0ba

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

llvm/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,9 @@ set(LLVM_TARGETS_TO_BUILD
581581
${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD})
582582
list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
583583

584-
option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
584+
if (NOT CMAKE_SYSTEM_NAME MATCHES "OS390")
585+
option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
586+
endif()
585587
option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF)
586588
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
587589
option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
@@ -1127,6 +1129,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "OS390")
11271129
add_compile_definitions(_XOPEN_SOURCE=600)
11281130
add_compile_definitions(_OPEN_SYS) # Needed for process information.
11291131
add_compile_definitions(_OPEN_SYS_FILE_EXT) # Needed for EBCDIC I/O.
1132+
add_compile_definitions(_EXT) # Needed for file data.
1133+
add_compile_definitions("-D_UNIX03_THREADS") # Multithreading support.
11301134
endif()
11311135

11321136
# Build with _FILE_OFFSET_BITS=64 on Solaris to match g++ >= 9.

llvm/lib/Transforms/Hello/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if( NOT LLVM_REQUIRES_RTTI )
66
endif()
77
endif()
88

9-
if(WIN32 OR CYGWIN)
9+
if(WIN32 OR CYGWIN OR ZOS)
1010
set(LLVM_LINK_COMPONENTS Core Support)
1111
endif()
1212

llvm/tools/bugpoint-passes/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if( NOT LLVM_REQUIRES_RTTI )
1010
endif()
1111
endif()
1212

13-
if(WIN32 OR CYGWIN)
13+
if(WIN32 OR CYGWIN OR ZOS)
1414
set(LLVM_LINK_COMPONENTS Core Support)
1515
endif()
1616

llvm/tools/llvm-shlib/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ if(LLVM_BUILD_LLVM_DYLIB)
1414
if(MSVC)
1515
message(FATAL_ERROR "Generating libLLVM is not supported on MSVC")
1616
endif()
17+
if(ZOS)
18+
message(FATAL_ERROR "Generating libLLVM is not supported on z/OS")
19+
endif()
1720

1821
llvm_map_components_to_libnames(LIB_NAMES ${LLVM_DYLIB_COMPONENTS})
1922

0 commit comments

Comments
 (0)