summaryrefslogtreecommitdiffstats
path: root/main.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-08-24 12:54:42 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-08-24 12:57:21 -0400
commit0cd2665ec298fb30765f7f2fae019d525fc5b272 (patch)
treec4ffda7c1845623f6ccdfd72166f9e0803292d0e /main.cxx
parenteee1205e70ce33fd3276baeafea85a77e4bca2e1 (diff)
downloadsystemtap-steved-0cd2665ec298fb30765f7f2fae019d525fc5b272.tar.gz
systemtap-steved-0cd2665ec298fb30765f7f2fae019d525fc5b272.tar.xz
systemtap-steved-0cd2665ec298fb30765f7f2fae019d525fc5b272.zip
PR4186 cont'd: fix 32-bit i386 builds
* main.cxx (main): Initialize s.architecture to value as if from `uname -i`. Specifically, squash i?86 -> i386.
Diffstat (limited to 'main.cxx')
-rw-r--r--main.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.cxx b/main.cxx
index d62c2fac..6c7dc315 100644
--- a/main.cxx
+++ b/main.cxx
@@ -462,6 +462,11 @@ 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);
for (unsigned i=0; i<5; i++) s.perpass_verbose[i]=0;
s.timing = false;