From 297cadbab6a37fa4f14811452e4621770a321371 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Jan 2015 21:50:35 +0100 Subject: [PATCH 1/3] deps: fix v8 armv6 run-time detection The elf_platform suffix in /proc/cpuinfo moved to the model name field in Linux 3.8. Out-of-tree patch pending https://codereview.chromium.org/867713003/ Fixes: https://github.com/iojs/io.js/issues/283 PR-URL: https://github.com/iojs/io.js/pull/559 Reviewed-By: Fedor Indutny --- deps/v8/src/base/cpu.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/deps/v8/src/base/cpu.cc b/deps/v8/src/base/cpu.cc index 56e1c4633c6e28..daf33023656028 100644 --- a/deps/v8/src/base/cpu.cc +++ b/deps/v8/src/base/cpu.cc @@ -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 @@ -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. From 7d9d7560cfbd24172ede690e74cedbb4b26e32c9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Jan 2015 21:51:38 +0100 Subject: [PATCH 2/3] configure: disable vfpv3 on armv6 VFPv3 is ARMv7-only, enabling it for ARMv6 is therefore always wrong. Mea culpa, I do believe I'm the original author of that change. Fixes: https://github.com/iojs/io.js/issues/283 PR-URL: https://github.com/iojs/io.js/pull/559 Reviewed-By: Fedor Indutny --- configure | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 5fe87b60fcd7a5..ef4de3e57cd42b 100755 --- a/configure +++ b/configure @@ -468,14 +468,14 @@ def configure_arm(o): arm_float_abi = 'default' if is_arch_armv7(): + o['variables']['arm_fpu'] = 'vfpv3' + o['variables']['arm_neon'] = int(is_arm_neon()) 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_neon'] = 0 + 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 From c6cd46041c70794d89634da380555fb613c2e0ab Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Jan 2015 21:52:33 +0100 Subject: [PATCH 3/3] configure: remove unused arm_neon variable Remove the configure check, the flag was dropped in V8 3.28. PR-URL: https://github.com/iojs/io.js/pull/559 Reviewed-By: Fedor Indutny --- configure | 7 ------- 1 file changed, 7 deletions(-) diff --git a/configure b/configure index ef4de3e57cd42b..f123fda5d5f0ce 100755 --- a/configure +++ b/configure @@ -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 @@ -469,11 +464,9 @@ def configure_arm(o): if is_arch_armv7(): o['variables']['arm_fpu'] = 'vfpv3' - o['variables']['arm_neon'] = int(is_arm_neon()) o['variables']['arm_version'] = '7' else: o['variables']['arm_fpu'] = 'vfpv2' - o['variables']['arm_neon'] = 0 o['variables']['arm_version'] = '6' if is_arch_armv6() else 'default' o['variables']['arm_thumb'] = 0 # -marm