Skip to content

Commit

Permalink
deps: fix v8 armv6 run-time detection
Browse files Browse the repository at this point in the history
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: #283
PR-URL: #559
Reviewed-By: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
bnoordhuis committed Jan 22, 2015
1 parent d481bb6 commit 297cadb
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 297cadb

Please sign in to comment.