diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-10-14 12:06:28 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-10-14 17:06:23 +0000 |
commit | cfac305f825dd23035281ac87f72dd2dd3300327 (patch) | |
tree | 30a2f7d185d26aa5ae2d231cec5090112c327a9e | |
parent | ba14c92054ec9d2b5827fa85f85733e5cf496bcf (diff) | |
download | ComputeLibrary-cfac305f825dd23035281ac87f72dd2dd3300327.tar.gz |
COMPMID-3599: Fix bare metal compilation issues
Newer toolchains don't have support for libssp. Make
sure not to compile with -fstack-protector on bare_metal
if the compiler version is greater than 7.0.0
Change-Id: I3f4e9496774e138ae13c4a5ec96902c19534a17f
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4154
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r-- | SConstruct | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct index 985f34c6cd..fdb8d5c308 100644 --- a/SConstruct +++ b/SConstruct @@ -25,12 +25,14 @@ import os import subprocess def version_at_least(version, required): - end = min(len(version), len(required)) - for i in range(0, end, 2): - if int(version[i]) < int(required[i]): + version_list = version.split('.') + required_list = required.split('.') + end = min(len(version_list), len(required_list)) + for i in range(0, end): + if int(version_list[i]) < int(required_list[i]): return False - elif int(version[i]) > int(required[i]): + elif int(version_list[i]) > int(required_list[i]): return True return True @@ -283,6 +285,9 @@ if not GetOption("help"): if compiler_ver == '4.8.3': env.Append(CXXFLAGS = ['-Wno-array-bounds']) + if not version_at_least(compiler_ver, '7.0.0') and env['os'] == 'bare_metal': + env.Append(LINKFLAGS = ['-fstack-protector-strong']) + if env['data_type_support']: if any(i in env['data_type_support'] for i in ['all', 'fp16']): env.Append(CXXFLAGS = ['-DENABLE_FP16_KERNELS']) |