diff --git a/Makefile b/Makefile index 56b7068910..b4fce9dd3d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ export CFLAGS = -Wall -DNDEBUG -O3 -Werror -DCHROMEOS_ENVIRONMENT export TOP = $(shell pwd) export FWDIR=$(TOP)/firmware export HOSTDIR=$(TOP)/host -export INCLUDES = -I$(FWDIR)/include +export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include export BUILD = ${TOP}/build export FWLIB = ${BUILD}/vboot_fw.a diff --git a/firmware/Makefile b/firmware/Makefile index 07e113a0cb..2dc804801a 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -12,7 +12,8 @@ INCLUDES = \ -I$(FWTOP)/include \ -I$(LIBDIR)/include \ -I$(LIBDIR)/cgptlib/include \ - -I$(LIBDIR)/cryptolib/include + -I$(LIBDIR)/cryptolib/include \ + -I$(STUBDIR)/include # find ./lib -iname '*.c' | sort diff --git a/firmware/include/sysincludes.h b/firmware/include/sysincludes.h index b98cae09ba..be7e701d83 100644 --- a/firmware/include/sysincludes.h +++ b/firmware/include/sysincludes.h @@ -31,7 +31,7 @@ #define UINT64_MULT32(v, multby) (((uint64_t)(v)) * ((uint32_t)(multby))) #else -#include "stub/biosincludes.h" +#include "biosincludes.h" #endif #endif /* VBOOT_REFERENCE_SYSINCLUDES_H_ */ diff --git a/firmware/lib/cgptlib/cgptlib_internal.c b/firmware/lib/cgptlib/cgptlib_internal.c index a436d8f35e..4e0a06ac32 100644 --- a/firmware/lib/cgptlib/cgptlib_internal.c +++ b/firmware/lib/cgptlib/cgptlib_internal.c @@ -130,7 +130,7 @@ int CheckEntries(GptEntry* entries, GptHeader* h, uint64_t drive_sectors) { /* Check all entries. */ for (i = 0, entry = entries; i < h->number_of_entries; i++, entry++) { GptEntry* e2; - int i2; + uint32_t i2; if (IsUnusedEntry(entry)) continue; diff --git a/firmware/lib/cgptlib/include/gpt.h b/firmware/lib/cgptlib/include/gpt.h index 1e8f47ff5d..cd5e12b9b7 100644 --- a/firmware/lib/cgptlib/include/gpt.h +++ b/firmware/lib/cgptlib/include/gpt.h @@ -83,7 +83,7 @@ typedef struct { uint32_t number_of_entries; uint32_t size_of_entry; uint32_t entries_crc32; - uint8_t reserved_padding[]; /* entire sector reserved for header */ + /* Remainder of sector is reserved and should be 0 */ } __attribute__((packed)) GptHeader; /* GPT partition entry defines the starting and ending LBAs of a partition. @@ -104,7 +104,7 @@ typedef struct { uint64_t whole; } attrs; uint16_t name[36]; /* UTF-16 encoded partition name */ - uint8_t reserved[]; /* nothing, really */ + /* Remainder of entry is reserved and should be 0 */ } __attribute__((packed)) GptEntry; #endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */ diff --git a/firmware/lib/cryptolib/rsa.c b/firmware/lib/cryptolib/rsa.c index 930d91b4a3..2aef52cfa3 100644 --- a/firmware/lib/cryptolib/rsa.c +++ b/firmware/lib/cryptolib/rsa.c @@ -170,7 +170,7 @@ int RSAVerify(const RSAPublicKey *key, } /* Check if digest matches. */ - for (; i < sig_len; ++i) { + for (; i < (int)sig_len; ++i) { if (buf[i] != *hash++) { #ifndef NDEBUG /* TODO(gauravsh): Replace with a macro call for logging. */