aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/Android.bp55
-rw-r--r--libc/dns/net/getaddrinfo.c2
-rw-r--r--libc/include/arpa/inet.h1
-rw-r--r--libc/include/bits/in_addr.h3
-rw-r--r--libc/include/inaddr.h36
5 files changed, 85 insertions, 12 deletions
diff --git a/libc/Android.bp b/libc/Android.bp
index 97146aa6f..544a1e0b4 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -119,15 +119,32 @@ cc_defaults {
// warning since this is intended right now.
ldflags: ["-Wl,-z,muldefs"],
- product_variables: {
- malloc_zero_contents: {
- cflags: ["-DSCUDO_ZERO_CONTENTS"],
- },
- malloc_pattern_fill_contents: {
- cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
+ multilib: {
+ lib64: {
+ product_variables: {
+ malloc_zero_contents: {
+ cflags: ["-DSCUDO_ZERO_CONTENTS"],
+ },
+ malloc_pattern_fill_contents: {
+ cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
+ },
+ malloc_not_svelte: {
+ cflags: ["-DUSE_SCUDO"],
+ },
+ },
},
- malloc_not_svelte: {
- cflags: ["-DUSE_SCUDO"],
+ lib32: {
+ product_variables: {
+ malloc_zero_contents: {
+ cflags: ["-DSCUDO_ZERO_CONTENTS"],
+ },
+ malloc_pattern_fill_contents: {
+ cflags: ["-DSCUDO_PATTERN_FILL_CONTENTS"],
+ },
+ malloc_not_svelte_libc32: {
+ cflags: ["-DUSE_SCUDO"],
+ },
+ },
},
},
@@ -147,6 +164,18 @@ libc_scudo_product_variables = {
},
}
+libc32_scudo_product_variables = {
+ malloc_not_svelte_libc32: {
+ cflags: ["-DUSE_SCUDO"],
+ whole_static_libs: ["libscudo"],
+ exclude_static_libs: [
+ "libjemalloc5",
+ "libc_jemalloc_wrapper",
+ ],
+ },
+}
+
+
// Defaults for native allocator libs/includes to make it
// easier to change.
// To disable scudo for the non-svelte config remove the line:
@@ -161,7 +190,14 @@ cc_defaults {
"libc_jemalloc_wrapper",
],
header_libs: ["gwp_asan_headers"],
- product_variables: libc_scudo_product_variables,
+ multilib: {
+ lib64: {
+ product_variables: libc_scudo_product_variables,
+ },
+ lib32: {
+ product_variables: libc32_scudo_product_variables,
+ }
+ },
}
// Functions not implemented by jemalloc directly, or that need to
@@ -1998,6 +2034,7 @@ cc_library {
name: "libstdc++",
static_ndk_lib: true,
static_libs: ["libasync_safe"],
+ vendor_available: true,
static: {
system_shared_libs: [],
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c
index d0c11d2b0..41e159ef7 100644
--- a/libc/dns/net/getaddrinfo.c
+++ b/libc/dns/net/getaddrinfo.c
@@ -385,7 +385,7 @@ static int
_have_ipv4(unsigned mark, uid_t uid) {
static const struct sockaddr_in sin_test = {
.sin_family = AF_INET,
- .sin_addr.s_addr = __constant_htonl(0x08080808L) // 8.8.8.8
+ .sin_addr.s_addr = __constant_htonl(0x01010101L) // 1.1.1.1
};
sockaddr_union addr = { .in = sin_test };
return _find_src_addr(&addr.generic, NULL, mark, uid) == 1;
diff --git a/libc/include/arpa/inet.h b/libc/include/arpa/inet.h
index db054c9e1..7716b9445 100644
--- a/libc/include/arpa/inet.h
+++ b/libc/include/arpa/inet.h
@@ -33,6 +33,7 @@
#include <stdint.h>
#include <sys/cdefs.h>
#include <sys/types.h>
+#include <inaddr.h>
__BEGIN_DECLS
diff --git a/libc/include/bits/in_addr.h b/libc/include/bits/in_addr.h
index 30eb04b66..3e46dad2b 100644
--- a/libc/include/bits/in_addr.h
+++ b/libc/include/bits/in_addr.h
@@ -36,8 +36,7 @@
#include <sys/cdefs.h>
#include <stdint.h>
-/** An integral type representing an IPv4 address. */
-typedef uint32_t in_addr_t;
+#include <inaddr.h>
/** A structure representing an IPv4 address. */
struct in_addr {
diff --git a/libc/include/inaddr.h b/libc/include/inaddr.h
new file mode 100644
index 000000000..524addabf
--- /dev/null
+++ b/libc/include/inaddr.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _INADDR_H_
+#define _INADDR_H_
+
+#include <stdint.h>
+
+typedef uint32_t in_addr_t;
+
+#endif