From a6c9d6aa02af261809b1c709ca635434e5d613fe Mon Sep 17 00:00:00 2001 From: Slava Barinov Date: Tue, 6 Apr 2021 20:31:14 +0900 Subject: [PATCH] Add hardfloat build support Change-Id: I4bb99951d9627623caa3dfcac84769d16156ad41 Signed-off-by: Slava Barinov --- SConstruct | 4 ++-- packaging/libarmcl.spec | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 274326f67..466604113 100644 --- a/SConstruct +++ b/SConstruct @@ -43,7 +43,7 @@ vars.AddVariables( BoolVariable("asserts", "Enable asserts (this flag is forced to 1 for debug=1)", False), BoolVariable("logging", "Logging (this flag is forced to 1 for debug=1)", False), EnumVariable("arch", "Target Architecture", "armv7a", - allowed_values=("armv7a", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64", + allowed_values=("armv7a", "armv7a-hf", "arm64-v8a", "arm64-v8.2-a", "arm64-v8.2-a-sve", "arm64-v8.2-a-sve2", "x86_32", "x86_64", "armv8a", "armv8.2-a", "armv8.2-a-sve", "armv8.6-a", "armv8.6-a-sve", "armv8.6-a-sve2", "armv8r64", "x86")), EnumVariable("estate", "Execution State", "auto", allowed_values=("auto", "32", "64")), EnumVariable("os", "Target OS", "linux", allowed_values=("linux", "android", "tizen", "macos", "bare_metal")), @@ -207,7 +207,7 @@ if 'v7a' in env['estate'] and env['estate'] == '64': prefix = "" if 'v7a' in env['arch']: env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon']) - if env['os'] == 'android' or env['os'] == 'tizen': + if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']: env.Append(CXXFLAGS = ['-mfloat-abi=softfp']) else: env.Append(CXXFLAGS = ['-mfloat-abi=hard']) diff --git a/packaging/libarmcl.spec b/packaging/libarmcl.spec index e3a30ef09..4739105e0 100644 --- a/packaging/libarmcl.spec +++ b/packaging/libarmcl.spec @@ -15,7 +15,9 @@ BuildRequires: scons %define OPEN_CL_SUPPORT 1 %define NEON_SUPPORT 1 +%ifnarch armv7hl %define BENCHMARK_TEST 1 +%endif %description The ARM Computer Vision and Machine Learning library is a set of functions optimised for both ARM CPUs and GPUs using SIMD technologies @@ -58,8 +60,12 @@ scons -j8 \ build=native \ %ifarch aarch64 arch=arm64-v8a \ -%else +%endif +%ifarch armv7l arch=armv7a \ +%endif +%ifarch armv7hl + arch=armv7a-hf %endif embed_kernels=1 \ %if 0%{?BENCHMARK_TEST} == 1 -- 2.34.1