Changeset 181143 in webkit


Ignore:
Timestamp:
Mar 6, 2015 1:18:58 AM (9 years ago)
Author:
Csaba Osztrogonác
Message:

run-jsc-stress-tests should determine the architecture from ELF binaries
https://bugs.webkit.org/show_bug.cgi?id=142335

Reviewed by Darin Adler.

  • Scripts/run-jsc-stress-tests:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r181131 r181143  
     12015-03-06  Csaba Osztrogonác  <ossy@webkit.org>
     2
     3        run-jsc-stress-tests should determine the architecture from ELF binaries
     4        https://bugs.webkit.org/show_bug.cgi?id=142335
     5
     6        Reviewed by Darin Adler.
     7
     8        * Scripts/run-jsc-stress-tests:
     9
    1102015-03-05  David Kilzer  <ddkilzer@apple.com>
    211
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r180639 r181143  
    251251end
    252252
    253 def determineArchitecture
     253def determineArchitectureFromMachOBinary
    254254    code = machOArchitectureCode
    255255    return nil unless code
     
    270270end
    271271
     272def determineArchitectureFromELFBinary
     273    f = File.open($jscPath.to_s)
     274    data = f.read(19)
     275
     276    if !(data[0,4] == "\x7F\x45\x4C\x46")
     277        $stderr.puts "Warning: Missing ELF magic in file #{Shellwords.shellescape($jscPath.to_s)}"
     278        return nil
     279    end
     280
     281    code = data[18].ord
     282    case code
     283    when 3
     284        "x86"
     285    when 62
     286        "x86-64"
     287    when 40
     288        "arm"
     289    when 183
     290        "arm64"
     291    else
     292        $stderr.puts "Warning: unable to determine architecture from code: #{code}"
     293        nil
     294    end
     295end
     296
     297def determineArchitecture
     298    case $hostOS
     299    when "darwin"
     300        determineArchitectureFromMachOBinary
     301    when "linux"
     302        determineArchitectureFromELFBinary
     303    else
     304        $stderr.puts "Warning: unable to determine architecture on this platform."
     305        nil
     306    end
     307end
     308
    272309def determineOS
    273310    case RbConfig::CONFIG["host_os"]
     
    284321end
    285322
     323$hostOS = determineOS unless $hostOS
    286324$architecture = determineArchitecture unless $architecture
    287 $hostOS = determineOS unless $hostOS
    288325
    289326if !$testRunnerType
Note: See TracChangeset for help on using the changeset viewer.