Properly set up Android NDK toolchains in tests.
@@ -59,7 +59,10 @@ public final class BazelMockAndroidSupport {
Pair.of("objdump", "x86/bin/i686-linux-android-objdump"),
Pair.of("strip", "x86/bin/i686-linux-android-strip"),
Pair.of("ld-bfd", "x86/bin/i686-linux-android-ld.bfd"),
- Pair.of("ld-gold", "x86/bin/i686-linux-android-ld.gold"));
+ Pair.of("ld-gold", "x86/bin/i686-linux-android-ld.gold"))
+ .withToolchainTargetConstraints(
+ TestConstants.CONSTRAINTS_PACKAGE_ROOT + "cpu:x86_32",
+ TestConstants.CONSTRAINTS_PACKAGE_ROOT + "os:android");
}
public static CcToolchainConfig.Builder armeabiV7a() {
@@ -84,7 +87,10 @@ public final class BazelMockAndroidSupport {
Pair.of("objdump", "arm/bin/arm-linux-androideabi-objdump"),
Pair.of("strip", "arm/bin/arm-linux-androideabi-strip"),
Pair.of("ld-bfd", "arm/bin/arm-linux-androideabi-ld.bfd"),
- Pair.of("ld-gold", "arm/bin/arm-linux-androideabi-ld.gold"));
+ Pair.of("ld-gold", "arm/bin/arm-linux-androideabi-ld.gold"))
+ .withToolchainTargetConstraints(
+ TestConstants.CONSTRAINTS_PACKAGE_ROOT + "cpu:arm",
+ TestConstants.CONSTRAINTS_PACKAGE_ROOT + "os:android");
}
public static void setupPlatformResolvableSdks(MockToolsConfig config) throws Exception {
