Skip to content

Commit

Permalink
uname for machine name
Browse files Browse the repository at this point in the history
uname -p is not portable - should use uname -m to retrieve machine name
    in user code

Signed-off-by: Thierry <[email protected]>
  • Loading branch information
tfauck committed Jan 9, 2020
1 parent 216261b commit ed0f6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion perf/unixbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUp(self):
self.tmpdir = data_dir.get_tmp_dir()
self.report_data = self.err = None
self.build_dir = self.params.get('build_dir', default=self.tmpdir)
for package in ['gcc', 'make']:
for package in ['gcc', 'make', 'patch']:
if not smm.check_installed(package) and not smm.install(package):
self.cancel('%s is needed for the test to be run' % package)
url = 'https://github.com/kdlucas/byte-unixbench/archive/master.zip'
Expand All @@ -45,6 +45,8 @@ def setUp(self):
self.sourcedir = os.path.join(self.workdir,
"byte-unixbench-master/UnixBench")
os.chdir(self.sourcedir)
makefile_patch = 'patch -p0 < %s' % self.get_data('make1.patch')
process.run(makefile_patch, shell=True)
build.make(self.sourcedir)

def test(self):
Expand Down
11 changes: 11 additions & 0 deletions perf/unixbench.py.data/make1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- Makefile.orig 2020-01-09 18:35:13.509293580 +0100
+++ Makefile 2020-01-09 18:33:49.723976623 +0100
@@ -89,7 +89,7 @@

## OS detection. Comment out if gmake syntax not supported by other 'make'.
OSNAME:=$(shell uname -s)
- ARCH := $(shell uname -p)
+ ARCH := $(shell uname -m)
ifeq ($(OSNAME),Linux)
# Not all CPU architectures support "-march" or "-march=native".
# - Supported : x86, x86_64, ARM, AARCH64, etc..

0 comments on commit ed0f6f2

Please sign in to comment.