Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optee-client: fix build with gcc 8.1
Fix for GCC 8.1, as described at OP-TEE/optee_client#126 Final fix to be provided via upstream and meta-linaro. Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
|
||
SRC_URI_append = " \ | ||
file://0001-Fix-for-teec_trace.c-snprintf-Werror-format-truncati.patch \ | ||
" |
28 changes: 28 additions & 0 deletions
28
...curity/optee/optee-client/0001-Fix-for-teec_trace.c-snprintf-Werror-format-truncati.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 30dd2986fb64aba7ee78d4e231c344e2c39d7999 Mon Sep 17 00:00:00 2001 | ||
From: Simon Hughes <simon.hughes@arm.com> | ||
Date: Thu, 21 Jun 2018 17:22:23 +0100 | ||
Subject: [PATCH] Fix for teec_trace.c snprintf -Werror=format-truncation= | ||
error. | ||
|
||
Signed-off-by: Simon Hughes <simon.hughes@arm.com> | ||
--- | ||
libteec/src/teec_trace.c | 3 ++- | ||
1 file changed, 2 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/libteec/src/teec_trace.c b/libteec/src/teec_trace.c | ||
index 78b79d6..c91bc43 100644 | ||
--- a/libteec/src/teec_trace.c | ||
+++ b/libteec/src/teec_trace.c | ||
@@ -106,7 +106,8 @@ int _dprintf(const char *function, int flen, int line, int level, | ||
*/ | ||
int thread_id = syscall(SYS_gettid); /* perf issue ? */ | ||
|
||
- snprintf(prefixed, MAX_PRINT_SIZE, | ||
+ int len = 0; | ||
+ len = snprintf(prefixed+len, MAX_PRINT_SIZE, | ||
"%s [%d] %s:%s:%d: %s", | ||
trace_level_strings[level], thread_id, prefix, func, | ||
line, raw); | ||
-- | ||
2.7.4 | ||
|