[llvm] 50ed0ba - [SystemZ/ZOS] Additions to the build system. (#74730)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 7 12:05:01 PST 2023
Author: Abhina Sree
Date: 2023-12-07T15:04:56-05:00
New Revision: 50ed0ba285bf07632ddee0dec743c26b0442c4cc
URL: https://github.com/llvm/llvm-project/commit/50ed0ba285bf07632ddee0dec743c26b0442c4cc
DIFF: https://github.com/llvm/llvm-project/commit/50ed0ba285bf07632ddee0dec743c26b0442c4cc.diff
LOG: [SystemZ/ZOS] Additions to the build system. (#74730)
This change extend the CMake files with the necessary additions to build LLVM for z/OS.
Added:
Modified:
llvm/CMakeLists.txt
llvm/lib/Transforms/Hello/CMakeLists.txt
llvm/tools/bugpoint-passes/CMakeLists.txt
llvm/tools/llvm-shlib/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 1c983165b2ef0..abe415f77facd 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -581,7 +581,9 @@ set(LLVM_TARGETS_TO_BUILD
${LLVM_EXPERIMENTAL_TARGETS_TO_BUILD})
list(REMOVE_DUPLICATES LLVM_TARGETS_TO_BUILD)
-option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "OS390")
+ option(LLVM_ENABLE_PIC "Build Position-Independent Code" ON)
+endif()
option(LLVM_ENABLE_MODULES "Compile with C++ modules enabled." OFF)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
option(LLVM_ENABLE_MODULE_DEBUGGING "Compile with -gmodules." ON)
@@ -1127,6 +1129,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "OS390")
add_compile_definitions(_XOPEN_SOURCE=600)
add_compile_definitions(_OPEN_SYS) # Needed for process information.
add_compile_definitions(_OPEN_SYS_FILE_EXT) # Needed for EBCDIC I/O.
+ add_compile_definitions(_EXT) # Needed for file data.
+ add_compile_definitions("-D_UNIX03_THREADS") # Multithreading support.
endif()
# Build with _FILE_OFFSET_BITS=64 on Solaris to match g++ >= 9.
diff --git a/llvm/lib/Transforms/Hello/CMakeLists.txt b/llvm/lib/Transforms/Hello/CMakeLists.txt
index c4f10247c1a6c..9510c31f633fe 100644
--- a/llvm/lib/Transforms/Hello/CMakeLists.txt
+++ b/llvm/lib/Transforms/Hello/CMakeLists.txt
@@ -6,7 +6,7 @@ if( NOT LLVM_REQUIRES_RTTI )
endif()
endif()
-if(WIN32 OR CYGWIN)
+if(WIN32 OR CYGWIN OR ZOS)
set(LLVM_LINK_COMPONENTS Core Support)
endif()
diff --git a/llvm/tools/bugpoint-passes/CMakeLists.txt b/llvm/tools/bugpoint-passes/CMakeLists.txt
index 6df49d7abd880..60fc1bde51371 100644
--- a/llvm/tools/bugpoint-passes/CMakeLists.txt
+++ b/llvm/tools/bugpoint-passes/CMakeLists.txt
@@ -10,7 +10,7 @@ if( NOT LLVM_REQUIRES_RTTI )
endif()
endif()
-if(WIN32 OR CYGWIN)
+if(WIN32 OR CYGWIN OR ZOS)
set(LLVM_LINK_COMPONENTS Core Support)
endif()
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index 8ace190b28f74..5079316533d37 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -14,6 +14,9 @@ if(LLVM_BUILD_LLVM_DYLIB)
if(MSVC)
message(FATAL_ERROR "Generating libLLVM is not supported on MSVC")
endif()
+ if(ZOS)
+ message(FATAL_ERROR "Generating libLLVM is not supported on z/OS")
+ endif()
llvm_map_components_to_libnames(LIB_NAMES ${LLVM_DYLIB_COMPONENTS})
More information about the llvm-commits
mailing list