Merge "Remove #define _BITSIZE 32."
diff --git a/libc/bionic/debug_stacktrace.cpp b/libc/bionic/debug_stacktrace.cpp
index fb933e6..0f93b26 100644
--- a/libc/bionic/debug_stacktrace.cpp
+++ b/libc/bionic/debug_stacktrace.cpp
@@ -80,6 +80,18 @@
}
};
+#if defined(__arm__) && !defined(_Unwind_GetIP)
+// Older versions of Clang don't provide a definition of _Unwind_GetIP(), so
+// we include an appropriate version of our own. Once we have updated to
+// Clang 3.4, this code can be removed.
+static __inline__
+uintptr_t _Unwind_GetIP(struct _Unwind_Context *__context) {
+ uintptr_t __ip = 0;
+ _Unwind_VRS_Get(__context, _UVRSC_CORE, 15, _UVRSD_UINT32, &__ip);
+ return __ip & ~0x1;
+}
+#endif
+
static _Unwind_Reason_Code trace_function(__unwind_context* context, void* arg) {
stack_crawl_state_t* state = static_cast<stack_crawl_state_t*>(arg);
diff --git a/libc/bionic/strchr.cpp b/libc/bionic/strchr.cpp
index e2f4471..029fbd9 100644
--- a/libc/bionic/strchr.cpp
+++ b/libc/bionic/strchr.cpp
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#undef _FORTIFY_SOURCE
#include <string.h>
extern "C" char* strchr(const char* p, int ch) {
diff --git a/libc/stdio/snprintf.c b/libc/stdio/snprintf.c
index 5aa54be..9a25ef2 100644
--- a/libc/stdio/snprintf.c
+++ b/libc/stdio/snprintf.c
@@ -31,6 +31,7 @@
* SUCH DAMAGE.
*/
+#undef _FORTIFY_SOURCE
#include <limits.h>
#include <stdio.h>
#include <string.h>
diff --git a/libc/stdio/sprintf.c b/libc/stdio/sprintf.c
index 3cf7952..1245552 100644
--- a/libc/stdio/sprintf.c
+++ b/libc/stdio/sprintf.c
@@ -31,6 +31,7 @@
* SUCH DAMAGE.
*/
+#undef _FORTIFY_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdarg.h>