summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKevin Adler <kadler@us.ibm.com>2020-11-13 21:30:51 (GMT)
committerKevin Adler <kadler@us.ibm.com>2020-11-13 21:40:51 (GMT)
commit92fc37555fd74b9a3848c956df49a516906af711 (patch)
treedc1d0215848ea24f507e007c91e2d8b1112bd6b0 /CMakeLists.txt
parentb52970e86b7b487da182e3b767b256c5e577d269 (diff)
downloadNinja-92fc37555fd74b9a3848c956df49a516906af711.zip
Ninja-92fc37555fd74b9a3848c956df49a516906af711.tar.gz
Ninja-92fc37555fd74b9a3848c956df49a516906af711.tar.bz2
Fix test crashes on AIX
Both hash_collision_bench and manifest_parser_perftest crash on AIX with terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc IOT/Abort trap (core dumped) 32-bit AIX applications by default allocates only a single 256M segment for stack and heap for 32-bit applications, which is insufficient for these tests. When building these tests on AIX in 32-bit mode, increase the max number of segments so they will run without crashing.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7cf6006..7009214 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,6 +203,12 @@ if(BUILD_TESTING)
target_link_libraries(${perftest} PRIVATE libninja libninja-re2c)
endforeach()
+ if(CMAKE_SYSTEM_NAME STREQUAL "AIX" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+ # These tests require more memory than will fit in the standard AIX shared stack/heap (256M)
+ target_link_libraries(hash_collision_bench PRIVATE "-Wl,-bmaxdata:0x80000000")
+ target_link_libraries(manifest_parser_perftest PRIVATE "-Wl,-bmaxdata:0x80000000")
+ endif()
+
add_test(NinjaTest ninja_test)
endif()