Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: build/common.gypi

Issue 14065005: Introduce arm_version to allow building for armv5, v6 or v7. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update gyp defaults Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index d39128b1e23488a54a4aa840dd5caf5af1b20df6..908d4f72c25234aa3ca2dc0fb2898e5f01b15c78 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -211,11 +211,11 @@
# Python version.
'python_ver%': '2.6',
- # Set ARM-v7 compilation flags
- 'armv7%': 0,
+ # Set ARM architecture version.
+ 'arm_version%': 7,
Torne 2013/04/11 13:04:22 This changes the default; is this intentional?
Fredrik Öhrn 2013/04/11 13:42:19 Maybe I misunderstood your comments on the previou
Torne 2013/04/11 13:55:00 That envsetup.sh script is specifically for Androi
Fredrik Öhrn 2013/04/11 15:18:46 Well, I could perhaps add an arm_version 0 default
- # Set Neon compilation flags (only meaningful if armv7==1).
- 'arm_neon%': 1,
+ # Set Neon compilation flags.
+ 'arm_neon%': 0,
Torne 2013/04/11 13:04:22 Same here.
Fredrik Öhrn 2013/04/11 15:18:46 I have to keep arm_neon disabled when changing the
Fredrik Öhrn 2013/04/11 15:37:13 Turns out libvpx throws some handcrafted armv6 ass
# The system root for cross-compiles. Default: none.
'sysroot%': '',
@@ -610,7 +610,7 @@
['OS=="linux" and target_arch=="arm" and chromeos==0', {
# Set some defaults for arm/linux chrome builds
- 'armv7%': 1,
+ 'arm_version%': 7,
Torne 2013/04/11 13:04:22 This is setting it to the same value as above; if
'linux_breakpad%': 0,
'linux_use_tcmalloc%': 0,
# sysroot needs to be an absolute path otherwise it generates
@@ -709,7 +709,7 @@
'fastbuild%': '<(fastbuild)',
'dcheck_always_on%': '<(dcheck_always_on)',
'python_ver%': '<(python_ver)',
- 'armv7%': '<(armv7)',
+ 'arm_version%': '<(arm_version)',
'arm_neon%': '<(arm_neon)',
'sysroot%': '<(sysroot)',
'system_libdir%': '<(system_libdir)',
@@ -926,16 +926,6 @@
# Set to 1 to link against gsettings APIs instead of using dlopen().
'linux_link_gsettings%': 0,
- # Set Thumb compilation flags.
- 'arm_thumb%': 0,
-
- # Set ARM fpu compilation flags (only meaningful if armv7==1 and
- # arm_neon==0).
- 'arm_fpu%': 'vfpv3',
-
- # Set ARM float abi compilation flag.
- 'arm_float_abi%': 'softfp',
-
# Enable use of OpenMAX DL FFT routines.
'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
@@ -1036,6 +1026,9 @@
'windows_sdk_default_path': '<(DEPTH)/third_party/platformsdk_win8/files',
'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
+ # Backward compatibility only, use arm_version.
+ 'armv7': 0,
Torne 2013/04/11 13:04:22 This shouldn't be necessary; this value will alway
Fredrik Öhrn 2013/04/11 13:42:19 I had to put it in or gyp would throw and undefine
+
# Whether we are using the rlz library or not. Platforms like Android send
# rlz codes for searches but do not use the library.
'enable_rlz%': 0,
@@ -1174,7 +1167,7 @@
}],
['target_arch=="arm"', {
'conditions': [
- ['armv7==0', {
+ ['arm_version<7', {
'android_app_abi%': 'armeabi',
}, {
'android_app_abi%': 'armeabi-v7a',
@@ -1593,6 +1586,54 @@
['branding=="Chrome" and (OS=="win" or OS=="mac" or chromeos==1)', {
'enable_rlz%': 1,
}],
+
+ ['android_webview_build==1', {
+ # The WebView build gets its cpu-specific flags from the Android build system.
+ 'arm_arch%': '',
+ 'arm_tune%': '',
+ 'arm_fpu%': '',
+ 'arm_float_abi%': '',
+ 'arm_thumb%': 0,
+ }, {
+ 'conditions': [
Torne 2013/04/11 13:04:22 I generally prefer not to use nested conditions se
+ # Set default compiler flags depending on ARM version.
+ ['arm_version==5', {
+ # Flags suitable for Android emulator
+ 'arm_arch%': 'armv5te',
+ 'arm_tune%': 'xscale',
+ 'arm_fpu%': '',
+ 'arm_float_abi%': 'soft',
+ 'arm_thumb%': 0,
+ }],
+ ['arm_version==6', {
+ 'arm_arch%': 'armv6',
+ 'arm_tune%': '',
+ 'arm_fpu%': '',
+ 'arm_float_abi%': 'soft',
+ 'arm_thumb%': 0,
+ }],
+ ['arm_version==7', {
+ 'arm_arch%': 'armv7-a',
+ 'arm_tune%': 'cortex-a8',
+ 'conditions': [
+ ['arm_neon==1', {
+ 'arm_fpu%': 'neon',
+ }, {
+ 'arm_fpu%': 'vfpv3-d16',
+ }],
+ ],
+ 'arm_float_abi%': 'softfp',
+ 'arm_thumb%': 1,
+ }],
+ ],
+ }],
+
+ # Set armv7 for backward compatibility.
+ ['arm_version==7', {
+ 'armv7': 1,
+ }, {
+ 'armv7': 0,
+ }],
],
# List of default apps to install in new profiles. The first list contains
@@ -2793,25 +2834,31 @@
'-Wno-abi',
],
'conditions': [
- ['arm_thumb==1 and android_webview_build==0', {
+ ['arm_arch!=""', {
'cflags': [
- '-mthumb',
- ]
+ '-march=<(arm_arch)',
+ ],
}],
- ['armv7==1 and android_webview_build==0', {
+ ['arm_tune!=""', {
'cflags': [
- '-march=armv7-a',
- '-mtune=cortex-a8',
- '-mfloat-abi=<(arm_float_abi)',
+ '-mtune=<(arm_tune)',
],
- 'conditions': [
- ['arm_neon==1', {
- 'cflags': [ '-mfpu=neon', ],
- }, {
- 'cflags': [ '-mfpu=<(arm_fpu)', ],
- }],
+ }],
+ ['arm_fpu!=""', {
+ 'cflags': [
+ '-mfpu=<(arm_fpu)',
],
}],
+ ['arm_float_abi!=""', {
+ 'cflags': [
+ '-mfloat-abi=<(arm_float_abi)',
+ ],
+ }],
+ ['arm_thumb==1', {
+ 'cflags': [
+ '-mthumb',
+ ]
+ }],
['OS=="android"', {
# Most of the following flags are derived from what Android
# uses by default when building for arm, reference for which
@@ -2837,23 +2884,9 @@
'-fuse-ld=gold',
],
'conditions': [
- ['arm_thumb==1 and android_webview_build==0', {
+ ['arm_thumb==1', {
'cflags': [ '-mthumb-interwork' ],
}],
- ['armv7==0 and android_webview_build==0', {
- # Flags suitable for Android emulator
Torne 2013/04/11 13:04:22 This block doesn't seem to have a replacement..
Fredrik Öhrn 2013/04/11 13:42:19 It's replaced by the arm_version==5 block on line
- 'cflags': [
- '-march=armv5te',
- '-mtune=xscale',
- '-msoft-float',
- ],
- 'defines': [
- '__ARM_ARCH_5__',
- '__ARM_ARCH_5T__',
- '__ARM_ARCH_5E__',
- '__ARM_ARCH_5TE__',
- ],
- }],
['profiling==1', {
'cflags': [
'-marm', # Probably reduntant, but recommend by "perf" docs.
« no previous file with comments | « build/android/envsetup_functions.sh ('k') | skia/skia.gyp » ('j') | skia/skia.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698