Skip to content

Commit 81a8b20

Browse files
authored
[SystemZ][z/OS] Define _XOPEN_SOURCE=600 for dlopen (#127254)
On z/OS, dlopen is guarded by _XOPEN_SOURCE=600 so define it when checking for the symbol.
1 parent 8eba128 commit 81a8b20

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,14 @@ if (NOT PURE_WINDOWS)
390390
if( HAVE_LIBDL )
391391
list(APPEND CMAKE_REQUIRED_LIBRARIES dl)
392392
endif()
393+
# Add the _XOPEN_SOURCE macro on z/OS, as certain test(s) use dlopen
394+
if (ZOS)
395+
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=600")
396+
endif()
393397
check_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
398+
if (ZOS)
399+
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=600")
400+
endif()
394401
if( HAVE_LIBDL )
395402
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES dl)
396403
endif()

0 commit comments

Comments
 (0)