From f76a502a73ca628e2a2556abeaa60ed17bb68d97 Mon Sep 17 00:00:00 2001 From: Motti Gondabi Date: Tue, 21 Dec 2021 13:19:29 +0200 Subject: Fix SCons linking error when building for Multi ISA. When building for Multi ISA the link command throws: 'argument list too long' error since the list string being pass to the linker exceeds the ARG_MAX value. The solution is to split the object list into two distinct static libraries and have them link back together. Prohibit unknown variable use. The script now checks for unknown parameters. Resolves: COMPMID-4921 Change-Id: I97a27e86f90a7cc680a3c487da1c468cd3e1084e Signed-off-by: Motti Gondabi Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6847 Tested-by: Arm Jenkins Reviewed-by: Giorgio Arena Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins --- SConstruct | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 2a8403f8ce..28704d3459 100644 --- a/SConstruct +++ b/SConstruct @@ -126,6 +126,7 @@ vars.AddVariables( ("build_config", "Operator/Data-type/Data-layout configuration to use for tailored ComputeLibrary builds. Can be a JSON file or a JSON formatted string", "") ) + env = Environment(platform="posix", variables=vars, ENV = os.environ) build_path = env['build_dir'] # If build_dir is a relative path then add a #build/ prefix: @@ -248,6 +249,13 @@ if 'v7a' in env['estate'] and env['estate'] == '64': print("ERROR: armv7a architecture has only 32-bit execution state") Exit(1) +if 'sve' in env['arch']: + env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE']) + if 'sve2' in env['arch']: + env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE2']) +else: + env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON']) + # Add architecture specific flags prefix = "" if env['multi_isa']: @@ -262,17 +270,6 @@ if env['multi_isa']: else: # NONE "multi_isa" builds - if 'sve' in env['arch']: - env.Append(CPPDEFINES = ['ENABLE_SVE', 'ARM_COMPUTE_ENABLE_SVE']) - if 'sve2' in env['arch']: - env.Append(CPPDEFINES = ['ARM_COMPUTE_ENABLE_SVE2']) - else: - # FIXME: The NEON flags should be always defined for CPU. - # however, build fails when SVE/SVE2 & NEON flags - # defined together. - env.Append(CPPDEFINES = ['ENABLE_NEON', 'ARM_COMPUTE_ENABLE_NEON']) - - if 'v7a' in env['arch']: env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon']) if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']: @@ -483,3 +480,11 @@ if env['exceptions']: print("WARNING: Building tests for bare metal and armv7a is not supported") Return() SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0) + +# Unknown variables are not allowed +# Note: we must delay the call of UnknownVariables until after +# we have applied the Variables object to the construction environment +unknown = vars.UnknownVariables() +if unknown: + print("Unknown variables: %s" % " ".join(unknown.keys())) + Exit(1) \ No newline at end of file -- cgit v1.2.1