@@ -51,6 +51,8 @@ libc_common_flags = [
51
51
// Clang's exit-time destructor registration hides __dso_handle, but
52
52
// __dso_handle needs to have default visibility on ARM32. See b/73485611.
53
53
" -Wexit-time-destructors" ,
54
+
55
+ " -DH_MALLOC_PREFIX" ,
54
56
]
55
57
56
58
// Define some common cflags
@@ -64,9 +66,17 @@ cc_defaults {
64
66
cppflags : [],
65
67
include_dirs : [
66
68
" bionic/libc/async_safe/include" ,
67
- " external/jemalloc/include" ,
68
69
],
69
70
71
+ multilib : {
72
+ lib32 : {
73
+ include_dirs : [" external/jemalloc/include" ],
74
+ },
75
+ lib64 : {
76
+ include_dirs : [" external/hardened_malloc/" ],
77
+ },
78
+ },
79
+
70
80
stl : " none" ,
71
81
system_shared_libs : [],
72
82
sanitize : {
@@ -1577,11 +1587,6 @@ cc_library_static {
1577
1587
name : " libc_ndk" ,
1578
1588
defaults : [" libc_defaults" ],
1579
1589
srcs : libc_common_src_files + [" bionic/malloc_common.cpp" ],
1580
- multilib : {
1581
- lib32 : {
1582
- srcs : libc_common_src_files_32,
1583
- },
1584
- },
1585
1590
arch : {
1586
1591
arm : {
1587
1592
srcs : [
@@ -1613,9 +1618,18 @@ cc_library_static {
1613
1618
" libc_syscalls" ,
1614
1619
" libc_tzcode" ,
1615
1620
" libm" ,
1616
- " libjemalloc" ,
1617
1621
" libstdc++" ,
1618
1622
],
1623
+
1624
+ multilib : {
1625
+ lib32 : {
1626
+ srcs : libc_common_src_files_32,
1627
+ whole_static_libs : [" libjemalloc" ],
1628
+ },
1629
+ lib64 : {
1630
+ whole_static_libs : [" libhardened_malloc" ],
1631
+ },
1632
+ },
1619
1633
}
1620
1634
1621
1635
// ========================================================
@@ -1705,7 +1719,11 @@ cc_library_static {
1705
1719
// ========================================================
1706
1720
cc_library_static {
1707
1721
defaults : [" libc_defaults" ],
1708
- srcs : [" bionic/jemalloc_wrapper.cpp" ],
1722
+ multilib : {
1723
+ lib32 : {
1724
+ srcs : [" bionic/jemalloc_wrapper.cpp" ],
1725
+ },
1726
+ },
1709
1727
cflags : [" -fvisibility=hidden" ],
1710
1728
1711
1729
name : " libc_malloc" ,
@@ -1768,9 +1786,17 @@ cc_library {
1768
1786
],
1769
1787
whole_static_libs : [
1770
1788
" libc_common" ,
1771
- " libjemalloc" ,
1772
1789
],
1773
1790
1791
+ multilib : {
1792
+ lib32 : {
1793
+ whole_static_libs : [" libjemalloc" ],
1794
+ },
1795
+ lib64 : {
1796
+ whole_static_libs : [" libhardened_malloc" ],
1797
+ },
1798
+ },
1799
+
1774
1800
nocrt : true ,
1775
1801
1776
1802
arch : {
0 commit comments