Skip to content

Commit 75cd725

Browse files
committed
Fix linker warnings when building with otp
1 parent d573efa commit 75cd725

File tree

4 files changed

+33
-21
lines changed

4 files changed

+33
-21
lines changed

Makefile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ SIGN_ALG=
2626
OBJCOPY_FLAGS=
2727

2828
OBJS:= \
29-
./hal/$(TARGET).o \
3029
./src/string.o \
3130
./src/image.o \
32-
./src/libwolfboot.o
31+
./src/libwolfboot.o \
32+
./hal/$(TARGET).o
3333

3434
ifeq ($(SIGN),NONE)
3535
PRIVATE_KEY=
@@ -85,50 +85,50 @@ TARGET_H_TEMPLATE:=include/target.h.in
8585
ifeq ($(TZEN),1)
8686
ifeq ($(TARGET),stm32l5)
8787
# Don't build a contiguous image
88-
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
88+
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
8989
endif
9090

9191
ifeq ($(TARGET),stm32u5)
9292
# Don't build a contiguous image
93-
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
93+
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
9494
endif
9595

9696
ifeq ($(TARGET),stm32h5)
9797
# Don't build a contiguous image
98-
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
98+
MAIN_TARGET:=wolfboot.bin test-app/image_v1_signed.bin
9999
endif
100100
endif # TZEN=1
101101

102102
ifeq ($(TARGET),x86_64_efi)
103-
MAIN_TARGET:=wolfboot.efi
103+
MAIN_TARGET:=wolfboot.efi
104104
endif
105105

106106
ifeq ($(FSP), 1)
107-
MAIN_TARGET:=wolfboot_stage1.bin
107+
MAIN_TARGET:=wolfboot_stage1.bin
108108
endif
109109

110110
ifeq ($(TARGET),library)
111-
CFLAGS+=-g
112-
MAIN_TARGET:=test-lib
111+
CFLAGS+=-g
112+
MAIN_TARGET:=test-lib
113113
endif
114114

115115
ifeq ($(TARGET),raspi3)
116-
MAIN_TARGET:=wolfboot.bin
116+
MAIN_TARGET:=wolfboot.bin
117117
endif
118118

119119
ifeq ($(TARGET),sim)
120-
MAIN_TARGET:=wolfboot.bin tools/bin-assemble/bin-assemble test-app/image_v1_signed.bin internal_flash.dd
120+
MAIN_TARGET:=wolfboot.bin tools/bin-assemble/bin-assemble test-app/image_v1_signed.bin internal_flash.dd
121121
endif
122122

123123
ifeq ($(TARGET),nxp_p1021)
124-
MAIN_TARGET:=factory_wstage1.bin
124+
MAIN_TARGET:=factory_wstage1.bin
125125
endif
126126
ifeq ($(TARGET),nxp_t1024)
127-
MAIN_TARGET:=factory_wstage1.bin
127+
MAIN_TARGET:=factory_wstage1.bin
128128
endif
129129

130130
ifeq ($(FLASH_OTP_KEYSTORE),1)
131-
MAIN_TARGET:=include/target.h tools/keytools/otp/otp-keystore-primer factory.bin
131+
MAIN_TARGET+=tools/keytools/otp/otp-keystore-primer.bin
132132
endif
133133

134134
ASFLAGS:=$(CFLAGS)
@@ -177,11 +177,14 @@ standalone:
177177
$(Q)$(OBJCOPY) $(OBJCOPY_FLAGS) -O binary test-app/image.elf standalone.bin
178178
$(Q)$(SIZE) test-app/image.elf
179179

180+
180181
include tools/test.mk
181182
include tools/test-enc.mk
182183
include tools/test-delta.mk
183184
include tools/test-renode.mk
184185

186+
hal/$(TARGET).o:
187+
185188
keytools_check: keytools FORCE
186189

187190
$(PRIVATE_KEY):
@@ -367,7 +370,7 @@ cppcheck:
367370
--suppress="objectIndex" --suppress="comparePointers" \
368371
--error-exitcode=89 --std=c89 src/*.c hal/*.c hal/spi/*.c hal/uart/*.c
369372

370-
otp: tools/keytools/otp/otp-keystore-primer.bin
373+
otp: tools/keytools/otp/otp-keystore-primer.bin FORCE
371374

372375
tools/keytools/otp/otp-keystore-primer.bin: FORCE
373376
make -C tools/keytools/otp clean

include/wolfboot/wolfboot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ extern "C" {
177177

178178
#endif
179179

180-
#if defined __WOLFBOOT || defined __FLASH_OTP_PRIMER
180+
#if defined(__WOLFBOOT) || defined (__FLASH_OTP_PRIMER)
181181

182182
/* Authentication configuration */
183183
#if defined(WOLFBOOT_NO_SIGN)

tools/keytools/otp/Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
-include ../../../tools/config.mk
33
-include ../../../options.mk
44
-include ../../../wcs/pkcs11.mk
5+
V?=0
6+
ifeq ($(V),0)
7+
Q=@
8+
endif
59

610
TARGET?=none
711
ARCH?=ARM
@@ -28,14 +32,18 @@ CC=$(CROSS_COMPILE)gcc
2832
OBJCOPY?=$(CROSS_COMPILE)objcopy
2933
SIZE?=$(CROSS_COMPILE)size
3034

31-
3235
otp-keystore-primer.bin: otp-keystore-primer.elf
33-
@$(OBJCOPY) -O binary $(^) $(@)
36+
$(Q)$(OBJCOPY) -O binary $(^) $(@)
3437

3538
otp-keystore-primer.elf: $(PRI_KS_OBJS)
36-
@$(CC) -o otp-keystore-primer.elf $(LDFLAGS) $(CFLAGS) $(PRI_KS_OBJS)
37-
@$(SIZE) $(@)
39+
$(Q)$(CC) -o otp-keystore-primer.elf $(LDFLAGS) $(CFLAGS) $(PRI_KS_OBJS)
40+
$(Q)$(SIZE) $(@)
41+
42+
%.o: %.c
43+
$(Q)$(CC) $(CFLAGS) -c -o $@ $<
44+
45+
3846

3947

4048
clean:
41-
@rm -rf $(PRI_KS_OBJS) *.bin *.elf
49+
$(Q)rm -rf $(PRI_KS_OBJS) *.bin *.elf

tools/keytools/otp/target.ld

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MEMORY
44
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000 /* mapping Low-memory only */
55
}
66

7+
ENTRY(isr_reset);
78
SECTIONS
89
{
910
.text :

0 commit comments

Comments
 (0)