Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ ifeq ($(USE_ARMCLANG),1)
endif
endif
LDFLAGS:=$(ARMCLANG_LDFLAGS) --map --list=wolfboot.map
LDFLAGS+=$(LDFLAGS_EXTRA)
LSCRIPT:=config/target.sct
LSCRIPT_IN:=hal/$(TARGET).sct
LSCRIPT_FLAGS:=--scatter=$(LSCRIPT)
Expand Down Expand Up @@ -565,7 +566,23 @@ include tools/test-renode.mk

hal/$(TARGET).o:

# Prebuilt keygen and sign supplied on the command line (a native build under
# Yocto, say) are used as-is; the in-tree keytools are built unless both are
# given, since the signing steps fall back to the in-tree sign tool.
ifeq ($(origin KEYGEN_TOOL),command line)
ifeq ($(origin SIGN_TOOL),command line)
KEYTOOLS_PREBUILT:=1
endif
endif
ifeq ($(KEYTOOLS_PREBUILT),1)
keytools_check:
$(Q)command -v "$(KEYGEN_TOOL)" >/dev/null || \
(echo "KEYGEN_TOOL is not executable: $(KEYGEN_TOOL)" >&2 && false)
$(Q)command -v "$(SIGN_TOOL)" >/dev/null || \
(echo "SIGN_TOOL is not executable: $(SIGN_TOOL)" >&2 && false)
else
keytools_check: keytools
endif

test-emu:
$(MAKE) -C test-app/emu-test-apps WOLFBOOT_ROOT="$(CURDIR)" test-emu
Expand Down
1 change: 1 addition & 0 deletions options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,7 @@ ifneq (,$(filter RISCV RISCV64,$(ARCH)))
endif

CFLAGS+=$(CFLAGS_EXTRA)
LDFLAGS+=$(LDFLAGS_EXTRA)
Comment thread
dgarske marked this conversation as resolved.
OBJS+=$(OBJS_EXTRA)

# The authenticated STM32H5 ECC256 secure-app path retains certificate parsing.
Expand Down
8 changes: 8 additions & 0 deletions src/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ uint32_t cpu_to_fdt32(uint32_t x)
{
#ifdef BIG_ENDIAN_ORDER
return x;
#elif defined(__riscv) && !defined(__riscv_zbb)
/* Without Zbb the builtin becomes a libgcc call, which a soft-float
* build on a Linux toolchain cannot link. */
return ((x & 0x000000FFU) << 24) | ((x & 0x0000FF00U) << 8) |
((x & 0x00FF0000U) >> 8) | ((x & 0xFF000000U) >> 24);
#else
return (uint32_t)__builtin_bswap32(x);
#endif
Expand All @@ -84,6 +89,9 @@ uint64_t cpu_to_fdt64(uint64_t x)
{
#ifdef BIG_ENDIAN_ORDER
return x;
#elif defined(__riscv) && !defined(__riscv_zbb)
return ((uint64_t)cpu_to_fdt32((uint32_t)x) << 32) |
(uint64_t)cpu_to_fdt32((uint32_t)(x >> 32));
#else
return (uint64_t)__builtin_bswap64(x);
#endif
Expand Down
3 changes: 3 additions & 0 deletions test-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,9 @@ ifeq ($(USE_ARMCLANG),1)
LDFLAGS:=$(ARMCLANG_LDFLAGS) --map --list=image.map --scatter=$(LSCRIPT)
endif

# After every target-specific LDFLAGS reset above, so it applies to all of them.
LDFLAGS+=$(LDFLAGS_EXTRA)

# Capture final flags for locally built wolfSSL objects.
WOLFSSL_CFLAGS:=$(CFLAGS)
WOLFTPM_CFLAGS:=$(CFLAGS)
Expand Down
Loading