[llvm] 2a65fab - [z/OS] Improve compiler options on z/OS (#166415)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 12:07:25 PST 2025


Author: Kai Nacke
Date: 2025-11-04T15:07:20-05:00
New Revision: 2a65fab965d60939ebf5d2ba9dab03ac3a69d846

URL: https://github.com/llvm/llvm-project/commit/2a65fab965d60939ebf5d2ba9dab03ac3a69d846
DIFF: https://github.com/llvm/llvm-project/commit/2a65fab965d60939ebf5d2ba9dab03ac3a69d846.diff

LOG: [z/OS] Improve compiler options on z/OS (#166415)

`_XPLATFORM_SOURCE` needs to be defined to improve source code
compatibility (e.g. for `O_CLOEXEC`). The define `_UNIX03_THREADS` can
be removed, because it is automatically set by `_XOPEN_SOURCE=600`.

See the documentation of feature test macros:
https://www.ibm.com/docs/en/zos/3.1.0?topic=files-feature-test-macros

Tested on z/OS 3.1 with the Open XL C/C++ 2.2 compiler.

Added: 
    

Modified: 
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index c450ee5a3d72e..f192cd05b5a34 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1264,10 +1264,10 @@ endif()
 # Build with _XOPEN_SOURCE on z/OS.
 if (CMAKE_SYSTEM_NAME MATCHES "OS390")
   add_compile_definitions(_XOPEN_SOURCE=600)
+  add_compile_definitions(_XPLATFORM_SOURCE) # Needed e.g. for O_CLOEXEC.
   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(_UNIX03_THREADS) # Multithreading support.
   # Need to build LLVM as ASCII application.
   # This can't be a global setting because other projects may
   # need to be built in EBCDIC mode.


        


More information about the llvm-commits mailing list