[oe] [meta-oe][PATCH] lmbench: Fix compilation error of gcc format-security

Martin Jansa martin.jansa at gmail.com
Tue Jul 19 11:02:18 UTC 2016


On Mon, Jul 18, 2016 at 04:38:58AM -0400, zhe.he at windriver.com wrote:
> From: He Zhe <zhe.he at windriver.com>
> 
> oe-core "security_flags: turn potential string format security issues
> into an error" add "-Wformat -Wformat-security -Werror=format-security"
> to the default SECURITY_CFLAGS, which may cause lmbench compilation
> failure.
> 
> This patch fixes lmbench's code.

Doesn't apply:

OE @ ~/meta-openembedded $ pwam 127413
2016-07-19 12:59:51 URL:https://patchwork.openembedded.org/patch/127413/mbox/ [2842] -> "pw-am-127413.patch" [1]
Applying: lmbench: Fix compilation error of gcc format-security
.git/rebase-apply/patch:28: space before tab in indent.
        sock = tcp_connect(server, prog, SOCKOPT_REUSE);
.git/rebase-apply/patch:29: space before tab in indent.
        sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file);
.git/rebase-apply/patch:30: space before tab in indent.
        if (debug) {
.git/rebase-apply/patch:33: space before tab in indent.
        }
.git/rebase-apply/patch:34: space before tab in indent.
        write(sock, buf, strlen(buf));
error: patch failed: meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb:18
error: meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb: patch does not apply
Patch failed at 0001 lmbench: Fix compilation error of gcc format-security
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Last change was a month ago:
OE @ ~/meta-openembedded $ git show --pretty=fuller -1 meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
commit 4adec181e7303c0afd7fca08fec6ddc5532237a1
Author:     Roy Li <rongqing.li at windriver.com>
AuthorDate: Thu May 5 09:52:01 2016 +0800
Commit:     Martin Jansa <Martin.Jansa at gmail.com>
CommitDate: Tue May 10 20:18:30 2016 +0200

    lmbench: avoid gcc optimize-away multiplication


please rebase before sending.

> 
> Signed-off-by: He Zhe <zhe.he at windriver.com>
> ---
>  ...ttp-Use-puts-instead-of-printf-to-avoid-f.patch | 26 ++++++++++++++++++++++
>  .../recipes-benchmark/lmbench/lmbench_3.0-a9.bb    |  1 +
>  2 files changed, 27 insertions(+)
>  create mode 100644 meta-oe/recipes-benchmark/lmbench/lmbench/lat_http-Use-puts-instead-of-printf-to-avoid-f.patch
> 
> diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/lat_http-Use-puts-instead-of-printf-to-avoid-f.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/lat_http-Use-puts-instead-of-printf-to-avoid-f.patch
> new file mode 100644
> index 0000000..8121e37
> --- /dev/null
> +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/lat_http-Use-puts-instead-of-printf-to-avoid-f.patch
> @@ -0,0 +1,26 @@
> +[PATCH] lat_http: Use puts instead of printf to avoid gcc
> +format-security error
> +
> +Upstream-Status: pending
> +
> +Signed-off-by: He Zhe <zhe.he at windriver.com>
> +---
> + src/lat_http.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/lat_http.c b/src/lat_http.c
> +index c630d59..42e64a1 100644
> +--- a/src/lat_http.c
> ++++ b/src/lat_http.c
> +@@ -27,7 +27,7 @@ http(char *server, char *file, int prog)
> + 	sock = tcp_connect(server, prog, SOCKOPT_REUSE);
> + 	sprintf(buf, "GET /%s HTTP/1.0\r\n\r\n\n", file);
> + 	if (debug) {
> +-		printf(buf);
> ++		puts(buf);
> + 	}
> + 	write(sock, buf, strlen(buf));
> + 	while ((n = read(sock, buf, XFERSIZE)) > 0) {
> +-- 
> +2.8.2
> +
> diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
> index 24cd0b0..b5edaeb 100644
> --- a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
> +++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb
> @@ -18,6 +18,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
>             file://use-base_libdir-instead-of-hardcoded-lib.patch \
>             file://lmbench_result_html_report.patch \
>             file://fix-lmbench-memory-check-failure.patch \
> +           file://lat_http-Use-puts-instead-of-printf-to-avoid-f.patch \
>  "
>  SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
>  SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
> -- 
> 2.8.1
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20160719/33048562/attachment-0002.sig>


More information about the Openembedded-devel mailing list