Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index b8a87e09c707e3b6bc7cf47fcd41bbcdd8499e9a..7e4970e8f033eb615c48288267e8f00849ede1cc 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -164,6 +164,9 @@ |
# Set ARM architecture version. |
'arm_version%': 7, |
+ # Use Thumb on ARMv7 |
+ 'arm_thumb%':0, |
+ |
# Use aurax11 for clipboard implementation. This is true on linux_aura. |
'use_clipboard_aurax11%': 0, |
@@ -299,6 +302,7 @@ |
'buildtype%': '<(buildtype)', |
'branding%': '<(branding)', |
'arm_version%': '<(arm_version)', |
+ 'arm_thumb%': '<(arm_thumb)', |
'sysroot%': '<(sysroot)', |
'chroot_cmd%': '<(chroot_cmd)', |
'system_libdir%': '<(system_libdir)', |
@@ -2342,6 +2346,13 @@ |
}, { |
'use_seccomp_bpf%': 0, |
}], |
+ |
+ ['arm_thumb==1', { |
+ 'thumb_option%': "-mthumb", |
+ }, { |
+ 'thumb_option%': "", |
+ }], |
+ |
# Set component build with LTO until all tests pass. |
# This also reduces link time. |
['use_lto==1', { |
@@ -3799,6 +3810,7 @@ |
['target_arch=="arm"', { |
'target_conditions': [ |
['_toolset=="target"', { |
+ 'cflags': [ '<(thumb_option)' ], |
'conditions': [ |
['clang==0', { |
'cflags_cc': [ |
@@ -3872,16 +3884,9 @@ |
}], |
], |
}], |
- ['arm_thumb==1', { |
- 'cflags': [ |
- '-mthumb', |
- ], |
- 'conditions': [ |
- ['use_lto==1 or use_lto_o2==1', { |
- 'ldflags': [ |
- '-mthumb', |
- ], |
- }], |
+ ['use_lto==1 or use_lto_o2==1', { |
+ 'ldflags': [ |
+ '<(thumb_option)', |
], |
}], |
['OS=="android"', { |
@@ -4635,7 +4640,7 @@ |
'libraries': [ |
'-l<(android_stlport_library)', |
# Manually link the libgcc.a that the cross compiler uses. |
- '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)', |
+ '<!(<(android_toolchain)/*-gcc <(thumb_option) -print-libgcc-file-name)', |
'-lc', |
'-ldl', |
'-lm', |
@@ -4700,8 +4705,12 @@ |
'cflags': [ |
'-isystem<(android_stlport_include)', |
], |
- 'ldflags': [ |
- '-L<(android_stlport_libs_dir)', |
+ 'conditions': [ |
+ ['target_arch=="arm" and arm_thumb==1', { |
+ 'ldflags': [ '-L<(android_stlport_libs_dir)/thumb' ] |
+ }, { |
+ 'ldflags': [ '-L<(android_stlport_libs_dir)' ] |
+ }], |
], |
}, { # else: android_webview_build!=0 |
'aosp_build_settings': { |