summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinter Wang <wente.wang@nxp.com>2016-10-14 20:01:10 +0800
committerWinter Wang <wente.wang@nxp.com>2016-11-15 13:41:25 +0800
commit07d401c20015002b41d9b3d01a30e37c09be4f83 (patch)
tree6e5300e970dcd31c0bc9f498b992c8e7d5c639df
parent60e14a6a07c58ff33498032a42bad20c34b62d71 (diff)
downloadu-boot-imx-07d401c20015002b41d9b3d01a30e37c09be4f83.zip
u-boot-imx-07d401c20015002b41d9b3d01a30e37c09be4f83.tar.gz
u-boot-imx-07d401c20015002b41d9b3d01a30e37c09be4f83.tar.bz2
MA-8986-2 libavb: fix build libavb
use gun99, add sysdeps for uboot env. Signed-off-by: Winter Wang <wente.wang@nxp.com>
-rw-r--r--lib/libavb/Makefile4
-rw-r--r--lib/libavb/avb_sysdeps.h5
-rw-r--r--lib/libavb/avb_sysdeps_uboot.c (renamed from lib/libavb/avb_sysdeps_posix.c)12
3 files changed, 8 insertions, 13 deletions
diff --git a/lib/libavb/Makefile b/lib/libavb/Makefile
index 7d3c219..98ec9f3 100644
--- a/lib/libavb/Makefile
+++ b/lib/libavb/Makefile
@@ -9,7 +9,7 @@ ccflags-y += -D_FILE_OFFSET_BITS=64 \
-Wno-psabi \
-Wno-unused-parameter \
-ffunction-sections \
- -fstack-protector-strong
+ -std=gnu99
obj-y += avb_ab_flow.o \
avb_descriptor.o \
avb_kernel_cmdline_descriptor.o \
@@ -26,4 +26,4 @@ obj-y += avb_ab_flow.o \
avb_hashtree_descriptor.o \
avb_sha256.o \
avb_util.o \
- avb_sysdeps_posix.o
+ avb_sysdeps_uboot.o
diff --git a/lib/libavb/avb_sysdeps.h b/lib/libavb/avb_sysdeps.h
index 98cbb4a..7fe9d06 100644
--- a/lib/libavb/avb_sysdeps.h
+++ b/lib/libavb/avb_sysdeps.h
@@ -38,11 +38,8 @@ extern "C" {
* like uint8_t, uint64_t, and bool (with |false|, |true| keywords)
* must be present.
*/
+#include <compiler.h>
#include <inttypes.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-
/* If you don't have gcc or clang, these attribute macros may need to
* be adjusted.
*/
diff --git a/lib/libavb/avb_sysdeps_posix.c b/lib/libavb/avb_sysdeps_uboot.c
index 39cd7db..be5c1d2 100644
--- a/lib/libavb/avb_sysdeps_posix.c
+++ b/lib/libavb/avb_sysdeps_uboot.c
@@ -22,11 +22,9 @@
* SOFTWARE.
*/
-#include <endian.h>
-#include <stdarg.h>
-#include <stdio.h>
+#include <common.h>
#include <stdlib.h>
-#include <string.h>
+#include <linux/string.h>
#include "avb_sysdeps.h"
@@ -46,9 +44,9 @@ int avb_strcmp(const char* s1, const char* s2) { return strcmp(s1, s2); }
size_t avb_strlen(const char* str) { return strlen(str); }
-void avb_abort(void) { abort(); }
+void avb_abort(void) { panic("avb_abort!\n"); }
-void avb_print(const char* message) { fprintf(stderr, "%s", message); }
+void avb_print(const char* message) { printf("%s", message); }
void avb_printv(const char* message, ...) {
va_list ap;
@@ -56,7 +54,7 @@ void avb_printv(const char* message, ...) {
va_start(ap, message);
for (m = message; m != NULL; m = va_arg(ap, const char*)) {
- fprintf(stderr, "%s", m);
+ printf("%s", m);
}
va_end(ap);
}