diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2009-08-25 11:54:15 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2009-08-25 12:31:14 -0400 |
commit | d27e6fd532200873fe8cc23a155360114fe26110 (patch) | |
tree | cb3644c25555116bcf3070251cb89362ffee3d8c /main.cxx | |
parent | f0a68636d44065dfd60e685924b82e95195c0f9f (diff) | |
download | systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.tar.gz systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.tar.xz systemtap-steved-d27e6fd532200873fe8cc23a155360114fe26110.zip |
PR4186 cont'd: option #2: standardize on kernel ARCH/SUBARCH throughout
* main.cxx (main): Perform equivalent sed by hand on uname()->machine.
* stap.1.in: Clarify -a ARCH slightly.
* tapsets.cxx (validate_module_elf): Accept "arm*"for EM_ARM.
* tapset/**, testsuite/**: Removed/collapsed "i386"/"i686" branches,
renamed "ppc64"->"powerpc" and "s390x"->"s390".
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -462,12 +462,25 @@ main (int argc, char * const argv []) s.kernel_release = string (buf.release); s.kernel_build_tree = "/lib/modules/" + s.kernel_release + "/build"; - // Copy logic from coreutils uname (uname -i) to squash i?86 -> i386 - if (strlen(buf.machine)==4 && buf.machine[0] == 'i' && - buf.machine[2] == '8' && buf.machine[3] == '6') - buf.machine[1] = '3'; - - s.architecture = string (buf.machine); + // PR4186: Copy logic from coreutils uname (uname -i) to squash + // i?86->i386. Actually, copy logic from linux top-level Makefile + // to squash uname -m -> $(SUBARCH). + + string machine = buf.machine; + if (machine == "i486") machine = "i386"; + else if (machine == "i586") machine = "i386"; + else if (machine == "i686") machine = "i386"; + else if (machine == "sun4u") machine = "sparc64"; + else if (machine.substr(0,3) == "arm") machine = "arm"; + else if (machine == "sa110") machine = "arm"; + else if (machine == "s390x") machine = "s390"; + else if (machine.substr(0,3) == "ppc") machine = "powerpc"; + else if (machine.substr(0,4) == "mips") machine = "mips"; + else if (machine.substr(0,3) == "sh2") machine = "sh"; + else if (machine.substr(0,3) == "sh3") machine = "sh"; + else if (machine.substr(0,3) == "sh4") machine = "sh"; + + s.architecture = machine; for (unsigned i=0; i<5; i++) s.perpass_verbose[i]=0; s.timing = false; s.guru_mode = false; @@ -875,7 +888,7 @@ main (int argc, char * const argv []) // Warn in case the target kernel release doesn't match the running one. if (s.last_pass > 4 && (string(buf.release) != s.kernel_release || - string(buf.machine) != s.architecture)) + machine != s.architecture)) // NB: squashed ARCH by PR4186 logic { if(! s.suppress_warnings) cerr << "WARNING: kernel release/architecture mismatch with host forces last-pass 4." << endl; |