update gyp for ARM builds to be more well defined.

R=mtklein@google.com

Review URL: https://codereview.chromium.org/21096005

git-svn-id: http://skia.googlecode.com/svn/trunk@10454 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
djsollen@google.com 2013-07-31 12:57:27 +00:00
Родитель 76015b0953
Коммит f7542ba18e
7 изменённых файлов: 36 добавлений и 28 удалений

Просмотреть файл

@ -150,17 +150,28 @@
'cflags': [ 'cflags': [
'-mthumb', '-mthumb',
], ],
}], # The --fix-cortex-a8 switch enables a link-time workaround for
[ 'skia_arch_type == "arm" and armv7 == 1', { # an erratum in certain Cortex-A8 processors. The workaround is
'variables': { # enabled by default if you target the ARM v7-A arch profile.
'arm_neon_optional%': 0, # It can be enabled otherwise by specifying --fix-cortex-a8, or
}, # disabled unconditionally by specifying --no-fix-cortex-a8.
'defines': [ #
'__ARM_ARCH__=7', # The erratum only affects Thumb-2 code.
'conditions': [
[ 'arm_version < 7', {
'ldflags': [
'-Wl,--fix-cortex-a8',
],
}],
], ],
}],
[ 'skia_arch_type == "arm" and arm_version >= 7', {
'cflags': [ 'cflags': [
'-march=armv7-a', '-march=armv7-a',
], ],
'ldflags': [
'-march=armv7-a',
],
'conditions': [ 'conditions': [
[ 'arm_neon == 1', { [ 'arm_neon == 1', {
'defines': [ 'defines': [
@ -169,10 +180,6 @@
'cflags': [ 'cflags': [
'-mfpu=neon', '-mfpu=neon',
], ],
'ldflags': [
'-march=armv7-a',
'-Wl,--fix-cortex-a8',
],
}], }],
[ 'arm_neon_optional == 1', { [ 'arm_neon_optional == 1', {
'defines': [ 'defines': [

Просмотреть файл

@ -69,11 +69,11 @@
}], }],
[ 'skia_os == "ios"', { [ 'skia_os == "ios"', {
'skia_arch_type%': 'arm', 'skia_arch_type%': 'arm',
'armv7%': 1, 'arm_version%': 7,
'arm_neon%': 0, # neon asm files known not to work with the ios build 'arm_neon%': 0, # neon asm files known not to work with the ios build
},{ # skia_os is not ios },{ # skia_os is not ios
'skia_arch_type%': 'x86', 'skia_arch_type%': 'x86',
'armv7%': 0, 'arm_version%': 0,
'arm_neon%': 0, 'arm_neon%': 0,
}], }],
], ],
@ -121,8 +121,9 @@
# Re-define all variables defined within the level-2 'variables' dict, # Re-define all variables defined within the level-2 'variables' dict,
# so that siblings of the level-1 'variables' dict can see them. # so that siblings of the level-1 'variables' dict can see them.
'armv7%': '<(armv7)', 'arm_version%': '<(arm_version)',
'arm_neon%': '<(arm_neon)', 'arm_neon%': '<(arm_neon)',
'arm_neon_optional%': 0,
'skia_os%': '<(skia_os)', 'skia_os%': '<(skia_os)',
'os_posix%': '<(os_posix)', 'os_posix%': '<(os_posix)',
'skia_scalar%': '<(skia_scalar)', 'skia_scalar%': '<(skia_scalar)',

Просмотреть файл

@ -80,7 +80,7 @@
'../src/core/SkPaintOptionsAndroid.cpp', '../src/core/SkPaintOptionsAndroid.cpp',
], ],
}], }],
[ 'skia_os == "android" and skia_arch_type == "arm" and armv7 == 1', { [ 'skia_os == "android" and skia_arch_type == "arm"', {
# The code in SkUtilsArm.cpp can be used on an ARM-based Linux system, not only Android. # The code in SkUtilsArm.cpp can be used on an ARM-based Linux system, not only Android.
'sources': [ 'sources': [
'../src/core/SkPaintOptionsAndroid.cpp', '../src/core/SkPaintOptionsAndroid.cpp',

Просмотреть файл

@ -67,7 +67,7 @@
{ {
'target_name': 'libwebp_dsp_neon', 'target_name': 'libwebp_dsp_neon',
'conditions': [ 'conditions': [
['armv7 == 1', { ['arm_version >= 7', {
'type': 'static_library', 'type': 'static_library',
'include_dirs': [ 'include_dirs': [
'../third_party/externals/libwebp', '../third_party/externals/libwebp',
@ -82,7 +82,7 @@
'-mfpu=vfpv3-d16', '-mfpu=vfpv3-d16',
], ],
'cflags': [ '-mfpu=neon' ], 'cflags': [ '-mfpu=neon' ],
},{ # "armv7 != 1" },{ # !(arm_version >= 7)
'type': 'none', 'type': 'none',
}], }],
], ],

Просмотреть файл

@ -56,7 +56,7 @@
'../src/opts/SkUtils_opts_SSE2.cpp', '../src/opts/SkUtils_opts_SSE2.cpp',
], ],
}], }],
[ 'skia_arch_type == "arm" and armv7 == 1', { [ 'skia_arch_type == "arm" and arm_version >= 7', {
# The assembly uses the frame pointer register (r7 in Thumb/r11 in # The assembly uses the frame pointer register (r7 in Thumb/r11 in
# ARM), the compiler doesn't like that. # ARM), the compiler doesn't like that.
'cflags!': [ 'cflags!': [
@ -94,7 +94,7 @@
}], }],
], ],
}], }],
[ '(skia_arch_type == "arm" and armv7 == 0) or (skia_os == "ios")', { [ '(skia_arch_type == "arm" and arm_version < 7) or (skia_os == "ios")', {
'sources': [ 'sources': [
'../src/opts/SkBitmapProcState_opts_none.cpp', '../src/opts/SkBitmapProcState_opts_none.cpp',
'../src/opts/SkBlitRow_opts_none.cpp', '../src/opts/SkBlitRow_opts_none.cpp',

Просмотреть файл

@ -141,17 +141,17 @@ setup_device() {
case $TARGET_DEVICE in case $TARGET_DEVICE in
nexus_s) nexus_s)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 armv7=1 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=1"
DEFINES="${DEFINES} skia_texture_cache_mb_limit=24" DEFINES="${DEFINES} skia_texture_cache_mb_limit=24"
;; ;;
nexus_4 | nexus_7 | nexus_10) nexus_4 | nexus_7 | nexus_10)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 armv7=1 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=1"
;; ;;
xoom) xoom)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 armv7=1 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 arm_version=7 arm_thumb=1"
;; ;;
galaxy_nexus) galaxy_nexus)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 armv7=1 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=1 arm_version=7 arm_thumb=1"
DEFINES="${DEFINES} skia_texture_cache_mb_limit=32" DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
;; ;;
razr_i) razr_i)
@ -159,16 +159,16 @@ setup_device() {
DEFINES="${DEFINES} skia_texture_cache_mb_limit=32" DEFINES="${DEFINES} skia_texture_cache_mb_limit=32"
;; ;;
arm_v7) arm_v7)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon_optional=1 armv7=1 arm_thumb=0" DEFINES="${DEFINES} skia_arch_type=arm arm_neon_optional=1 arm_version=7 arm_thumb=0"
;; ;;
arm_v7_thumb) arm_v7_thumb)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon_optional=1 armv7=1 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon_optional=1 arm_version=7 arm_thumb=1"
;; ;;
arm) arm)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 armv7=0 arm_thumb=0" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 arm_thumb=0"
;; ;;
arm_thumb) arm_thumb)
DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 armv7=0 arm_thumb=1" DEFINES="${DEFINES} skia_arch_type=arm arm_neon=0 arm_thumb=1"
;; ;;
x86) x86)
DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32" DEFINES="${DEFINES} skia_arch_type=x86 skia_arch_width=32"

Просмотреть файл

@ -21,7 +21,7 @@
'android_arch%': "x86", 'android_arch%': "x86",
}, { }, {
'conditions': [ 'conditions': [
[ 'armv7', { [ 'arm_version == 7', {
'android_arch%': "armeabi-v7a", 'android_arch%': "armeabi-v7a",
}, { }, {
'android_arch%': "armeabi", 'android_arch%': "armeabi",