Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 000c7b8

Browse files
committed
[AIX] [test-suite] Enable standard compatable mode on AIX
Summary: Since the current default `_ALL_SOURCE` causes numerous issues on AIX (e.g., typedef redefinition, unintended macro expansion), this patch changes the configuration to use standard-compatable mode by appending `XOPEN_SOURCE=700`. This flag is added to cflags for all the C test cases because a considerable number of C tests are affected by the `_ALL_SOURCE` problem. For one particular C++ test case that was also affected by `_ALL_SOURCE`, the flag is appended to the cxxflags in its sub-level CMakeLists. Reviewers: hubert.reinterpretcast, daltenty Reviewed By: daltenty Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D82321
1 parent e4c5387 commit 000c7b8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_SUITE_EXTRA_CXX_FLAGS}")
170170
set(CMAKE_EXE_LINKER_FLAGS
171171
"${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_EXTRA_EXE_LINKER_FLAGS}")
172172

173+
# Use X/OPEN compatibility flag on AIX for C tests to avoid problems
174+
# with some versions of the system headers.
175+
if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
176+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=700")
177+
endif()
178+
173179
# This is either directly the C++ ABI library or the full C++ library
174180
# which pulls in the ABI transitively.
175181
set(TEST_SUITE_CXX_ABI "default" CACHE STRING "Specify C++ ABI library to use.")

MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX -DREDSTORM) # -DREDSTORM for mkdir
1+
list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX -DREDSTORM -D_XOPEN_SOURCE=700) # -DREDSTORM for mkdir
22
list(APPEND LDFLAGS -lm)
33
set(RUN_OPTIONS -nx 64 -ny 64 -nz 64)
44
llvm_multisource(miniFE)

0 commit comments

Comments
 (0)