summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2019-07-02 19:38:20 -0700
committerHaibo Huang <hhb@google.com>2019-07-03 02:41:33 +0000
commitb2aa3bdc60d3c28b923a6f8b02c60a0a6487bc39 (patch)
tree591f6883951571e4d47eda5ed05981e4498819d7
parent2842118a24ccddd7fda20d7c3821063385af90df (diff)
downloadgdb-b2aa3bdc60d3c28b923a6f8b02c60a0a6487bc39.tar.gz
[NDK] fix gdb 8.3 build for windows
a) can not override operator new for libc++ for windows. b) libc++ needs libucrt but clang didn't add that automatically. Bug: 135839860 Bug: 62547070 Test: build Change-Id: I11b2fad66e2a66214c9a92b2b2cb32b9eba3de54
-rw-r--r--gdb-8.3/gdb/common/new-op.c6
-rw-r--r--gdb-8.3/gdb/configure.nat2
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb-8.3/gdb/common/new-op.c b/gdb-8.3/gdb/common/new-op.c
index 8c07ffac2..3d3d2c2df 100644
--- a/gdb-8.3/gdb/common/new-op.c
+++ b/gdb-8.3/gdb/common/new-op.c
@@ -22,6 +22,10 @@
# define __has_feature(x) 0
#endif
+// ANDROID CHANGE: Can not override operator new for libc++ in WIN32.
+// See b/135839860.
+#if !defined(_WIN32)
+
#if !__has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__)
#include "common-defs.h"
#include "host-defs.h"
@@ -96,3 +100,5 @@ operator new[] (std::size_t sz, const std::nothrow_t&) noexcept
return ::operator new (sz, std::nothrow);
}
#endif
+
+#endif
diff --git a/gdb-8.3/gdb/configure.nat b/gdb-8.3/gdb/configure.nat
index 64ee101d8..0972bf2b5 100644
--- a/gdb-8.3/gdb/configure.nat
+++ b/gdb-8.3/gdb/configure.nat
@@ -325,6 +325,8 @@ case ${gdb_host} in
case ${gdb_host_cpu} in
i386)
NATDEPFILES="${NATDEPFILES} amd64-windows-nat.o"
+ # ANDROID CHANGE: libc++ requires libucrt. See b/136093140
+ LOADLIBES="-lc++ -nodefaultlibs -Wl,--start-group -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lucrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lpsapi -Wl,--end-group"
;;
esac
;;