From 3e2930b565a78dacb336015a60b4750a3e4fd082 Mon Sep 17 00:00:00 2001 From: Luis Hector Chavez Date: Fri, 3 Nov 2017 16:22:05 -0700 Subject: [PATCH] libcutils: Work around the lack of __mulodi4 The parent change ran into an issue where enabling UBSan on an i686 build caused it to use __mulodi4. https://github.com/android-ndk/ndk/issues/184 documents linking against libclang_rt.builtins-i686.a, but that's not available from soong either. Bug: 62378620 Test: x86 builds work again Change-Id: I730d59558aa4ed28f8a11b5393e037111e320f29 --- libcutils/Android.bp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/libcutils/Android.bp b/libcutils/Android.bp index f4833086736..faaad0c20d2 100644 --- a/libcutils/Android.bp +++ b/libcutils/Android.bp @@ -114,23 +114,32 @@ cc_library { "trace-dev.c", "uevent.cpp", ], - sanitize: { - misc_undefined: ["integer"], - }, }, android_arm: { srcs: ["arch-arm/memset32.S"], + sanitize: { + misc_undefined: ["integer"], + }, }, android_arm64: { srcs: ["arch-arm64/android_memset.S"], + sanitize: { + misc_undefined: ["integer"], + }, }, android_mips: { srcs: ["arch-mips/android_memset.c"], + sanitize: { + misc_undefined: ["integer"], + }, }, android_mips64: { srcs: ["arch-mips/android_memset.c"], + sanitize: { + misc_undefined: ["integer"], + }, }, android_x86: { @@ -138,6 +147,12 @@ cc_library { "arch-x86/android_memset16.S", "arch-x86/android_memset32.S", ], + // TODO: This is to work around b/29412086. + // Remove once __mulodi4 is available and move the "sanitize" block + // to the android target. + sanitize: { + misc_undefined: [], + }, }, android_x86_64: { @@ -145,6 +160,9 @@ cc_library { "arch-x86_64/android_memset16.S", "arch-x86_64/android_memset32.S", ], + sanitize: { + misc_undefined: ["integer"], + }, }, },