Skip to content

Commit 2644b97

Browse files
gunes-armmorgolock
authored andcommitted
fix: Relay --target in CCFLAGS to the assembler when building with Android(TM) NDK
Resolves: ARMCL-1255 Issue: #1254 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I7096eecc5839b9ffcedd632c81cc26b3c2e80eef
1 parent 87863af commit 2644b97

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

SConstruct

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
# Copyright (c) 2016-2025 Arm Limited.
3+
# Copyright (c) 2016-2026 Arm Limited.
44
#
55
# SPDX-License-Identifier: MIT
66
#
@@ -448,16 +448,19 @@ env['CC'] = env['compiler_cache']+ " " + compiler_prefix + c_compiler
448448
env['CXX'] = env['compiler_cache']+ " " + compiler_prefix + cpp_compiler
449449
env['LD'] = toolchain_prefix + "ld"
450450
env['AS'] = toolchain_prefix + "as"
451+
env['AR'] = toolchain_prefix + "ar"
452+
env['RANLIB'] = toolchain_prefix + "ranlib"
451453

452454
if env['os'] == 'windows':
453455
env['AR'] = "llvm-lib"
454456
env['RANLIB'] = "llvm-ranlib"
455457
env['AS'] = env['CC']
456458
env['ASFLAGS'] = []
457-
else:
458-
env['AR'] = toolchain_prefix + "ar"
459-
460-
env['RANLIB'] = toolchain_prefix + "ranlib"
459+
elif env['os'] == 'android':
460+
# If --target is specified in the NDK, we need to relay it to the assembler
461+
# See https://developer.android.com/ndk/guides/other_build_systems#overview
462+
# for more information on different ways to build.
463+
env.Append(ASFLAGS = env['extra_cc_flags'])
461464

462465
print("Using compilers:")
463466
print("CC", env['CC'])

0 commit comments

Comments
 (0)