summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2018-10-22 16:29:48 +0000
committerTom Stellard <tstellar@redhat.com>2018-10-22 16:29:48 +0000
commita5b1f6f7644b30c97a59d512d4dbe6825db424d9 (patch)
tree7ba3afcdd7385b914191b8bdd6197a136f78a1a3
parent809ebefc12d1cf3653a5459e7eb1cb13bb93fc39 (diff)
Merging r342815:release_70
------------------------------------------------------------------------ r342815 | ericwf | 2018-09-22 12:22:36 -0700 (Sat, 22 Sep 2018) | 14 lines Fix incorrectly aligned exceptions in 32 bit builds. This patch fixes a bug where exceptions in 32 bit builds would be incorrectly aligned because malloc only provides 8 byte aligned memory where 16 byte alignment is needed. This patch makes libc++abi correctly use posix_memalign when it's available. This requires defining _LIBCPP_BUILDING_LIBRARY so that libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't support it and not when aligned new/delete are disable for other reasons. This bug somehow made it into the 7.0 release, making it a regression. Therefore this patch should be included in the next dot release. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/branches/release_70@344917 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--src/fallback_malloc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fallback_malloc.cpp b/src/fallback_malloc.cpp
index 336ad31..bec9952 100644
--- a/src/fallback_malloc.cpp
+++ b/src/fallback_malloc.cpp
@@ -7,6 +7,9 @@
//
//===----------------------------------------------------------------------===//
+// Define _LIBCPP_BUILDING_LIBRARY to ensure _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
+// is only defined when libc aligned allocation is not available.
+#define _LIBCPP_BUILDING_LIBRARY
#include "fallback_malloc.h"
#include <__threading_support>