Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: fix v8 armv6 run-time detection #559

Merged
merged 3 commits into from
Jan 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,6 @@ def is_arch_armv6():
'__ARM_ARCH_6M__' in cc_macros_cache)


def is_arm_neon():
"""Check for ARM NEON support"""
return '__ARM_NEON__' in cc_macros()


def is_arm_hard_float_abi():
"""Check for hardfloat or softfloat eabi on ARM"""
# GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify
Expand Down Expand Up @@ -468,14 +463,12 @@ def configure_arm(o):
arm_float_abi = 'default'

if is_arch_armv7():
o['variables']['arm_fpu'] = 'vfpv3'
o['variables']['arm_version'] = '7'
elif is_arch_armv6():
o['variables']['arm_version'] = '6'
else:
o['variables']['arm_version'] = 'default'
o['variables']['arm_fpu'] = 'vfpv2'
o['variables']['arm_version'] = '6' if is_arch_armv6() else 'default'

o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
o['variables']['arm_neon'] = int(is_arm_neon())
o['variables']['arm_thumb'] = 0 # -marm
o['variables']['arm_float_abi'] = arm_float_abi

Expand Down
11 changes: 10 additions & 1 deletion deps/v8/src/base/cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ CPU::CPU()
//
// See http://code.google.com/p/android/issues/detail?id=10812
//
// We try to correct this by looking at the 'elf_format'
// We try to correct this by looking at the 'elf_platform'
// field reported by the 'Processor' field, which is of the
// form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
// an ARMv6-one. For example, the Raspberry Pi is one popular
Expand All @@ -450,6 +450,15 @@ CPU::CPU()
}
delete[] processor;
}

// elf_platform moved to the model name field in Linux v3.8.
if (architecture_ == 7) {
char* processor = cpu_info.ExtractField("model name");
if (HasListItem(processor, "(v6l)")) {
architecture_ = 6;
}
delete[] processor;
}
}

// Try to extract the list of CPU features from ELF hwcaps.
Expand Down