Merge "Complete <netdb.h>."
diff --git a/libc/Android.bp b/libc/Android.bp
index e37ae08..81135ea 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -21,7 +21,6 @@
"stdio/stdio_ext.cpp",
"stdio/vfscanf.c",
"stdio/vfwscanf.c",
- "stdlib/atexit.c",
"stdlib/exit.c",
]
@@ -887,11 +886,6 @@
cc_library_static {
defaults: ["libc_defaults"],
srcs: [
- // The following implementations depend on pthread data, so we can't
- // include them in libc_ndk.a.
- "bionic/__cxa_thread_atexit_impl.cpp",
- "bionic/fork.cpp",
-
// The data that backs getauxval is initialized in the libc init
// functions which are invoked by the linker. If this file is included
// in libc_ndk.a, only one of the copies of the global data will be
@@ -1396,7 +1390,6 @@
"bionic/__gnu_basename.cpp",
"bionic/__libc_current_sigrtmax.cpp",
"bionic/__libc_current_sigrtmin.cpp",
- "bionic/__set_errno.cpp",
"bionic/abort.cpp",
"bionic/accept.cpp",
"bionic/accept4.cpp",
@@ -1565,6 +1558,10 @@
"bionic/wctype.cpp",
"bionic/wcwidth.cpp",
"bionic/wmempcpy.cpp",
+
+ // This contains a weak stub implementation of __find_icu_symbol for wctype.cpp,
+ // which will be overridden by the actual one in libc.so.
+ "bionic/icu_static.cpp",
],
multilib: {
@@ -1619,6 +1616,12 @@
"bionic/pthread_setschedparam.cpp",
"bionic/pthread_sigmask.cpp",
"bionic/pthread_spinlock.cpp",
+
+ // The following implementations depend on pthread data or implementation,
+ // so we can't include them in libc_ndk.a.
+ "bionic/__cxa_thread_atexit_impl.cpp",
+ "stdlib/atexit.c",
+ "bionic/fork.cpp",
],
cppflags: ["-Wold-style-cast"],
@@ -1632,6 +1635,7 @@
cc_library_static {
defaults: ["libc_defaults"],
+ srcs: ["bionic/__set_errno.cpp"],
arch: {
arm: {
srcs: ["arch-arm/syscalls/**/*.S"],
@@ -1731,9 +1735,8 @@
}
// ========================================================
-// libc_common.a
+// libc_nopthread.a
// ========================================================
-
cc_library_static {
defaults: ["libc_defaults"],
srcs: libc_common_src_files,
@@ -1742,7 +1745,7 @@
srcs: libc_common_src_files_32,
},
},
- name: "libc_common",
+ name: "libc_nopthread",
whole_static_libs: [
"libc_bionic",
@@ -1757,7 +1760,6 @@
"libc_openbsd",
"libc_openbsd_large_stack",
"libc_openbsd_ndk",
- "libc_pthread",
"libc_stack_protector",
"libc_syscalls",
"libc_tzcode",
@@ -1772,6 +1774,20 @@
}
// ========================================================
+// libc_common.a
+// ========================================================
+
+cc_library_static {
+ defaults: ["libc_defaults"],
+ name: "libc_common",
+
+ whole_static_libs: [
+ "libc_nopthread",
+ "libc_pthread",
+ ],
+}
+
+// ========================================================
// libc_nomalloc.a
// ========================================================
//
@@ -1825,7 +1841,6 @@
static: {
srcs: [
"bionic/dl_iterate_phdr_static.cpp",
- "bionic/icu_static.cpp",
"bionic/malloc_common.cpp",
],
cflags: ["-DLIBC_STATIC"],
diff --git a/libc/arch-mips64/include b/libc/arch-mips64/include
deleted file mode 120000
index fabbe8a..0000000
--- a/libc/arch-mips64/include
+++ /dev/null
@@ -1 +0,0 @@
-../arch-mips/include
\ No newline at end of file
diff --git a/libc/async_safe/include/async_safe/log.h b/libc/async_safe/include/async_safe/log.h
index 2f54742..10833e4 100644
--- a/libc/async_safe/include/async_safe/log.h
+++ b/libc/async_safe/include/async_safe/log.h
@@ -92,7 +92,7 @@
int async_safe_format_fd(int fd, const char* format , ...) __printflike(2, 3);
int async_safe_format_log(int pri, const char* tag, const char* fmt, ...) __printflike(3, 4);
-int async_safe_format_log_va_list( int pri, const char* tag, const char* fmt, va_list ap);
+int async_safe_format_log_va_list(int pri, const char* tag, const char* fmt, va_list ap);
int async_safe_write_log(int pri, const char* tag, const char* msg);
#define CHECK(predicate) \
diff --git a/libc/bionic/icu_static.cpp b/libc/bionic/icu_static.cpp
index cf24a38..e81e291 100644
--- a/libc/bionic/icu_static.cpp
+++ b/libc/bionic/icu_static.cpp
@@ -29,6 +29,6 @@
#include "private/icu.h"
// We don't have dlopen/dlsym for static binaries yet.
-void* __find_icu_symbol(const char*) {
+__attribute__((weak)) void* __find_icu_symbol(const char*) {
return nullptr;
}
diff --git a/tests/BionicDeathTest.h b/tests/BionicDeathTest.h
index 31d2d6e..3e8d7b2 100644
--- a/tests/BionicDeathTest.h
+++ b/tests/BionicDeathTest.h
@@ -17,25 +17,29 @@
#ifndef BIONIC_TESTS_BIONIC_DEATH_TEST_H_
#define BIONIC_TESTS_BIONIC_DEATH_TEST_H_
-#include <gtest/gtest.h>
+#include <signal.h>
-#include <sys/prctl.h>
+#include <gtest/gtest.h>
class BionicDeathTest : public testing::Test {
protected:
virtual void SetUp() {
// Suppress debuggerd stack traces. Too slow.
- old_dumpable_ = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
- prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
- ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+ for (int signo : { SIGABRT, SIGBUS, SIGSEGV, SIGSYS }) {
+ struct sigaction action = {};
+ action.sa_handler = SIG_DFL;
+ sigaction(signo, &action, &previous_);
+ }
}
virtual void TearDown() {
- prctl(PR_SET_DUMPABLE, old_dumpable_, 0, 0, 0, 0);
+ for (int signo : { SIGABRT, SIGBUS, SIGSEGV, SIGSYS }) {
+ sigaction(signo, &previous_, nullptr);
+ }
}
private:
- int old_dumpable_;
+ struct sigaction previous_;
};
#endif // BIONIC_TESTS_BIONIC_DEATH_TEST_H_