aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorMotti Gondabi <motti.gondabi@arm.com>2021-12-21 13:19:29 +0200
committerMotti Gondabi <motti.gondabi@arm.com>2021-12-23 16:07:16 +0000
commitf76a502a73ca628e2a2556abeaa60ed17bb68d97 (patch)
treee714aeb4a20c84fa2fe9895bb5b7133c26e23357 /SConstruct
parentde60ed90fb9ce1f15e785a9b73b2e644c3dc3413 (diff)
downloadComputeLibrary-f76a502a73ca628e2a2556abeaa60ed17bb68d97.tar.gz
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 <motti.gondabi@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6847 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct27
1 files changed, 16 insertions, 11 deletions
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