lmbench patches
cover lmbench patches
We recently stumbled upon two lmbench issues, one being discovered while investigating the other.
- lmbench's scripts/build script is declared as /bin/sh script, but uses bash only syntax which can lead to errors
- lmbench's install routine doesn't install the lmbench script itself
Here are two patches to address both issues.
Markus Mayer (2):
lmbench: mark scripts/build as bash script
lmbench: install the lmbench script on the target
package/lmbench/0001-build_use_bash.patch | 8 ++++++++ package/lmbench/0002-install_lmbench.patch | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 package/lmbench/0001-build_use_bash.patch create mode 100644 package/lmbench/0002-install_lmbench.patch
Signature · 1 line
2.17.1
PATCH 1/2 lmbench: mark scripts/build as bash script
While bash supports the "+=" operator for environment variables, /bin/sh does not. scripts/build is making use of "+=" but declares itself to be a /bin/sh script. This leads to errors of the form
../scripts/build: 21: ../scripts/build: LDLIBS+= -lm: not found
and doesn't change the contents of LDLIBS as was the intention.
Therefore, we change the interpreter to /bin/bash, which makes things work as intended.
--- package/lmbench/0001-build_use_bash.patch | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 package/lmbench/0001-build_use_bash.patch
package/lmbench/0001-build_use_bash.patch new file +8 -0
@@ -0,0 +1,8 @@ +--- lmbench-3.0-a9/scripts/build.orig 2006-06-27 09:25:18.000000000 -0700 ++++ lmbench-3.0-a9/scripts/build 2019-06-12 16:08:26.078093924 -0700 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + CC=${CC-`../scripts/compiler`} + MAKE=${MAKE-`../scripts/make`}
Signature · 1 line
2.17.1
PATCH 1/2 lmbench: mark scripts/build as bash script
Hello,
package/lmbench/0001-build_use_bash.patch
Quoted 20 lines · On Wed, 12 Jun 2019 16:39:33 -0700 Markus Mayer <[email protected]> wrote:
While bash supports the "+=" operator for environment variables,
/bin/shdoes not.scripts/buildis making use of "+=" but declares itself to be a/bin/shscript. This leads to errors of the form../scripts/build: 21: ../scripts/build: LDLIBS+= -lm: not foundand doesn't change the contents of LDLIBS as was the intention.
Therefore, we change the interpreter to
/bin/bash, which makes things work as intended.Signed-off-by Markus Mayer <[email protected]>--- package/lmbench/0001-build_use_bash.patch | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 package/lmbench/0001-build_use_bash.patchpackage/lmbench/0001-build_use_bash.patch new file +0
-0
We need all patches to have a description + Signed-off-by line. Ideally, they should be generated using git format-patch, but since there is apparently no upstream git repo for lmbench, that is not a requirement.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/2 lmbench: install the lmbench script on the target
In reply to Markus Mayerlmbench seems to be forgetting to install its main script when "make install" is being performed. Rectify this by adding lmbench to the list of executables.
--- package/lmbench/0002-install_lmbench.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/lmbench/0002-install_lmbench.patch
package/lmbench/0002-install_lmbench.patch new file +11 -0
@@ -0,0 +1,11 @@ +--- lmbench-3.0-a9/src/Makefile.orig 2007-04-10 05:16:49.000000000 -0700 ++++ lmbench-3.0-a9/src/Makefile 2019-06-12 16:11:49.955136809 -0700 +@@ -98,7 +98,7 @@ + $O/lat_select $O/lat_pipe $O/lat_rpc $O/lat_syscall $O/lat_tcp \ + $O/lat_udp $O/lat_mmap $O/mhz $O/lat_proc $O/lat_pagefault \ + $O/lat_connect $O/lat_fs $O/lat_sig $O/lat_mem_rd $O/lat_ctx \ +- $O/lat_sem \ ++ $O/lat_sem $O/lmbench \ + $O/memsize $O/lat_unix $O/lmdd $O/timing_o $O/enough \ + $O/msleep $O/loop_o $O/lat_fifo $O/lmhttp $O/lat_http \ + $O/lat_fcntl $O/disk $O/lat_unix_connect $O/flushdisk \
Signature · 1 line
2.17.1