Skip to content

Commit

Permalink
Merge pull request #7322 from Deigue/openxl-flags
Browse files Browse the repository at this point in the history
Flag changes and minor fixes for Open XL compile
  • Loading branch information
babsingh committed Jun 5, 2024
2 parents a3bc75a + 66a405b commit 753ebae
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/platform/os/zos.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

list(APPEND OMR_PLATFORM_DEFINITIONS
-D_ALL_SOURCE
-D_OPEN_THREADS=2
-D_OPEN_THREADS=3
-D_POSIX_SOURCE
-D_XOPEN_SOURCE_EXTENDED
-D_ISOC99_SOURCE
Expand Down
7 changes: 4 additions & 3 deletions cmake/modules/platform/toolcfg/zos_rename_exports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,20 @@ if(NOT ARCHIVE_DIR)
set(ARCHIVE_DIR ${RUNTIME_DIR})
endif()

if(NOT EXISTS "${ARCHVIVE_DIR}")
if(NOT EXISTS "${ARCHIVE_DIR}")
file(MAKE_DIRECTORY "${ARCHIVE_DIR}")
endif()
string(FIND "${LIBRARY_FILE_NAME}" "." dot_pos REVERSE)
string(SUBSTRING "${LIBRARY_FILE_NAME}" 0 ${dot_pos} base_name)

set(SRC_FILE "${CMAKE_BINARY_DIR}/${base_name}.x")
set(DEST_FILE "${ARCHIVE_DIR}/${base_name}.x")
if(NOT "${SRC_FILE}" STREQUAL "${DEST_FILE}")

if(EXISTS ${SRC_FILE} AND NOT "${SRC_FILE}" STREQUAL "${DEST_FILE}")
file(RENAME "${SRC_FILE}" "${DEST_FILE}")
endif()

# Work around a bug in CMake where it looks for .x files in the runime dir rather than the archive dir.
if(NOT "${ARCHIVE_DIR}" STREQUAL "${RUNTIME_DIR}")
if(EXISTS ${DEST_FILE} AND NOT "${ARCHIVE_DIR}" STREQUAL "${RUNTIME_DIR}")
file(COPY "${DEST_FILE}" DESTINATION "${RUNTIME_DIR}")
endif()
7 changes: 6 additions & 1 deletion fvtest/omrGtestGlue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ endif()
if(OMR_OS_AIX OR OMR_OS_ZOS)
list(APPEND OMR_GTEST_DEFINITIONS
-DGTEST_ENV_HAS_STD_TUPLE_
-D__IBMCPP_TR1__
)

if(NOT OMR_TOOLCONFIG STREQUAL "openxl")
list(APPEND OMR_GTEST_DEFINITIONS
-D__IBMCPP_TR1__
)
endif()
endif()

target_compile_options(omrGtest
Expand Down
1 change: 1 addition & 0 deletions fvtest/porttest/omrvmemTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ isNewPageSize(uintptr_t pageSize, uintptr_t pageFlags)
* On z/OS, 1M fixed and 2G fixed pages can be used only to allocate above 2G bar.
* Only 4K and 1M pageable pages can be used to allocate memory below the bar.
*/
BOOLEAN
isPageSizeSupportedBelowBar(uintptr_t pageSize, uintptr_t pageFlags)
{
if ((FOUR_KB == pageSize) ||
Expand Down
2 changes: 1 addition & 1 deletion fvtest/sigtest/sigTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*******************************************************************************/

#if defined(J9ZOS390)
#define _OPEN_THREADS 2
#define _OPEN_THREADS 3
#define _UNIX03_SOURCE
#endif /* defined(J9ZOS390) */

Expand Down
2 changes: 1 addition & 1 deletion omrsigcompat/omrsig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*******************************************************************************/

#if defined(J9ZOS390)
#define _OPEN_THREADS 2
#define _OPEN_THREADS 3
#define _UNIX03_SOURCE
#endif /* defined(J9ZOS390) */

Expand Down
14 changes: 7 additions & 7 deletions third_party/gtest-1.8.0/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ struct _RTL_CRITICAL_SECTION;
// detecting whether they are enabled or not. Therefore, we assume that
// they are enabled unless the user tells us otherwise.
# define GTEST_HAS_EXCEPTIONS 1
# elif defined(__IBMCPP__) && __EXCEPTIONS
# elif (defined(__IBMCPP__) || (defined(__open_xl__) && defined(__cplusplus))) && __EXCEPTIONS
// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
# define GTEST_HAS_EXCEPTIONS 1
# elif defined(__HP_aCC)
Expand Down Expand Up @@ -570,7 +570,7 @@ struct _RTL_CRITICAL_SECTION;

// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
// both the typeid and dynamic_cast features are present.
# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
# elif (defined(__IBMCPP__) && (__IBMCPP__ >= 900)) || (defined(__open_xl__) && defined(__cplusplus))

# ifdef __RTTI_ALL__
# define GTEST_HAS_RTTI 1
Expand Down Expand Up @@ -690,11 +690,11 @@ struct _RTL_CRITICAL_SECTION;
# elif GTEST_ENV_HAS_STD_TUPLE_
# include <tuple>

#if defined(J9ZOS390) || defined(AIXPPC)
#if (defined(J9ZOS390) && !defined(__open_xl__)) || defined(AIXPPC)
// On z/OS and AIX, tuple is defined in the ::std::tr1 namespace as it is an
// extension class since xlc does not support the full C++11 standard. As such,
// we expose the tuple class in the ::std namespace such that code below will
// work.
// work. However, Open XL does support C++11 standard.
namespace std
{
using ::std::tr1::get;
Expand Down Expand Up @@ -821,7 +821,7 @@ using ::std::tuple_size;
// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
// Sun Pro CC, IBM Visual Age, and HP aCC support.
#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
defined(__IBMCPP__) || defined(__HP_aCC)
defined(__IBMCPP__) || defined(__HP_aCC) || (defined(__open_xl__) && defined(__cplusplus))
# define GTEST_HAS_TYPED_TEST 1
# define GTEST_HAS_TYPED_TEST_P 1
#endif
Expand Down Expand Up @@ -2200,7 +2200,7 @@ GTEST_API_ size_t GetThreadCount();
// for objects passed through ellipsis (...), failing for uncopyable
// objects. We define this to ensure that only POD is passed through
// ellipsis on these systems.
#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) || (defined(__open_xl__) && defined(__cplusplus))
// We lose support for NULL detection where the compiler doesn't like
// passing non-POD classes through ellipsis (...).
# define GTEST_ELLIPSIS_NEEDS_POD_ 1
Expand All @@ -2212,7 +2212,7 @@ GTEST_API_ size_t GetThreadCount();
// const T& and const T* in a function template. These compilers
// _can_ decide between class template specializations for T and T*,
// so a tr1::type_traits-like is_pointer works.
#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || (defined(__open_xl__) && defined(__cplusplus))
# define GTEST_NEEDS_IS_POINTER_ 1
#endif

Expand Down

0 comments on commit 753ebae

Please sign in to comment.