diff --git a/GNUmakefile b/GNUmakefile index 54c14af9..d1842d41 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -1064,7 +1064,16 @@ ifneq ($(filter -DDEBUG -DDEBUG=1,$(CXXFLAGS)),) endif # CXXFLAGS endif # HAS_NEWLIB endif # USING_GLIBCXX -endif # GNU Debug build + + ifeq ($(XLC_COMPILER),1) + TPROG = TestPrograms/test_cxx.cxx + TOPT = -qheapdebug -qro + HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | tr ' ' '\n' | wc -l) + ifeq ($(strip $(HAVE_OPT)),0) + CXXFLAGS += -qheapdebug -qro + endif # CXXFLAGS + endif # XLC_COMPILER +endif # Debug build # Dead code stripping. Issue 'make lean'. ifeq ($(findstring lean,$(MAKECMDGOALS)),lean) diff --git a/stdcpp.h b/stdcpp.h index 80da2fd7..838d1766 100644 --- a/stdcpp.h +++ b/stdcpp.h @@ -32,6 +32,14 @@ namespace std { } #endif +// workaround needed for IBM XLC and debug heaps on AIX +#if defined(_AIX) && (defined(__xlc__) || defined(__xlC__) || defined(__ibmxl__)) +namespace std { + using ::_debug_memset; + using ::_debug_memcpy; +} +#endif + // make_unchecked_array_iterator #if _MSC_VER >= 1600 #include @@ -81,4 +89,4 @@ namespace std { using std::log; #endif -#endif +#endif // CRYPTOPP_STDCPP_H