Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Fix armv6 detection #14193

Closed
wants to merge 3 commits into from
Closed
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 @@ -393,11 +393,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 @@ -491,14 +486,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 @@ -365,7 +365,7 @@ CPU::CPU() : stepping_(0),
//
// 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 @@ -377,6 +377,15 @@ CPU::CPU() : stepping_(0),
}
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