aboutsummaryrefslogtreecommitdiffstats
path: root/Android.bp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-08-27 14:40:30 -0700
committerChristopher Ferris <cferris@google.com>2018-09-06 13:08:46 -0700
commit7eecc47efac8cef90e806aca2758ef0fca63cf7a (patch)
tree59613c4bb23fd14729b92618fd17f0e11ee42668 /Android.bp
parent4c5028eda455ccc3462b5cdf086780a81a2a7b39 (diff)
downloadplatform_external_jemalloc_new-7eecc47efac8cef90e806aca2758ef0fca63cf7a.tar.gz
platform_external_jemalloc_new-7eecc47efac8cef90e806aca2758ef0fca63cf7a.tar.bz2
platform_external_jemalloc_new-7eecc47efac8cef90e806aca2758ef0fca63cf7a.zip
Add bp file and generated files.
This does not add any android specific changes. Those will come in a follow-up cl. Test: Builds, and all unit tests pass on a hikey. Change-Id: Ibac11b324afeac93a0c93d19689be48458d56f56
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp336
1 files changed, 336 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..2746ed4a
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,336 @@
+//
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+common_cflags = [
+ "-D_GNU_SOURCE",
+ "-D_REENTRANT",
+ "-Wall",
+ "-Wshorten-64-to-32",
+ "-Wsign-compare",
+ "-Wundef",
+ "-Wno-format-zero-length",
+ "-pipe",
+ "-g3",
+ "-fvisibility=hidden",
+ "-O3",
+ "-funroll-loops",
+ "-Wno-unused-parameter",
+ "-Wno-missing-field-initializers",
+ "-U_FORTIFY_SOURCE",
+]
+
+common_c_local_includes = [
+ "src",
+ "include",
+]
+
+cc_defaults {
+ name: "jemalloc5_defaults",
+ defaults: ["linux_bionic_supported"],
+ cflags: common_cflags,
+
+ local_include_dirs: common_c_local_includes,
+ stl: "none",
+}
+
+lib_src_files = [
+ "src/jemalloc.c",
+ "src/arena.c",
+ "src/background_thread.c",
+ "src/base.c",
+ "src/bin.c",
+ "src/bitmap.c",
+ "src/ckh.c",
+ "src/ctl.c",
+ "src/div.c",
+ "src/extent.c",
+ "src/extent_dss.c",
+ "src/extent_mmap.c",
+ "src/hash.c",
+ "src/hooks.c",
+ "src/large.c",
+ "src/log.c",
+ "src/malloc_io.c",
+ "src/mutex.c",
+ "src/mutex_pool.c",
+ "src/nstime.c",
+ "src/pages.c",
+ "src/prng.c",
+ "src/prof.c",
+ "src/rtree.c",
+ "src/stats.c",
+ "src/sz.c",
+ "src/tcache.c",
+ "src/ticker.c",
+ "src/tsd.c",
+ "src/witness.c",
+]
+
+//-----------------------------------------------------------------------
+// jemalloc static library
+//-----------------------------------------------------------------------
+cc_library_static {
+ name: "libjemalloc5",
+ recovery_available: true,
+
+ defaults: ["jemalloc5_defaults"],
+
+ srcs: lib_src_files,
+}
+
+//-----------------------------------------------------------------------
+// jemalloc static jet library
+//-----------------------------------------------------------------------
+cc_library_static {
+ name: "libjemalloc5_jet",
+
+ defaults: ["jemalloc5_defaults"],
+
+ cflags: [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_JET",
+ ],
+
+ srcs: lib_src_files,
+}
+
+jemalloc5_testlib_srcs = [
+ "test/src/btalloc.c",
+ "test/src/btalloc_0.c",
+ "test/src/btalloc_1.c",
+ "test/src/math.c",
+ "test/src/mtx.c",
+ "test/src/mq.c",
+ "test/src/SFMT.c",
+ "test/src/test.c",
+ "test/src/thd.c",
+ "test/src/timer.c",
+]
+
+//-----------------------------------------------------------------------
+// jemalloc unit test library
+//-----------------------------------------------------------------------
+cc_library_static {
+ name: "libjemalloc5_unittest",
+
+ defaults: ["jemalloc5_defaults"],
+
+ cflags: [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_UNIT_TEST",
+ ],
+
+ local_include_dirs: [
+ "test/include",
+ ],
+
+ srcs: jemalloc5_testlib_srcs,
+
+ whole_static_libs: ["libjemalloc5_jet"],
+}
+
+//-----------------------------------------------------------------------
+// jemalloc unit tests
+//-----------------------------------------------------------------------
+unit_tests = [
+ "test/unit/a0.c",
+ "test/unit/arena_reset.c",
+ "test/unit/atomic.c",
+ "test/unit/background_thread.c",
+ "test/unit/background_thread_enable.c",
+ "test/unit/base.c",
+ "test/unit/bitmap.c",
+ "test/unit/ckh.c",
+ "test/unit/decay.c",
+ "test/unit/div.c",
+ "test/unit/emitter.c",
+ "test/unit/extent_quantize.c",
+ "test/unit/fork.c",
+ "test/unit/hash.c",
+ "test/unit/hooks.c",
+ "test/unit/junk.c",
+ "test/unit/junk_alloc.c",
+ "test/unit/junk_free.c",
+ "test/unit/log.c",
+ "test/unit/mallctl.c",
+ "test/unit/malloc_io.c",
+ "test/unit/math.c",
+ "test/unit/mq.c",
+ "test/unit/mtx.c",
+ "test/unit/pack.c",
+ "test/unit/pages.c",
+ "test/unit/ph.c",
+ "test/unit/prng.c",
+ "test/unit/prof_accum.c",
+ "test/unit/prof_active.c",
+ "test/unit/prof_gdump.c",
+ "test/unit/prof_idump.c",
+ "test/unit/prof_reset.c",
+ "test/unit/prof_tctx.c",
+ "test/unit/prof_thread_name.c",
+ "test/unit/ql.c",
+ "test/unit/qr.c",
+ "test/unit/rb.c",
+ "test/unit/retained.c",
+ "test/unit/rtree.c",
+ "test/unit/SFMT.c",
+ "test/unit/size_classes.c",
+ "test/unit/slab.c",
+ "test/unit/smoothstep.c",
+ "test/unit/spin.c",
+ "test/unit/stats.c",
+ "test/unit/stats_print.c",
+ "test/unit/ticker.c",
+ "test/unit/nstime.c",
+ "test/unit/tsd.c",
+ "test/unit/witness.c",
+ "test/unit/zero.c",
+]
+
+cc_test {
+ name: "jemalloc5_unittests",
+
+ gtest: false,
+
+ cflags: common_cflags + [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_UNIT_TEST",
+ ],
+
+ local_include_dirs: common_c_local_includes + [
+ "test/include",
+ ],
+
+ srcs: unit_tests,
+
+ static_libs: ["libjemalloc5_unittest"],
+
+ test_per_src: true,
+}
+
+//-----------------------------------------------------------------------
+// jemalloc integration test library
+//-----------------------------------------------------------------------
+cc_library_static {
+ name: "libjemalloc5_integrationtest",
+
+ defaults: ["jemalloc5_defaults"],
+
+ cflags: [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_INTEGRATION_TEST",
+ ],
+
+ local_include_dirs: [
+ "test/include",
+ ],
+
+ srcs: jemalloc5_testlib_srcs + lib_src_files,
+}
+
+//-----------------------------------------------------------------------
+// jemalloc integration tests
+//-----------------------------------------------------------------------
+integration_tests = [
+ "test/integration/aligned_alloc.c",
+ "test/integration/allocated.c",
+ "test/integration/extent.c",
+ "test/integration/mallocx.c",
+ "test/integration/MALLOCX_ARENA.c",
+ "test/integration/overflow.c",
+ "test/integration/posix_memalign.c",
+ "test/integration/rallocx.c",
+ "test/integration/sdallocx.c",
+ "test/integration/thread_arena.c",
+ "test/integration/xallocx.c",
+ "test/integration/cpp/basic.cpp",
+]
+
+cc_test {
+ name: "jemalloc5_integrationtests",
+
+ gtest: false,
+
+ cflags: common_cflags + [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_INTEGRATION_TEST",
+ ],
+
+ local_include_dirs: common_c_local_includes + [
+ "test/include",
+ ],
+
+ srcs: integration_tests,
+
+ static_libs: ["libjemalloc5_integrationtest"],
+
+ test_per_src: true,
+}
+
+//-----------------------------------------------------------------------
+// jemalloc stress test library
+//-----------------------------------------------------------------------
+cc_library_static {
+ name: "libjemalloc5_stresstestlib",
+
+ defaults: ["jemalloc5_defaults"],
+
+ cflags: [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_STRESS_TEST",
+ "-DJEMALLOC_STRESS_TESTLIB",
+ ],
+
+ local_include_dirs: [
+ "test/include",
+ ],
+
+ srcs: jemalloc5_testlib_srcs,
+}
+
+//-----------------------------------------------------------------------
+// jemalloc stress tests
+//-----------------------------------------------------------------------
+// All tests are in the same order as in the original jemalloc Makefile
+// to make it easier to track changes.
+stress_tests = [
+ "test/stress/microbench.c",
+]
+
+cc_test {
+ name: "jemalloc5_stresstests",
+
+ gtest: false,
+
+ cflags: common_cflags + [
+ "-U_FORTIFY_SOURCE",
+ "-DJEMALLOC_STRESS_TEST",
+ ],
+
+ local_include_dirs: common_c_local_includes + [
+ "test/include",
+ ],
+
+ srcs: stress_tests,
+
+ static_libs: [
+ "libjemalloc5",
+ "libjemalloc5_stresstestlib",
+ "libjemalloc5_jet",
+ ],
+
+ test_per_src: true,
+}