From 87ce7f1e0fc80efdac00af3b20d535b393bb6f3d Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Thu, 26 Feb 2026 15:25:03 +0000 Subject: [PATCH] fix: Relay --target in CCFLAGS to the assembler when building with Android(TM) NDK Resolves: ARMCL-1255 Issue: https://github.com/ARM-software/ComputeLibrary/issues/1254 Signed-off-by: Gunes Bayir Change-Id: I7096eecc5839b9ffcedd632c81cc26b3c2e80eef --- SConstruct | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index 5c490a38de..b581fab4da 100644 --- a/SConstruct +++ b/SConstruct @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2016-2025 Arm Limited. +# Copyright (c) 2016-2026 Arm Limited. # # SPDX-License-Identifier: MIT # @@ -448,16 +448,19 @@ env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler env['LD'] = toolchain_prefix + "ld" env['AS'] = toolchain_prefix + "as" +env['AR'] = toolchain_prefix + "ar" +env['RANLIB'] = toolchain_prefix + "ranlib" if env['os'] == 'windows': env['AR'] = "llvm-lib" env['RANLIB'] = "llvm-ranlib" env['AS'] = env['CC'] env['ASFLAGS'] = [] -else: - env['AR'] = toolchain_prefix + "ar" - -env['RANLIB'] = toolchain_prefix + "ranlib" +elif env['os'] == 'android': + # If --target is specified in the NDK, we need to relay it to the assembler + # See https://developer.android.com/ndk/guides/other_build_systems#overview + # for more information on different ways to build. + env.Append(ASFLAGS = env['extra_cc_flags']) print("Using compilers:") print("CC", env['CC'])