Skip to content

Commit

Permalink
deps: port fix v8 armv6 run-time detection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bnoordhuis authored and Julien Gilli committed Mar 30, 2015
1 parent 61fe1fe commit 8a068a6
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 @@ -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

0 comments on commit 8a068a6

Please sign in to comment.