platform_bionic/libc/malloc_hooks/Android.bp
Stephen Hines 1c33c4a263 Work around issues with aligned_alloc() and -O2.
The latest LLVM update to r399163 has exposed an issue with optimization
of `aligned_alloc()` at -O2. Invalid inputs are treated as valid, which
results in assertions being hit. This WAR is to make sure that the test
keeps running while we fix the issue upstream.

Bug: http://b/169206016
Bug: http://b/155835175
Test: atest malloc_hooks_system_tests:malloc_hooks_system_tests.MallocHooksTest#aligned_alloc_hook_error -- --abi x86
Change-Id: I74b290b73826481c62db3a99ac1a690c8a8a8db3
2020-09-24 17:17:57 -07:00

76 lines
1.5 KiB
Text

// ==============================================================
// libc_malloc_hooks.so
// ==============================================================
cc_library {
name: "libc_malloc_hooks",
srcs: [
"malloc_hooks.cpp",
],
static_libs: [
"libasync_safe",
],
multilib: {
lib32: {
version_script: "exported32.map",
},
lib64: {
version_script: "exported64.map",
},
},
include_dirs: ["bionic/libc"],
sanitize: {
never: true,
},
native_coverage: false,
cflags: [
"-Wall",
"-Werror",
"-fno-stack-protector",
],
apex_available: [
"com.android.runtime",
],
static: {
apex_available: [
"//apex_available:platform",
],
},
}
// ==============================================================
// Unit Tests
// ==============================================================
cc_test {
name: "malloc_hooks_system_tests",
isolated: true,
srcs: [
"tests/malloc_hooks_tests.cpp",
],
whole_static_libs: ["libc_malloc_hooks"],
shared_libs: ["libbase"],
local_include_dirs: ["tests"],
include_dirs: [
"bionic/libc",
"bionic"
],
header_libs: [
"bionic_libc_platform_headers",
],
cflags: [
"-Wall",
"-Werror",
"-O1", // FIXME: http://b/169206016 - issues with aligned_alloc and -O2
],
test_suites: ["general-tests"],
}