|
1 | | -From 861e11a69e0e37666dcb02efd2db4459557fc8eb Mon Sep 17 00:00:00 2001 |
| 1 | +From 10135cf2a9d69eda9f516e6db5c768849a68743c Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Andrew Gunnerson <chenxiaolong@cxl.epac.to> |
3 | 3 | Date: Sun, 24 Dec 2017 17:28:48 -0500 |
4 | | -Subject: [PATCH 1/5] Make this NDK buildable |
| 4 | +Subject: [PATCH] Make this NDK buildable |
5 | 5 |
|
6 | 6 | --- |
7 | 7 | bionic_dlmalloc/README.txt | 10 + |
8 | | - bionic_dlmalloc/malloc.c | 6323 +++++++++++++++++++++++++++++ |
9 | | - bionic_dlmalloc/malloc.h | 620 +++ |
10 | | - bionic_include/_system_properties.h | 137 + |
11 | | - bionic_include/set_abort_message.h | 40 + |
12 | | - libcutils/Android.mk | 66 + |
13 | | - liblog/Android.mk | 37 +- |
| 8 | + bionic_dlmalloc/malloc.c | 6323 +++++++++++++++++++++ |
| 9 | + bionic_dlmalloc/malloc.h | 620 ++ |
| 10 | + libcutils/Android.mk | 65 + |
| 11 | + liblog/Android.mk | 36 +- |
14 | 12 | libpixelflinger/Android.mk | 54 +- |
15 | 13 | libpixelflinger/codeflinger/CodeCache.cpp | 2 +- |
16 | 14 | libutils/Android.mk | 45 + |
17 | | - 10 files changed, 7310 insertions(+), 24 deletions(-) |
| 15 | + 8 files changed, 7131 insertions(+), 24 deletions(-) |
18 | 16 | create mode 100644 bionic_dlmalloc/README.txt |
19 | 17 | create mode 100644 bionic_dlmalloc/malloc.c |
20 | 18 | create mode 100644 bionic_dlmalloc/malloc.h |
21 | | - create mode 100644 bionic_include/_system_properties.h |
22 | | - create mode 100644 bionic_include/set_abort_message.h |
23 | 19 | create mode 100644 libcutils/Android.mk |
24 | 20 | create mode 100644 libutils/Android.mk |
25 | 21 |
|
@@ -6994,201 +6990,12 @@ index 000000000..e52c9e5a4 |
6994 | 6990 | +#endif |
6995 | 6991 | + |
6996 | 6992 | +#endif /* MALLOC_280_H */ |
6997 | | -diff --git a/bionic_include/_system_properties.h b/bionic_include/_system_properties.h |
6998 | | -new file mode 100644 |
6999 | | -index 000000000..f8dbd3305 |
7000 | | ---- /dev/null |
7001 | | -+++ b/bionic_include/_system_properties.h |
7002 | | -@@ -0,0 +1,137 @@ |
7003 | | -+/* |
7004 | | -+ * Copyright (C) 2008 The Android Open Source Project |
7005 | | -+ * All rights reserved. |
7006 | | -+ * |
7007 | | -+ * Redistribution and use in source and binary forms, with or without |
7008 | | -+ * modification, are permitted provided that the following conditions |
7009 | | -+ * are met: |
7010 | | -+ * * Redistributions of source code must retain the above copyright |
7011 | | -+ * notice, this list of conditions and the following disclaimer. |
7012 | | -+ * * Redistributions in binary form must reproduce the above copyright |
7013 | | -+ * notice, this list of conditions and the following disclaimer in |
7014 | | -+ * the documentation and/or other materials provided with the |
7015 | | -+ * distribution. |
7016 | | -+ * |
7017 | | -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
7018 | | -+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
7019 | | -+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
7020 | | -+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
7021 | | -+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
7022 | | -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
7023 | | -+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
7024 | | -+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
7025 | | -+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
7026 | | -+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
7027 | | -+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
7028 | | -+ * SUCH DAMAGE. |
7029 | | -+ */ |
7030 | | -+ |
7031 | | -+#ifndef _INCLUDE_SYS__SYSTEM_PROPERTIES_H |
7032 | | -+#define _INCLUDE_SYS__SYSTEM_PROPERTIES_H |
7033 | | -+ |
7034 | | -+#include <sys/cdefs.h> |
7035 | | -+#include <stdint.h> |
7036 | | -+ |
7037 | | -+#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ |
7038 | | -+#error you should #include <sys/system_properties.h> instead |
7039 | | -+#endif |
7040 | | -+ |
7041 | | -+#include <sys/system_properties.h> |
7042 | | -+ |
7043 | | -+__BEGIN_DECLS |
7044 | | -+ |
7045 | | -+#define PROP_SERVICE_NAME "property_service" |
7046 | | -+#define PROP_FILENAME "/dev/__properties__" |
7047 | | -+ |
7048 | | -+#define PROP_MSG_SETPROP 1 |
7049 | | -+#define PROP_MSG_SETPROP2 0x00020001 |
7050 | | -+ |
7051 | | -+#define PROP_SUCCESS 0 |
7052 | | -+#define PROP_ERROR_READ_CMD 0x0004 |
7053 | | -+#define PROP_ERROR_READ_DATA 0x0008 |
7054 | | -+#define PROP_ERROR_READ_ONLY_PROPERTY 0x000B |
7055 | | -+#define PROP_ERROR_INVALID_NAME 0x0010 |
7056 | | -+#define PROP_ERROR_INVALID_VALUE 0x0014 |
7057 | | -+#define PROP_ERROR_PERMISSION_DENIED 0x0018 |
7058 | | -+#define PROP_ERROR_INVALID_CMD 0x001B |
7059 | | -+#define PROP_ERROR_HANDLE_CONTROL_MESSAGE 0x0020 |
7060 | | -+#define PROP_ERROR_SET_FAILED 0x0024 |
7061 | | -+ |
7062 | | -+/* |
7063 | | -+** Map the property area from the specified filename. This |
7064 | | -+** method is for testing only. |
7065 | | -+*/ |
7066 | | -+int __system_property_set_filename(const char *filename); |
7067 | | -+ |
7068 | | -+/* |
7069 | | -+** Initialize the area to be used to store properties. Can |
7070 | | -+** only be done by a single process that has write access to |
7071 | | -+** the property area. |
7072 | | -+*/ |
7073 | | -+int __system_property_area_init(); |
7074 | | -+ |
7075 | | -+/* Read the global serial number of the system properties |
7076 | | -+** |
7077 | | -+** Called to predict if a series of cached __system_property_find |
7078 | | -+** objects will have seen __system_property_serial values change. |
7079 | | -+** But also aids the converse, as changes in the global serial can |
7080 | | -+** also be used to predict if a failed __system_property_find |
7081 | | -+** could in-turn now find a new object; thus preventing the |
7082 | | -+** cycles of effort to poll __system_property_find. |
7083 | | -+** |
7084 | | -+** Typically called at beginning of a cache cycle to signal if _any_ possible |
7085 | | -+** changes have occurred since last. If there is, one may check each individual |
7086 | | -+** __system_property_serial to confirm dirty, or __system_property_find |
7087 | | -+** to check if the property now exists. If a call to __system_property_add |
7088 | | -+** or __system_property_update has completed between two calls to |
7089 | | -+** __system_property_area_serial then the second call will return a larger |
7090 | | -+** value than the first call. Beware of race conditions as changes to the |
7091 | | -+** properties are not atomic, the main value of this call is to determine |
7092 | | -+** whether the expensive __system_property_find is worth retrying to see if |
7093 | | -+** a property now exists. |
7094 | | -+** |
7095 | | -+** Returns the serial number on success, -1 on error. |
7096 | | -+*/ |
7097 | | -+uint32_t __system_property_area_serial(); |
7098 | | -+ |
7099 | | -+/* Add a new system property. Can only be done by a single |
7100 | | -+** process that has write access to the property area, and |
7101 | | -+** that process must handle sequencing to ensure the property |
7102 | | -+** does not already exist and that only one property is added |
7103 | | -+** or updated at a time. |
7104 | | -+** |
7105 | | -+** Returns 0 on success, -1 if the property area is full. |
7106 | | -+*/ |
7107 | | -+int __system_property_add(const char *name, unsigned int namelen, const char *value, unsigned int valuelen); |
7108 | | -+ |
7109 | | -+/* Update the value of a system property returned by |
7110 | | -+** __system_property_find. Can only be done by a single process |
7111 | | -+** that has write access to the property area, and that process |
7112 | | -+** must handle sequencing to ensure that only one property is |
7113 | | -+** updated at a time. |
7114 | | -+** |
7115 | | -+** Returns 0 on success, -1 if the parameters are incorrect. |
7116 | | -+*/ |
7117 | | -+int __system_property_update(prop_info *pi, const char *value, unsigned int len); |
7118 | | -+ |
7119 | | -+/* Read the serial number of a system property returned by |
7120 | | -+** __system_property_find. |
7121 | | -+** |
7122 | | -+** Returns the serial number on success, -1 on error. |
7123 | | -+*/ |
7124 | | -+uint32_t __system_property_serial(const prop_info* pi); |
7125 | | -+ |
7126 | | -+/* Initialize the system properties area in read only mode. |
7127 | | -+ * Should be done by all processes that need to read system |
7128 | | -+ * properties. |
7129 | | -+ * |
7130 | | -+ * Returns 0 on success, -1 otherwise. |
7131 | | -+ */ |
7132 | | -+int __system_properties_init(); |
7133 | | -+ |
7134 | | -+/* Deprecated: use __system_property_wait instead. */ |
7135 | | -+uint32_t __system_property_wait_any(uint32_t old_serial); |
7136 | | -+ |
7137 | | -+__END_DECLS |
7138 | | -+ |
7139 | | -+#endif |
7140 | | -diff --git a/bionic_include/set_abort_message.h b/bionic_include/set_abort_message.h |
7141 | | -new file mode 100644 |
7142 | | -index 000000000..18881a3a3 |
7143 | | ---- /dev/null |
7144 | | -+++ b/bionic_include/set_abort_message.h |
7145 | | -@@ -0,0 +1,40 @@ |
7146 | | -+/* |
7147 | | -+ * Copyright (C) 2014 The Android Open Source Project |
7148 | | -+ * All rights reserved. |
7149 | | -+ * |
7150 | | -+ * Redistribution and use in source and binary forms, with or without |
7151 | | -+ * modification, are permitted provided that the following conditions |
7152 | | -+ * are met: |
7153 | | -+ * * Redistributions of source code must retain the above copyright |
7154 | | -+ * notice, this list of conditions and the following disclaimer. |
7155 | | -+ * * Redistributions in binary form must reproduce the above copyright |
7156 | | -+ * notice, this list of conditions and the following disclaimer in |
7157 | | -+ * the documentation and/or other materials provided with the |
7158 | | -+ * distribution. |
7159 | | -+ * |
7160 | | -+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
7161 | | -+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
7162 | | -+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
7163 | | -+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
7164 | | -+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
7165 | | -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
7166 | | -+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
7167 | | -+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
7168 | | -+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
7169 | | -+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
7170 | | -+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
7171 | | -+ * SUCH DAMAGE. |
7172 | | -+ */ |
7173 | | -+ |
7174 | | -+#ifndef _SET_ABORT_MESSAGE_H |
7175 | | -+#define _SET_ABORT_MESSAGE_H |
7176 | | -+ |
7177 | | -+#include <sys/cdefs.h> |
7178 | | -+ |
7179 | | -+__BEGIN_DECLS |
7180 | | -+ |
7181 | | -+void android_set_abort_message(const char* msg) __INTRODUCED_IN(21); |
7182 | | -+ |
7183 | | -+__END_DECLS |
7184 | | -+ |
7185 | | -+#endif |
7186 | 6993 | diff --git a/libcutils/Android.mk b/libcutils/Android.mk |
7187 | 6994 | new file mode 100644 |
7188 | | -index 000000000..f84f6862c |
| 6995 | +index 000000000..d3e055037 |
7189 | 6996 | --- /dev/null |
7190 | 6997 | +++ b/libcutils/Android.mk |
7191 | | -@@ -0,0 +1,66 @@ |
| 6998 | +@@ -0,0 +1,65 @@ |
7192 | 6999 | +LOCAL_PATH := $(my-dir) |
7193 | 7000 | + |
7194 | 7001 | +include $(CLEAR_VARS) |
@@ -7248,18 +7055,17 @@ index 000000000..f84f6862c |
7248 | 7055 | +LOCAL_C_INCLUDES := \ |
7249 | 7056 | + include \ |
7250 | 7057 | + ../liblog/include \ |
7251 | | -+ ../libutils/include \ |
7252 | | -+ ../bionic_include |
| 7058 | ++ ../libutils/include |
7253 | 7059 | +LOCAL_STATIC_LIBRARIES := liblog |
7254 | 7060 | +LOCAL_CFLAGS := -Werror -Wall -Wextra |
7255 | 7061 | +LOCAL_CONLYFLAGS := -std=gnu90 |
7256 | 7062 | +LOCAL_CPPFLAGS := -std=gnu++11 |
7257 | 7063 | +include $(BUILD_STATIC_LIBRARY) |
7258 | 7064 | diff --git a/liblog/Android.mk b/liblog/Android.mk |
7259 | | -index 6c4dff595..deb0e9cbb 100644 |
| 7065 | +index 6c4dff595..7098143aa 100644 |
7260 | 7066 | --- a/liblog/Android.mk |
7261 | 7067 | +++ b/liblog/Android.mk |
7262 | | -@@ -1,3 +1,38 @@ |
| 7068 | +@@ -1,3 +1,37 @@ |
7263 | 7069 | LOCAL_PATH := $(my-dir) |
7264 | 7070 |
|
7265 | 7071 | -include $(call first-makefiles-under,$(LOCAL_PATH)) |
@@ -7290,8 +7096,7 @@ index 6c4dff595..deb0e9cbb 100644 |
7290 | 7096 | + include \ |
7291 | 7097 | + ../libcutils/include \ |
7292 | 7098 | + ../libsystem/include \ |
7293 | | -+ ../libutils/include \ |
7294 | | -+ ../bionic_include |
| 7099 | ++ ../libutils/include |
7295 | 7100 | +LOCAL_CFLAGS := \ |
7296 | 7101 | + -Werror \ |
7297 | 7102 | + -fvisibility=hidden \ |
@@ -7455,5 +7260,5 @@ index 000000000..634bb955b |
7455 | 7260 | + ../common/safe-iop/include |
7456 | 7261 | +include $(BUILD_STATIC_LIBRARY) |
7457 | 7262 | -- |
7458 | | -2.14.3 |
| 7263 | +2.17.1 |
7459 | 7264 |
|
0 commit comments