diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake --- a/compiler-rt/cmake/config-ix.cmake +++ b/compiler-rt/cmake/config-ix.cmake @@ -765,9 +765,9 @@ set(COMPILER_RT_HAS_CFI FALSE) endif() -#TODO(kostyak): add back Android & Fuchsia when the code settles a bit. -if (SCUDO_STANDALONE_SUPPORTED_ARCH AND OS_NAME MATCHES "Linux" AND - COMPILER_RT_HAS_AUXV) +if (SCUDO_STANDALONE_SUPPORTED_ARCH AND ( + (OS_NAME MATCHES "Fuchsia") OR + (OS_NAME MATCHES "Linux|Android" AND COMPILER_RT_HAS_AUXV))) set(COMPILER_RT_HAS_SCUDO_STANDALONE TRUE) else() set(COMPILER_RT_HAS_SCUDO_STANDALONE FALSE) diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt @@ -38,10 +38,8 @@ append_list_if(COMPILER_RT_HAS_NOSTDLIBXX_FLAG -nostdlib++ SCUDO_LINK_FLAGS) if(ANDROID) - list(APPEND SCUDO_CFLAGS -fno-emulated-tls) - -# Put the shared library in the global group. For more details, see -# android-changes-for-ndk-developers.md#changes-to-library-search-order + # Put the shared library in the global group. For more details, see + # android-changes-for-ndk-developers.md#changes-to-library-search-order append_list_if(COMPILER_RT_HAS_Z_GLOBAL -Wl,-z,global SCUDO_LINK_FLAGS) endif() diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt @@ -21,10 +21,6 @@ list(APPEND SCUDO_UNITTEST_CFLAGS -DSCUDO_DEBUG=1) endif() -if(ANDROID) - list(APPEND SCUDO_UNITTEST_CFLAGS -fno-emulated-tls) -endif() - if (COMPILER_RT_HAS_GWP_ASAN) list(APPEND SCUDO_UNITTEST_CFLAGS -DGWP_ASAN_HOOKS -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer) diff --git a/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp b/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp --- a/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/wrappers_c_test.cpp @@ -23,6 +23,9 @@ void *arg); void *valloc(size_t size); void *pvalloc(size_t size); +void *memalign(size_t alignment, size_t size); +void *aligned_alloc(size_t alignment, size_t size); +int mallopt(int param, int value); } // Note that every C allocation function in the test binary will be fulfilled