Files
hardened_malloc/Android.bp
T

81 lines
1.9 KiB
Plaintext
Raw Normal View History

2018-12-05 01:44:43 -05:00
common_cflags = [
2023-02-17 11:31:26 -05:00
"-pipe",
2018-12-05 01:44:43 -05:00
"-O3",
//"-flto",
"-fPIC",
"-fvisibility=hidden",
//"-fno-plt",
"-Wall",
"-Wextra",
"-Wcast-align",
"-Wcast-qual",
"-Wwrite-strings",
2019-08-18 02:31:05 -04:00
"-Werror",
2018-12-05 01:44:43 -05:00
"-DH_MALLOC_PREFIX",
"-DZERO_ON_FREE=true",
"-DWRITE_AFTER_FREE_CHECK=true",
"-DSLOT_RANDOMIZE=true",
"-DSLAB_CANARY=true",
"-DSLAB_QUARANTINE_RANDOM_LENGTH=1",
"-DSLAB_QUARANTINE_QUEUE_LENGTH=1",
"-DCONFIG_EXTENDED_SIZE_CLASSES=true",
2019-04-07 08:04:06 -04:00
"-DCONFIG_LARGE_SIZE_CLASSES=true",
2018-12-05 01:44:43 -05:00
"-DGUARD_SLABS_INTERVAL=1",
"-DGUARD_SIZE_DIVISOR=2",
"-DREGION_QUARANTINE_RANDOM_LENGTH=256",
"-DREGION_QUARANTINE_QUEUE_LENGTH=1024",
2018-12-05 09:23:05 -05:00
"-DREGION_QUARANTINE_SKIP_THRESHOLD=33554432", // 32MiB
"-DFREE_SLABS_QUARANTINE_RANDOM_LENGTH=32",
"-DCONFIG_CLASS_REGION_SIZE=34359738368", // 32GiB
2019-03-25 14:49:50 -04:00
"-DN_ARENA=1",
2019-04-10 17:12:17 -04:00
"-DCONFIG_STATS=true",
2022-09-14 03:19:23 -04:00
"-DCONFIG_SELF_INIT=false",
2018-12-05 01:44:43 -05:00
]
cc_defaults {
name: "hardened_malloc_defaults",
defaults: ["linux_bionic_supported"],
cflags: common_cflags,
2022-01-13 14:48:56 -05:00
conlyflags: ["-std=c17", "-Wmissing-prototypes"],
2018-12-05 01:44:43 -05:00
stl: "none",
}
lib_src_files = [
"chacha.c",
"h_malloc.c",
"memory.c",
"pages.c",
"random.c",
"util.c",
]
2019-09-07 17:59:08 -04:00
cc_library {
2018-12-05 01:44:43 -05:00
name: "libhardened_malloc",
ramdisk_available: true,
vendor_ramdisk_available: true,
recovery_available: true,
2018-12-05 01:44:43 -05:00
defaults: ["hardened_malloc_defaults"],
srcs: lib_src_files,
2020-09-14 09:10:27 +00:00
export_include_dirs: ["include"],
static_libs: ["libasync_safe"],
2019-09-07 17:59:08 -04:00
target: {
android: {
shared: {
enabled: false,
},
system_shared_libs: [],
},
linux_bionic: {
system_shared_libs: [],
},
},
2019-03-20 14:11:06 -04:00
product_variables: {
debuggable: {
cflags: ["-DLABEL_MEMORY"],
},
},
2022-08-16 13:35:07 +03:00
apex_available: [
"com.android.runtime",
],
2018-12-05 01:44:43 -05:00
}