Skip to content

[SystemZ/ZOS] Additions to the build system. #74730

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

Merged
merged 3 commits into from
Dec 7, 2023

Conversation

abhina-sree
Copy link
Contributor

This change extend the CMake files with the necessary additions to build LLVM for z/OS.

@llvmbot
Copy link
Member

llvmbot commented Dec 7, 2023

@llvm/pr-subscribers-llvm-transforms

Author: Abhina Sree (abhina-sree)

Changes

This change extend the CMake files with the necessary additions to build LLVM for z/OS.


Full diff: https://github.com/llvm/llvm-project/pull/74730.diff

4 Files Affected:

  • (modified) llvm/CMakeLists.txt (+3-1)
  • (modified) llvm/lib/Transforms/Hello/CMakeLists.txt (+1-1)
  • (modified) llvm/tools/bugpoint-passes/CMakeLists.txt (+1-1)
  • (modified) llvm/tools/llvm-shlib/CMakeLists.txt (+3)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 1c983165b2ef00..1d8f5f41434aa3 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 ZOS)
+  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)
diff --git a/llvm/lib/Transforms/Hello/CMakeLists.txt b/llvm/lib/Transforms/Hello/CMakeLists.txt
index c4f10247c1a6cc..9510c31f633fe8 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 6df49d7abd8809..60fc1bde513710 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 8ace190b28f744..5079316533d374 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})
 

Copy link
Contributor

@fanbo-meng fanbo-meng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhina-sree abhina-sree merged commit 50ed0ba into llvm:main Dec 7, 2023
@abhina-sree abhina-sree deleted the abhina/zos_cmake branch December 7, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants