Skip to content

Commit 8a068a6

Browse files
bnoordhuisJulien Gilli
authored andcommitted
deps: port fix v8 armv6 run-time detection
Port 297cadb from io.js. Original commit message: 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: nodejs/node#283 PR-URL: nodejs/node#559 Reviewed-By: Fedor Indutny <fedor@indutny.com>
1 parent 61fe1fe commit 8a068a6

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

deps/v8/src/base/cpu.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ CPU::CPU() : stepping_(0),
365365
//
366366
// See http://code.google.com/p/android/issues/detail?id=10812
367367
//
368-
// We try to correct this by looking at the 'elf_format'
368+
// We try to correct this by looking at the 'elf_platform'
369369
// field reported by the 'Processor' field, which is of the
370370
// form of "(v7l)" for an ARMv7-based CPU, and "(v6l)" for
371371
// an ARMv6-one. For example, the Raspberry Pi is one popular
@@ -377,6 +377,15 @@ CPU::CPU() : stepping_(0),
377377
}
378378
delete[] processor;
379379
}
380+
381+
// elf_platform moved to the model name field in Linux v3.8.
382+
if (architecture_ == 7) {
383+
char* processor = cpu_info.ExtractField("model name");
384+
if (HasListItem(processor, "(v6l)")) {
385+
architecture_ = 6;
386+
}
387+
delete[] processor;
388+
}
380389
}
381390

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

0 commit comments

Comments
 (0)