Merge changes I93dc3811,I710d2929,I6ae029ed
am: d4b4f06cad
Change-Id: Ie8d3b78f8195668d0a1cdd3ba80a44c480251e5d
This commit is contained in:
commit
9a0a7b3f5c
4 changed files with 40 additions and 21 deletions
|
@ -21,7 +21,6 @@ libc_common_src_files = [
|
||||||
"stdio/stdio_ext.cpp",
|
"stdio/stdio_ext.cpp",
|
||||||
"stdio/vfscanf.c",
|
"stdio/vfscanf.c",
|
||||||
"stdio/vfwscanf.c",
|
"stdio/vfwscanf.c",
|
||||||
"stdlib/atexit.c",
|
|
||||||
"stdlib/exit.c",
|
"stdlib/exit.c",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -887,11 +886,6 @@ cc_library_static {
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
defaults: ["libc_defaults"],
|
defaults: ["libc_defaults"],
|
||||||
srcs: [
|
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
|
// The data that backs getauxval is initialized in the libc init
|
||||||
// functions which are invoked by the linker. If this file is included
|
// 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
|
// in libc_ndk.a, only one of the copies of the global data will be
|
||||||
|
@ -1396,7 +1390,6 @@ cc_library_static {
|
||||||
"bionic/__gnu_basename.cpp",
|
"bionic/__gnu_basename.cpp",
|
||||||
"bionic/__libc_current_sigrtmax.cpp",
|
"bionic/__libc_current_sigrtmax.cpp",
|
||||||
"bionic/__libc_current_sigrtmin.cpp",
|
"bionic/__libc_current_sigrtmin.cpp",
|
||||||
"bionic/__set_errno.cpp",
|
|
||||||
"bionic/abort.cpp",
|
"bionic/abort.cpp",
|
||||||
"bionic/accept.cpp",
|
"bionic/accept.cpp",
|
||||||
"bionic/accept4.cpp",
|
"bionic/accept4.cpp",
|
||||||
|
@ -1565,6 +1558,10 @@ cc_library_static {
|
||||||
"bionic/wctype.cpp",
|
"bionic/wctype.cpp",
|
||||||
"bionic/wcwidth.cpp",
|
"bionic/wcwidth.cpp",
|
||||||
"bionic/wmempcpy.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: {
|
multilib: {
|
||||||
|
@ -1619,6 +1616,12 @@ cc_library_static {
|
||||||
"bionic/pthread_setschedparam.cpp",
|
"bionic/pthread_setschedparam.cpp",
|
||||||
"bionic/pthread_sigmask.cpp",
|
"bionic/pthread_sigmask.cpp",
|
||||||
"bionic/pthread_spinlock.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"],
|
cppflags: ["-Wold-style-cast"],
|
||||||
|
@ -1632,6 +1635,7 @@ cc_library_static {
|
||||||
|
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
defaults: ["libc_defaults"],
|
defaults: ["libc_defaults"],
|
||||||
|
srcs: ["bionic/__set_errno.cpp"],
|
||||||
arch: {
|
arch: {
|
||||||
arm: {
|
arm: {
|
||||||
srcs: ["arch-arm/syscalls/**/*.S"],
|
srcs: ["arch-arm/syscalls/**/*.S"],
|
||||||
|
@ -1731,9 +1735,8 @@ cc_library_static {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================
|
// ========================================================
|
||||||
// libc_common.a
|
// libc_nopthread.a
|
||||||
// ========================================================
|
// ========================================================
|
||||||
|
|
||||||
cc_library_static {
|
cc_library_static {
|
||||||
defaults: ["libc_defaults"],
|
defaults: ["libc_defaults"],
|
||||||
srcs: libc_common_src_files,
|
srcs: libc_common_src_files,
|
||||||
|
@ -1742,7 +1745,7 @@ cc_library_static {
|
||||||
srcs: libc_common_src_files_32,
|
srcs: libc_common_src_files_32,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
name: "libc_common",
|
name: "libc_nopthread",
|
||||||
|
|
||||||
whole_static_libs: [
|
whole_static_libs: [
|
||||||
"libc_bionic",
|
"libc_bionic",
|
||||||
|
@ -1757,7 +1760,6 @@ cc_library_static {
|
||||||
"libc_openbsd",
|
"libc_openbsd",
|
||||||
"libc_openbsd_large_stack",
|
"libc_openbsd_large_stack",
|
||||||
"libc_openbsd_ndk",
|
"libc_openbsd_ndk",
|
||||||
"libc_pthread",
|
|
||||||
"libc_stack_protector",
|
"libc_stack_protector",
|
||||||
"libc_syscalls",
|
"libc_syscalls",
|
||||||
"libc_tzcode",
|
"libc_tzcode",
|
||||||
|
@ -1771,6 +1773,20 @@ cc_library_static {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// libc_common.a
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
cc_library_static {
|
||||||
|
defaults: ["libc_defaults"],
|
||||||
|
name: "libc_common",
|
||||||
|
|
||||||
|
whole_static_libs: [
|
||||||
|
"libc_nopthread",
|
||||||
|
"libc_pthread",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================================
|
// ========================================================
|
||||||
// libc_nomalloc.a
|
// libc_nomalloc.a
|
||||||
// ========================================================
|
// ========================================================
|
||||||
|
@ -1825,7 +1841,6 @@ cc_library {
|
||||||
static: {
|
static: {
|
||||||
srcs: [
|
srcs: [
|
||||||
"bionic/dl_iterate_phdr_static.cpp",
|
"bionic/dl_iterate_phdr_static.cpp",
|
||||||
"bionic/icu_static.cpp",
|
|
||||||
"bionic/malloc_common.cpp",
|
"bionic/malloc_common.cpp",
|
||||||
],
|
],
|
||||||
cflags: ["-DLIBC_STATIC"],
|
cflags: ["-DLIBC_STATIC"],
|
||||||
|
|
|
@ -92,7 +92,7 @@ int async_safe_format_buffer_va_list(char* buffer, size_t buffer_size, const cha
|
||||||
|
|
||||||
int async_safe_format_fd(int fd, const char* format , ...) __printflike(2, 3);
|
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(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);
|
int async_safe_write_log(int pri, const char* tag, const char* msg);
|
||||||
|
|
||||||
#define CHECK(predicate) \
|
#define CHECK(predicate) \
|
||||||
|
|
|
@ -29,6 +29,6 @@
|
||||||
#include "private/icu.h"
|
#include "private/icu.h"
|
||||||
|
|
||||||
// We don't have dlopen/dlsym for static binaries yet.
|
// 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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,25 +17,29 @@
|
||||||
#ifndef BIONIC_TESTS_BIONIC_DEATH_TEST_H_
|
#ifndef BIONIC_TESTS_BIONIC_DEATH_TEST_H_
|
||||||
#define 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 {
|
class BionicDeathTest : public testing::Test {
|
||||||
protected:
|
protected:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
// Suppress debuggerd stack traces. Too slow.
|
// Suppress debuggerd stack traces. Too slow.
|
||||||
old_dumpable_ = prctl(PR_GET_DUMPABLE, 0, 0, 0, 0);
|
for (int signo : { SIGABRT, SIGBUS, SIGSEGV, SIGSYS }) {
|
||||||
prctl(PR_SET_DUMPABLE, 0, 0, 0, 0);
|
struct sigaction action = {};
|
||||||
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
action.sa_handler = SIG_DFL;
|
||||||
|
sigaction(signo, &action, &previous_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void TearDown() {
|
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:
|
private:
|
||||||
int old_dumpable_;
|
struct sigaction previous_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BIONIC_TESTS_BIONIC_DEATH_TEST_H_
|
#endif // BIONIC_TESTS_BIONIC_DEATH_TEST_H_
|
||||||
|
|
Loading…
Reference in a new issue