summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xconfigure.py5
2 files changed, 11 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()
diff --git a/configure.py b/configure.py
index 48c4821..cded265 100755
--- a/configure.py
+++ b/configure.py
@@ -596,6 +596,11 @@ all_targets += ninja_test
n.comment('Ancillary executables.')
+if platform.is_aix() and '-maix64' not in ldflags:
+ # Both hash_collision_bench and manifest_parser_perftest require more
+ # memory than will fit in the standard 32-bit AIX shared stack/heap (256M)
+ libs.append('-Wl,-bmaxdata:0x80000000')
+
for name in ['build_log_perftest',
'canon_perftest',
'depfile_parser_perftest',