Skip to content

Commit 2a65fab

Browse files
authored
[z/OS] Improve compiler options on z/OS (llvm#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.
1 parent 8f683c3 commit 2a65fab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,10 @@ endif()
12641264
# Build with _XOPEN_SOURCE on z/OS.
12651265
if (CMAKE_SYSTEM_NAME MATCHES "OS390")
12661266
add_compile_definitions(_XOPEN_SOURCE=600)
1267+
add_compile_definitions(_XPLATFORM_SOURCE) # Needed e.g. for O_CLOEXEC.
12671268
add_compile_definitions(_OPEN_SYS) # Needed for process information.
12681269
add_compile_definitions(_OPEN_SYS_FILE_EXT) # Needed for EBCDIC I/O.
12691270
add_compile_definitions(_EXT) # Needed for file data.
1270-
add_compile_definitions(_UNIX03_THREADS) # Multithreading support.
12711271
# Need to build LLVM as ASCII application.
12721272
# This can't be a global setting because other projects may
12731273
# need to be built in EBCDIC mode.

0 commit comments

Comments
 (0)