Skip to content

Commit 297cadb

Browse files
committed
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: #283 PR-URL: #559 Reviewed-By: Fedor Indutny <[email protected]>
1 parent d481bb6 commit 297cadb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

deps/v8/src/base/cpu.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ CPU::CPU()
438438
//
439439
// See http://code.google.com/p/android/issues/detail?id=10812
440440
//
441-
// We try to correct this by looking at the 'elf_format'
441+
// We try to correct this by looking at the 'elf_platform'
442442
// field reported by the 'Processor' field, which is of the
443443
// form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
444444
// an ARMv6-one. For example, the Raspberry Pi is one popular
@@ -450,6 +450,15 @@ CPU::CPU()
450450
}
451451
delete[] processor;
452452
}
453+
454+
// elf_platform moved to the model name field in Linux v3.8.
455+
if (architecture_ == 7) {
456+
char* processor = cpu_info.ExtractField("model name");
457+
if (HasListItem(processor, "(v6l)")) {
458+
architecture_ = 6;
459+
}
460+
delete[] processor;
461+
}
453462
}
454463

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

0 commit comments

Comments
 (0)