From d50563a6168f2d26a9db9ef422eccb4af33eb86c Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Fri, 11 Dec 2015 23:28:59 +0000 Subject: [PATCH] build: avoid to use ARMv5 machine flags by default To use this flags it is encouraged to set TARGET_ARCH to "*v5*" from. If unset, generic (buildsystem)'s flags will be used as expected. I noticed this while building with Tizen:2.4:Mobile toolchain (gbs) but it could also affect other ports or build infrastructures. Bug: https://jira.iotivity.org/browse/IOT-694 Change-Id: I4bc279e809474bf664b4825f201df471c66a191c Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/4541 Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- build_common/linux/SConscript | 6 +++--- build_common/tizen/SConscript | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build_common/linux/SConscript b/build_common/linux/SConscript index 2cb51b5b6..6a9393b79 100644 --- a/build_common/linux/SConscript +++ b/build_common/linux/SConscript @@ -22,7 +22,7 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC']) env.AppendUnique(LIBS = ['uuid']) env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread']) -# Set arch flags +# Set arch flags that match best TARGET_ARCH variable target_arch = env.get('TARGET_ARCH') if target_arch in ['x86']: env.AppendUnique(CCFLAGS = ['-m32']) @@ -30,6 +30,8 @@ if target_arch in ['x86']: elif target_arch in ['x86_64']: env.AppendUnique(CCFLAGS = ['-m64']) env.AppendUnique(LINKFLAGS = ['-m64']) +elif target_arch in ['arm'] or target_arch.find('v5') > 0: + env.AppendUnique(CPPFLAGS = ['-march=armv5te']) elif target_arch.find('v7a-hard') > 0: env.AppendUnique(CPPFLAGS = ['-march=armv7-a']) env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard']) @@ -39,5 +41,3 @@ elif target_arch.find('v7a') > 0: env.AppendUnique(CPPFLAGS = ['-march=armv7-a']) elif target_arch.find('arm64') >= 0: env.AppendUnique(CPPFLAGS = ['-march=armv8-a']) -else: - env.AppendUnique(CPPFLAGS = ['-march=armv5te']) diff --git a/build_common/tizen/SConscript b/build_common/tizen/SConscript index 4885b5722..69de96023 100644 --- a/build_common/tizen/SConscript +++ b/build_common/tizen/SConscript @@ -33,6 +33,8 @@ if target_arch in ['x86']: elif target_arch in ['x86_64']: env.AppendUnique(CCFLAGS = ['-m64']) env.AppendUnique(LINKFLAGS = ['-m64']) +elif target_arch in ['arm'] or target_arch.find('v5') > 0: + env.AppendUnique(CPPFLAGS = ['-march=armv5te']) elif target_arch.find('v7a-hard') > 0: env.AppendUnique(CPPFLAGS = ['-march=armv7-a']) env.AppendUnique(CPPFLAGS = ['-mfloat-abi=hard']) @@ -42,5 +44,3 @@ elif target_arch.find('v7a') > 0: env.AppendUnique(CPPFLAGS = ['-march=armv7-a']) elif target_arch.find('arm64') >= 0: env.AppendUnique(CPPFLAGS = ['-march=armv8-a']) -else: - env.AppendUnique(CPPFLAGS = ['-march=armv5te']) -- 2.34.1